test(ci): select npm for the static context fixture (#16524)
This commit is contained in:
1 parent
6195b3d66b
commit
149378bddb
1 file changed
+13
-1
@@ -14,6 +14,7 @@ import {
|
||||
recordStaticTaskContext,
|
||||
} from "../../../scripts/ci/static-task-context.mjs";
|
||||
import { testShards } from "../../../scripts/ci/test-selection.mjs";
|
||||
import { npmInvocation } from "../../../scripts/lib/npm-invocation.mjs";
|
||||
import { createTestTempDirectory } from "../../fixtures/temporaryDirectory.js";
|
||||
|
||||
const execute = promisify(execFile);
|
||||
@@ -396,7 +397,17 @@ it("starts source feedback before build and requires both groups without waiving
|
||||
|
||||
it("records the actual static task graph with explicit source identity and no ambient environment", async () => {
|
||||
const directory = await createTestTempDirectory("rea-ci-context-");
|
||||
const context = await recordStaticTaskContext({ outputDirectory: directory });
|
||||
const npm = npmInvocation(
|
||||
["exec", "--offline", "--call", "node -p process.env.npm_execpath"],
|
||||
process.env,
|
||||
);
|
||||
const { stdout } = await execute(npm.command, npm.arguments);
|
||||
const npmCli = stdout.trim();
|
||||
const context = await recordStaticTaskContext({
|
||||
npmCli,
|
||||
outputDirectory: directory,
|
||||
script: "check:ci:fast:tasks",
|
||||
});
|
||||
const head = await execute("git", ["rev-parse", "HEAD"]);
|
||||
expect(context.sourceSha).toBe(head.stdout.trim());
|
||||
expect(context.taskHashes.lint).toMatch(/^[a-f0-9]{16}$/u);
|
||||
@@ -405,6 +416,7 @@ it("records the actual static task graph with explicit source identity and no am
|
||||
expect(context.taskHashes).not.toHaveProperty("jscpd");
|
||||
expect(context.taskHashes).not.toHaveProperty("knip");
|
||||
const deep = await recordStaticTaskContext({
|
||||
npmCli,
|
||||
outputDirectory: `${directory}/deep`,
|
||||
script: "check:ci:deep:tasks",
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user