fix(FN-3947): strip forwarded vitest silent flags
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import { describe, expect, it } from "vitest";
|
import { describe, expect, it } from "vitest";
|
||||||
import {
|
import {
|
||||||
decideExecutionPlan,
|
decideExecutionPlan,
|
||||||
|
normalizeForwardedArgs,
|
||||||
resolveAffectedPackages,
|
resolveAffectedPackages,
|
||||||
shouldForceFullSuite,
|
shouldForceFullSuite,
|
||||||
} from "../../../../scripts/test-changed.mjs";
|
} from "../../../../scripts/test-changed.mjs";
|
||||||
@@ -55,6 +56,12 @@ describe("root test command changed-only planning", () => {
|
|||||||
expect(shouldForceFullSuite(["package.json"])).toBe(true);
|
expect(shouldForceFullSuite(["package.json"])).toBe(true);
|
||||||
expect(shouldForceFullSuite(["packages/core/src/store.ts"])).toBe(false);
|
expect(shouldForceFullSuite(["packages/core/src/store.ts"])).toBe(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("strips forwarded silent flags so package vitest scripts do not receive duplicates", () => {
|
||||||
|
expect(
|
||||||
|
normalizeForwardedArgs(["--full", "--silent", "--silent=passed-only", "--reporter=dot"]),
|
||||||
|
).toEqual(["--reporter=dot"]);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("CI shard test planner", () => {
|
describe("CI shard test planner", () => {
|
||||||
|
|||||||
@@ -813,6 +813,18 @@ export function decideExecutionPlan({
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function normalizeForwardedArgs(argv) {
|
||||||
|
const normalized = [];
|
||||||
|
|
||||||
|
for (const arg of argv) {
|
||||||
|
if (arg === "--full" || arg === "--no-cache") continue;
|
||||||
|
if (arg === "--silent" || arg.startsWith("--silent=")) continue;
|
||||||
|
normalized.push(arg);
|
||||||
|
}
|
||||||
|
|
||||||
|
return normalized;
|
||||||
|
}
|
||||||
|
|
||||||
export function main(argv = process.argv.slice(2)) {
|
export function main(argv = process.argv.slice(2)) {
|
||||||
const forceFullSuite =
|
const forceFullSuite =
|
||||||
process.env.CI === "true" ||
|
process.env.CI === "true" ||
|
||||||
@@ -823,7 +835,7 @@ export function main(argv = process.argv.slice(2)) {
|
|||||||
process.env.FUSION_TEST_NO_CACHE === "1" ||
|
process.env.FUSION_TEST_NO_CACHE === "1" ||
|
||||||
argv.includes("--no-cache");
|
argv.includes("--no-cache");
|
||||||
|
|
||||||
const forwardedArgs = argv.filter((arg) => arg !== "--full" && arg !== "--no-cache");
|
const forwardedArgs = normalizeForwardedArgs(argv);
|
||||||
|
|
||||||
run("pnpm", ["sync:fusion-skill:check"]);
|
run("pnpm", ["sync:fusion-skill:check"]);
|
||||||
ensureTestArtifacts(rootDir);
|
ensureTestArtifacts(rootDir);
|
||||||
|
|||||||
Reference in New Issue
Block a user