Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-2600: N4JS-Mangelhaft is unable to load test modules when used in a pnpm workspace #2601

Merged
merged 11 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions n4js-libs/npm-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,13 @@ echo "========= Running tests defined in the individual packages of yarn workspa


echo "========= Running mangelhaft tests for all packages in yarn workspace 'n4js-libs' ..."
REPORT_NAME="./build/report.xml"
mkdir -p "./build"
echo "Run mangelhaft ..."
packages/n4js-mangelhaft-cli/src-gen/org/eclipse/n4js/mangelhaft/runner/node/NodeTestMain.js \
./packages/org.eclipse.n4js.mangelhaft.test/test-catalog.json \
--xunitReportFile $REPORT_NAME \
yarn run n4js-mangelhaft \
packages/* \
--xunitReportFile "./build/report.xml" \
--sonarTestExecutionReportFile ./build/sqreport.xml \
--xunitReportName test-report \
--xunitReportPackage n4js-libs-report \
--nycCoveragePath ./build/coverage.json
echo "Done running mangehaft."
echo "Saved test report at: ${REPORT_NAME}"

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,23 @@ const cwd = process.cwd();
const resolvePath = (p: string): string => lib_path.resolve(cwd, p);

const nomnomOptions: Object = {
testCatalog: {
testCatalogs: {
position: 0,
list: false,
default: ".",
metavar: "PATH|NPM-relpath",
help: "Test catalog (JSON) or project location to be inspected for test cases."
list: true,
default: ["."],
metavar: "PATH|NPM-relpath|glob",
help: "Test catalog (JSON) or project location(s) to be inspected for test catalog(s)."
},
filter: {
abbr: "f",
list: true,
help: "Filter for matching test cases."
},
mergeResult: {
abbr: "mr",
flag: true,
help: "Merge all results into a single file stored in CWD."
},
xunitReportFile: {
metavar: "PATH",
transform: resolvePath,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,5 @@
* NumberFour AG - Initial API and implementation
*/

import NodeTestAPI from "org/eclipse/n4js/mangelhaft/runner/node/NodeTestAPI";
import {NodeTestCLI} from "org/eclipse/n4js/mangelhaft/runner/node/NodeTestCLI";
import {waitAndExitProcess} from "org/eclipse/n4js/mangelhaft/util/proc";

waitAndExitProcess(async () => {
const options = NodeTestCLI.parseCommandLine();
if (options) {
await NodeTestAPI.exec(options);
}
});
import("./NodeTestRunner.js");
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,20 @@ import { XUnitReportSpec } from "org/eclipse/n4js/mangelhaft/reporter/xunit/XUni
*/
export default public class NodeTestOptions extends XUnitReportSpec {
/**
* Test catalog to be tested.
* One or more files/directories/globs pointing to the test catalog to be tested.
*/
public testCatalog: string;
public testCatalogs: string[];

/**
* Filter for matching test cases.
*/
public filter: string[];

/**
* Merge all results into a single file stored in CWD.
*/
public mergeResult: boolean;

/**
* Sonar base dir.
*/
Expand Down
Loading
Loading