tiagobento commented on code in PR #2207: URL: https://github.com/apache/incubator-kie-tools/pull/2207#discussion_r1569335990
########## packages/dmn-testing-models/README.md: ########## @@ -0,0 +1,21 @@ +## DMN testing models + +This package is meant to contain all the DMN models published inside [kie-dmn-test-resources](https://github.com/apache/incubator-kie-drools/tree/main/kie-dmn/kie-dmn-test-resources) to make them available for testing purposes. + +Models are separated between < 1.5 version and 1.5 version; such classification is based on actual version-specific features, and not on the referenced tag itself. + +For future DMN versions there will be version specific folders. + +The original `org.kie:kie-dmn-test-resources` also contains _invalid_ models, but for the moment being we use only the valid ones to verify round-trip validation. + +### Usage + +The command `mvn clean generate-resources` downloads the jar and extract the models under `dist/`. + +To make them available for testing purpose: + +1. set the `KOGITO_RUNTIME_version` in the terminal (if different from the default one) +2. `pnpm bootstrap` on the root directory +3. cd dmn-testing-models +4. `pnpm install` (this creates the required mvn configuration) Review Comment: Nto necessary. `install` scripts are executed as part of the `bootstrap` script, when `bootstrap` does `pnpm install`. ########## packages/dmn-marshaller-backend-compatibility-tester/package.json: ########## @@ -0,0 +1,33 @@ +{ Review Comment: I guess this package needs to be private... we don't want to publish this to NPM, do we? ########## packages/dmn-marshaller/tests/dmnValidation.test.ts: ########## @@ -0,0 +1,156 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import * as fs from "fs"; +import * as path from "path"; +import { getMarshaller } from "@kie-tools/dmn-marshaller"; +import { fail } from "assert"; +import { + DmnBackendCompatibilityScript, + executeJBangScript, +} from "@kie-tools/dmn-marshaller-backend-compatibility-tester"; + +/** + * This test suite validates the xml produced (parsed and built) by the marshaller relying on KIE DMN Validator + * (https://github.com/apache/incubator-kie-drools/tree/main/kie-dmn/kie-dmn-validation). + * A JBang script is used to actually call the KIE DMN Validator Java code. + */ + +const dmnTestingModelsPath = require.resolve("@kie-tools/dmn-testing-models"); Review Comment: Ok, so I guess that's what you need the `index.js` for. You can change this to ```ts path.dirname(require.resolve("@kie-tools/dmn-testing-models/package.json")) ``` so that you don't need the index.js there :) ########## packages/dmn-testing-models/index.js: ########## @@ -0,0 +1,20 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/** Empty Entrypoint of this module - No TS/JS code here, it just holds DMN files for testing purposes */ Review Comment: We don't need this file at all, do we? ########## packages/dmn-marshaller-backend-compatibility-tester/src/index.ts: ########## @@ -0,0 +1,54 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import * as path from "path"; +const buildEnv = require("../env"); +const jbang = require("@jbangdev/jbang"); + +export enum DmnBackendCompatibilityScript { + PARENT_SCRIPT, + DMN_VALIDATION, + DMN_SEMANTIC_COMPARISON, +} + +const dmnBackendCompatibilityScriptPaths = new Map([ + [ + DmnBackendCompatibilityScript.PARENT_SCRIPT, + path.join(__dirname, "..", "src", "DmnMarshallerBackendCompatibilityTesterScript.java"), + ], + [DmnBackendCompatibilityScript.DMN_VALIDATION, path.join(__dirname, "..", "src", "DmnValidation.java")], + [ + DmnBackendCompatibilityScript.DMN_SEMANTIC_COMPARISON, + path.join(__dirname, "..", "src", "DmnSemanticComparison.java"), + ], +]); + +export function executeJBangScript(script: DmnBackendCompatibilityScript, ...args: string[]) { + /* Windows requires double quotes to wrap the argument, while in POSIX it must be wrapped by single quotes */ + const isWindowsPath = path.sep !== "/"; + const quoteChar = isWindowsPath ? '"' : "'"; + const scriptPath = dmnBackendCompatibilityScriptPaths.get(script); + + const jbangArgs = [] as string[]; + jbangArgs.push("-Dkogito-runtime.version=" + buildEnv.env.kogitoRuntime.version); + jbangArgs.push(scriptPath!); + args?.forEach((arg) => jbangArgs.push(quoteChar + arg + quoteChar)); + + jbang.exec("properties@jbangdev", "java.version"); + jbang.exec(jbangArgs.join(" ")); +} Review Comment: We discussed making the JBang completely abstracted from the caller, no? This would then become a method that accepts parameters using an object parameter, instead of exposing the command itself. Let's make JBang an implementation detail of this package, instead of leaking it to the consumers. ########## packages/dmn-marshaller/tests/xsdValidation.test.ts: ########## @@ -0,0 +1,65 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import * as fs from "fs"; +import * as path from "path"; +import { getMarshaller } from "@kie-tools/dmn-marshaller"; +import * as validator from "xsd-schema-validator"; + +/** + * This test suite validates the xml produced (parsed and built) by the marshaller against DMN 1.5 XML Schema. + * The validation is performed by a 3rd party library (xsd-schema-validator) + */ Review Comment: Outdated comment? ########## packages/dmn-marshaller-backend-compatibility-tester/README.md: ########## @@ -0,0 +1,36 @@ +### Module Description Review Comment: ```suggestion ### DMN Marshaller backend compatibility tester ``` ? ########## packages/dmn-testing-models/env/index.js: ########## @@ -0,0 +1,31 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +const { varsWithName, composeEnv } = require("@kie-tools-scripts/build-env"); + +module.exports = composeEnv([require("@kie-tools/root-env/env")], { + vars: varsWithName({}), + get env() { + return { + dmnTestingModel: { + version: require("../package.json").version, + }, Review Comment: ```suggestion dmnTestingModels: { version: require("../package.json").version, }, ``` ########## packages/dmn-marshaller/package.json: ########## @@ -51,6 +53,7 @@ "jest-when": "^3.5.0", "rimraf": "^3.0.2", "ts-jest": "^26.5.6", - "typescript": "^4.6.2" + "typescript": "^4.6.2", + "xsd-schema-validator": "^0.9.0" Review Comment: Not needed anymore, I suppose? ########## packages/dmn-testing-models/pom.xml: ########## @@ -0,0 +1,138 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!-- + ~ Licensed to the Apache Software Foundation (ASF) under one + ~ or more contributor license agreements. See the NOTICE file + ~ distributed with this work for additional information + ~ regarding copyright ownership. The ASF licenses this file + ~ to you under the Apache License, Version 2.0 (the + ~ "License"); you may not use this file except in compliance + ~ with the License. You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, + ~ software distributed under the License is distributed on an + ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + ~ KIND, either express or implied. See the License for the + ~ specific language governing permissions and limitations + ~ under the License. +--> +<project + xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" +> + + <modelVersion>4.0.0</modelVersion> + <groupId>org.kie.tools</groupId> + <artifactId>dmn-testing-models</artifactId> + <version>${revision}</version> + <packaging>jar</packaging> + + <name>DMN Testing Models</name> + <description>Testing models for DMN marshaller</description> Review Comment: Can you please make this pom.xml file declare `maven-base` as parent? Please see https://github.com/apache/incubator-kie-tools/pull/2195#issuecomment-2061743588 ########## packages/dmn-marshaller-backend-compatibility-tester/README.md: ########## @@ -0,0 +1,36 @@ +### Module Description + +The scope of this module is to provide a reliable scripting mechanism that tests DMN Files generated by the `dmn-marshaller` module against the backend counterpart code that lives in the drools repository. Review Comment: ```suggestion The scope of this module is to provide a reliable scripting mechanism that tests DMN Files generated by the `dmn-marshaller` package against the backend counterpart code that lives in the drools repository. ``` ########## packages/dmn-marshaller-backend-compatibility-tester/README.md: ########## @@ -0,0 +1,36 @@ +### Module Description + +The scope of this module is to provide a reliable scripting mechanism that tests DMN Files generated by the `dmn-marshaller` module against the backend counterpart code that lives in the drools repository. +The scripts are based on [JBang!](https://www.jbang.dev/) which provides an out-of-the-box library to be consumed in NodeJs. + +At the moment of writing, two scripts are available: + +- DMN Validation, which can validate a DMN file (and its imported DMN assets) using the [KIE DMN Validator](https://github.com/apache/incubator-kie-drools/tree/main/kie-dmn/kie-dmn-validation) back-end module. +- DMN Semantic Comparison, which compares two DMN files (and their imported DMN assets) using a Backend logic that relies on KIE DMN Engine core code. + +Every script is defined in a single Java class. Inside those, you can find a list of fields (marked with `@Option` annotation) that represent the commands and their required parameters to run the scripts. + +An abstract class is defined as the parent class of all defined scripts. That class holds all the Dependencies required by all the Java class scripts that implement it. This is required to enable a dependency fetching mechanism useful for: + +- Avoid issues when launching several JBang instances. This case may lead to issues with internal JBang caching. +- In CI/CD, it's sometimes required to download all the required dependencies in an earlier phase and then build the project. + To run the dependency fetching mechanism, you can just launch the jbang command passing that Abstract class location (no args). + To keep this mechanism consistent, please always declare all the required dependencies in the abstract superclass. + The dependency fetching mechanism can be called externally from a `package.json` script using the `dependenciesFetch.js` file, using the following command: + `node dist/dependenciesFetch.js`. + It's not possible to directly call JBang in the package.json script because when the JBang NPM library installs JBang in the local machine with the preinstall hook, it requires a new Shell for changes to take effect. + +### Usage + +The entry point of this module is the `index.js` file that exports: + +- `executeJBangScript` that requires as parameters: the Script to execute (see below) and its required args. +- The enumeration of the currently available Script + That represents all the required elements for consuming this module externally. + +To execute a specific JBang script present in this module you must: + +- Import the `"@kie-tools/dmn-marshaller-backend-compatibility-tester": "workspace:*"` dependency; Review Comment: ```suggestion - Import the `"@kie-tools/dmn-marshaller-backend-compatibility-tester" dependency; ``` No need to expose the inner mechanisms of `pnpm` (`workspace:*`) here. ########## packages/dmn-marshaller/tests/dmnValidation.test.ts: ########## @@ -0,0 +1,156 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import * as fs from "fs"; +import * as path from "path"; +import { getMarshaller } from "@kie-tools/dmn-marshaller"; +import { fail } from "assert"; +import { + DmnBackendCompatibilityScript, + executeJBangScript, +} from "@kie-tools/dmn-marshaller-backend-compatibility-tester"; + +/** + * This test suite validates the xml produced (parsed and built) by the marshaller relying on KIE DMN Validator + * (https://github.com/apache/incubator-kie-drools/tree/main/kie-dmn/kie-dmn-validation). + * A JBang script is used to actually call the KIE DMN Validator Java code. + */ + +const dmnTestingModelsPath = require.resolve("@kie-tools/dmn-testing-models"); + +const dmnTestingModels = [ + "../valid_models/DMNv1_5/AllowedValuesChecksInsideCollection.dmn", + "../valid_models/DMNv1_5/DateToDateTimeFunction.dmn", + "../valid_models/DMNv1_5/ForLoopDatesEvaluate.dmn", + "../valid_models/DMNv1_5/Imported_Model_Unamed.dmn", + "../valid_models/DMNv1_5/ListReplaceEvaluate.dmn", + "../valid_models/DMNv1_5/NegationOfDurationEvaluate.dmn", + "../valid_models/DMNv1_5/TypeConstraintsChecks.dmn", + "../valid_models/DMNv1_x/multiple/Financial.dmn", + "../valid_models/DMNv1_x/multiple/Imported_Traffic_Violation.dmn", + "../valid_models/DMNv1_x/multiple/stdlib.dmn", + "../valid_models/DMNv1_x/allTypes.dmn", + "../valid_models/DMNv1_x/dtevent.dmn", + "../valid_models/DMNv1_x/habitability.dmn", + "../valid_models/DMNv1_x/loan.dmn", + "../valid_models/DMNv1_x/LoanEligibility.dmn", + "../valid_models/DMNv1_x/OneOfEachType.dmn", + "../valid_models/DMNv1_x/Prequalification.dmn", + "../valid_models/DMNv1_x/testWithExtensionElements.dmn", + "../valid_models/DMNv1_x/Traffic Violation Simple.dmn", + "../valid_models/DMNv1_x/Traffic Violation.dmn", +]; + +const dmnTestingImportedModels = [ + { + imported: "../valid_models/DMNv1_5/Imported_Model_Unamed.dmn", + importer: "../valid_models/DMNv1_5/Importing_EmptyNamed_Model_With_Href_Namespace.dmn", + }, + { + imported: "../valid_models/DMNv1_5/Imported_Model_Unamed.dmn", + importer: "../valid_models/DMNv1_5/Importing_EmptyNamed_Model_Without_Href_Namespace.dmn", + }, + { + imported: "../valid_models/DMNv1_5/Imported_Model_Unamed.dmn", + importer: "../valid_models/DMNv1_5/Importing_Named_Model.dmn", + }, + { + imported: "../valid_models/DMNv1_5/Imported_Model_Unamed.dmn", + importer: "../valid_models/DMNv1_5/Importing_OverridingEmptyNamed_Model.dmn", + }, + { + imported: "../valid_models/DMNv1_x/multiple/Imported_Traffic_Violation.dmn", + importer: "../valid_models/DMNv1_x/multiple/Traffic Violation With Import.dmn", + }, +]; +export const dmnValidationGeneratedFilesDirectory = path.join(__dirname, "../dist-tests/dmnValidation-generated-files"); + +describe("DMN Validation", () => { + beforeAll(() => { + if (fs.existsSync(dmnValidationGeneratedFilesDirectory)) { + fs.rmSync(dmnValidationGeneratedFilesDirectory, { recursive: true }); + } + fs.mkdirSync(dmnValidationGeneratedFilesDirectory, { recursive: true }); + }); + + for (const file of dmnTestingModels) { + testFile(path.join(dmnTestingModelsPath, file)); + } + for (const file of dmnTestingImportedModels) { + file.imported = path.join(dmnTestingModelsPath, file.imported); + file.importer = path.join(dmnTestingModelsPath, file.importer); + testImportedFile(file); + } +}); + +function testFile(normalizedFsPathRelativeToTheFile: string) { + test( + "DMN Validation: " + + normalizedFsPathRelativeToTheFile.substring(normalizedFsPathRelativeToTheFile.lastIndexOf(path.sep) + 1), + () => { + const generatedXMLFilePath = parseXMLAndWriteInFile(normalizedFsPathRelativeToTheFile); + + try { + executeJBangScript( + DmnBackendCompatibilityScript.DMN_VALIDATION, + "--command=no_imports", + "--dmnFilePath=" + generatedXMLFilePath + ); + } catch (error) { + fail(error.cause); + } + } + ); +} + +function testImportedFile(normalizedFsPathRelativeToTheFiles: { imported: string; importer: string }) { + test( + "DMN Validation: " + + normalizedFsPathRelativeToTheFiles.importer.substring( + normalizedFsPathRelativeToTheFiles.importer.lastIndexOf(path.sep) + 1 + ), + () => { + const importedGeneratedXMLFilePath = parseXMLAndWriteInFile(normalizedFsPathRelativeToTheFiles.imported); + const importerGeneratedXMLFilePath = parseXMLAndWriteInFile(normalizedFsPathRelativeToTheFiles.importer); + + try { + executeJBangScript( + DmnBackendCompatibilityScript.DMN_VALIDATION, + "--command=with_imports", + "--dmnFilePath=" + importedGeneratedXMLFilePath, + "--importedDmnFilesPaths=" + importerGeneratedXMLFilePath + ); + } catch (error) { + fail(error.cause); + } + } + ); +} + +function parseXMLAndWriteInFile(normalizedFsPathRelativeToTheFile: string): string { Review Comment: We usually do camelCase acronyms.. So `XML` would become `Xml` here. ########## packages/dmn-marshaller/tests/idempotency.test.ts: ########## @@ -21,6 +21,8 @@ import * as fs from "fs"; import * as path from "path"; import { getMarshaller } from "@kie-tools/dmn-marshaller"; +const dmnTestingModels = require.resolve("@kie-tools/dmn-testing-models"); Review Comment: Same as above. ########## packages/dmn-testing-models/README.md: ########## @@ -0,0 +1,21 @@ +## DMN testing models + +This package is meant to contain all the DMN models published inside [kie-dmn-test-resources](https://github.com/apache/incubator-kie-drools/tree/main/kie-dmn/kie-dmn-test-resources) to make them available for testing purposes. + +Models are separated between < 1.5 version and 1.5 version; such classification is based on actual version-specific features, and not on the referenced tag itself. + +For future DMN versions there will be version specific folders. + +The original `org.kie:kie-dmn-test-resources` also contains _invalid_ models, but for the moment being we use only the valid ones to verify round-trip validation. + +### Usage + +The command `mvn clean generate-resources` downloads the jar and extract the models under `dist/`. + +To make them available for testing purpose: + +1. set the `KOGITO_RUNTIME_version` in the terminal (if different from the default one) +2. `pnpm bootstrap` on the root directory +3. cd dmn-testing-models +4. `pnpm install` (this creates the required mvn configuration) Review Comment: Thanks for the README, though! Looks great. ########## packages/dmn-marshaller-backend-compatibility-tester/README.md: ########## @@ -0,0 +1,36 @@ +### Module Description + +The scope of this module is to provide a reliable scripting mechanism that tests DMN Files generated by the `dmn-marshaller` module against the backend counterpart code that lives in the drools repository. +The scripts are based on [JBang!](https://www.jbang.dev/) which provides an out-of-the-box library to be consumed in NodeJs. + +At the moment of writing, two scripts are available: + +- DMN Validation, which can validate a DMN file (and its imported DMN assets) using the [KIE DMN Validator](https://github.com/apache/incubator-kie-drools/tree/main/kie-dmn/kie-dmn-validation) back-end module. +- DMN Semantic Comparison, which compares two DMN files (and their imported DMN assets) using a Backend logic that relies on KIE DMN Engine core code. + +Every script is defined in a single Java class. Inside those, you can find a list of fields (marked with `@Option` annotation) that represent the commands and their required parameters to run the scripts. + +An abstract class is defined as the parent class of all defined scripts. That class holds all the Dependencies required by all the Java class scripts that implement it. This is required to enable a dependency fetching mechanism useful for: + +- Avoid issues when launching several JBang instances. This case may lead to issues with internal JBang caching. +- In CI/CD, it's sometimes required to download all the required dependencies in an earlier phase and then build the project. + To run the dependency fetching mechanism, you can just launch the jbang command passing that Abstract class location (no args). + To keep this mechanism consistent, please always declare all the required dependencies in the abstract superclass. + The dependency fetching mechanism can be called externally from a `package.json` script using the `dependenciesFetch.js` file, using the following command: + `node dist/dependenciesFetch.js`. + It's not possible to directly call JBang in the package.json script because when the JBang NPM library installs JBang in the local machine with the preinstall hook, it requires a new Shell for changes to take effect. + +### Usage + +The entry point of this module is the `index.js` file that exports: + +- `executeJBangScript` that requires as parameters: the Script to execute (see below) and its required args. +- The enumeration of the currently available Script + That represents all the required elements for consuming this module externally. + +To execute a specific JBang script present in this module you must: + +- Import the `"@kie-tools/dmn-marshaller-backend-compatibility-tester": "workspace:*"` dependency; +- Import the `DmnBackendCompatibilityScript` Enum and `executeJBangScript` in your JS/TS file; +- Execute the JBang script: eg. `executeJBangScript(DmnBackendCompatibilityScript.DMN_VALIDATION, args...)` +- For the precise args list, please check inside the Java Class Script of your interest and take note of all `@Option` annotated fields. Review Comment: As we discussed, I think we're much better off encapsulating JBang as an implementation detail of this package. ########## packages/dmn-marshaller/tests/dmnValidation.test.ts: ########## @@ -0,0 +1,156 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import * as fs from "fs"; +import * as path from "path"; +import { getMarshaller } from "@kie-tools/dmn-marshaller"; +import { fail } from "assert"; +import { + DmnBackendCompatibilityScript, + executeJBangScript, +} from "@kie-tools/dmn-marshaller-backend-compatibility-tester"; + +/** + * This test suite validates the xml produced (parsed and built) by the marshaller relying on KIE DMN Validator + * (https://github.com/apache/incubator-kie-drools/tree/main/kie-dmn/kie-dmn-validation). + * A JBang script is used to actually call the KIE DMN Validator Java code. + */ + +const dmnTestingModelsPath = require.resolve("@kie-tools/dmn-testing-models"); Review Comment: This will also remove the necessity for `../`, I guess. ########## packages/dmn-marshaller-backend-compatibility-tester/package.json: ########## @@ -0,0 +1,33 @@ +{ Review Comment: The fact that it depends on `build-env` to execute is something that prevents this from being publishable to NPM. I would say make it private or change the strategy to have `build-env` abstracted from its runtime. Creating a configuration file from it can be an option, for example. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
