Guard early direct-file staging

This commit is contained in:
2026-06-13 09:29:00 +08:00
parent 8f47c95bca
commit 6a64219533
3 changed files with 76 additions and 92 deletions

View File

@@ -6346,11 +6346,17 @@
].join("\n"),
);
const doWhileBreakPath = await writeInterpRegressionFile(
const doWhileBreakNgcFiles = [
"bug.ngc",
"test.ngc",
];
const doWhileBreakDir = await writeInterpRegressionFiles(
interp,
"do-while-break",
"test.ngc",
doWhileBreakNgcFiles,
);
assertInterpRegressionStaging("do-while-break", doWhileBreakNgcFiles, doWhileBreakDir);
const doWhileBreakPath = `${doWhileBreakDir}/test.ngc`;
verifyExpectedOutput(
"browser_interp_do_while_break",
interp.runFile(doWhileBreakPath),
@@ -6369,25 +6375,7 @@
].join("\n"),
);
const doWhileBreakBugPath = await writeInterpRegressionFile(
interp,
"do-while-break",
"bug.ngc",
);
const doWhileBreakNgcFiles = [
"bug.ngc",
"test.ngc",
];
if (doWhileBreakNgcFiles.length !== 2 || new Set(doWhileBreakNgcFiles).size !== doWhileBreakNgcFiles.length) {
throw new Error("browser_interp_do_while_break_fixture_coverage: list drift");
}
const doWhileBreakStagedNgcFiles = [
doWhileBreakBugPath,
doWhileBreakPath,
].map((path) => path.replace("/work/browser-interp/do-while-break/", ""));
if (doWhileBreakStagedNgcFiles.join(",") !== doWhileBreakNgcFiles.join(",")) {
throw new Error("browser_interp_do_while_break_staging_manifest: list drift");
}
const doWhileBreakBugPath = `${doWhileBreakDir}/bug.ngc`;
verifyExpectedOutput(
"browser_interp_do_while_break_bug",
interp.runFile(doWhileBreakBugPath),
@@ -6413,12 +6401,7 @@
if (owordBug315NgcFiles.length !== 1 || new Set(owordBug315NgcFiles).size !== owordBug315NgcFiles.length) {
throw new Error("browser_interp_oword_bug315_fixture_coverage: list drift");
}
const owordBug315StagedNgcFiles = [
owordBug315Path,
].map((path) => path.replace("/work/browser-interp/oword-bug315/", ""));
if (owordBug315StagedNgcFiles.join(",") !== owordBug315NgcFiles.join(",")) {
throw new Error("browser_interp_oword_bug315_staging_manifest: list drift");
}
assertInterpRegressionFileStaging("oword-bug315", "test.ngc", owordBug315Path);
verifyExpectedOutput(
"browser_interp_oword_bug315",
interp.runFile(owordBug315Path),
@@ -6444,12 +6427,7 @@
if (owordBug315P2NgcFiles.length !== 1 || new Set(owordBug315P2NgcFiles).size !== owordBug315P2NgcFiles.length) {
throw new Error("browser_interp_oword_bug315_p2_fixture_coverage: list drift");
}
const owordBug315P2StagedNgcFiles = [
owordBug315P2Path,
].map((path) => path.replace("/work/browser-interp/oword-bug315-p2/", ""));
if (owordBug315P2StagedNgcFiles.join(",") !== owordBug315P2NgcFiles.join(",")) {
throw new Error("browser_interp_oword_bug315_p2_staging_manifest: list drift");
}
assertInterpRegressionFileStaging("oword-bug315-p2", "test.ngc", owordBug315P2Path);
verifyExpectedOutput(
"browser_interp_oword_bug315_p2",
interp.runFile(owordBug315P2Path),
@@ -6471,12 +6449,7 @@
if (existsNgcFiles.length !== 1 || new Set(existsNgcFiles).size !== existsNgcFiles.length) {
throw new Error("browser_interp_exists_fixture_coverage: list drift");
}
const existsStagedNgcFiles = [
existsPath,
].map((path) => path.replace("/work/browser-interp/exists/", ""));
if (existsStagedNgcFiles.join(",") !== existsNgcFiles.join(",")) {
throw new Error("browser_interp_exists_staging_manifest: list drift");
}
assertInterpRegressionFileStaging("exists", "test.ngc", existsPath);
verifyExpectedOutput(
"browser_interp_exists",
interp.runFile(existsPath),
@@ -6502,12 +6475,7 @@
if (returnValueNgcFiles.length !== 1 || new Set(returnValueNgcFiles).size !== returnValueNgcFiles.length) {
throw new Error("browser_interp_return_value_fixture_coverage: list drift");
}
const returnValueStagedNgcFiles = [
returnValuePath,
].map((path) => path.replace("/work/browser-interp/return-value/", ""));
if (returnValueStagedNgcFiles.join(",") !== returnValueNgcFiles.join(",")) {
throw new Error("browser_interp_return_value_staging_manifest: list drift");
}
assertInterpRegressionFileStaging("return-value", "test.ngc", returnValuePath);
verifyExpectedOutput(
"browser_interp_return_value",
interp.runFile(returnValuePath),

View File

@@ -1339,7 +1339,13 @@ verifyExpectedOutput(
].join("\n"),
);
const doWhileBreakPath = writeInterpRegressionFile("do-while-break", "test.ngc");
const doWhileBreakNgcFiles = [
"bug.ngc",
"test.ngc",
];
const doWhileBreakDir = writeInterpRegressionFiles("do-while-break", doWhileBreakNgcFiles);
assertInterpRegressionStaging("do-while-break", doWhileBreakNgcFiles, doWhileBreakDir);
const doWhileBreakPath = `${doWhileBreakDir}/test.ngc`;
verifyExpectedOutput(
"interp_do_while_break_wasm",
interp.runFile(doWhileBreakPath),
@@ -1358,24 +1364,7 @@ verifyExpectedOutput(
].join("\n"),
);
const doWhileBreakBugPath = writeInterpRegressionFile("do-while-break", "bug.ngc");
const doWhileBreakNgcFiles = [
"bug.ngc",
"test.ngc",
];
assert.deepEqual(
doWhileBreakNgcFiles,
interpRegressionNgcFilesRecursive("do-while-break"),
"interp do-while-break fixture coverage drift",
);
assert.deepEqual(
[
doWhileBreakBugPath,
doWhileBreakPath,
],
doWhileBreakNgcFiles.map((file) => `/work/interp/do-while-break/${file}`),
"interp do-while-break staging manifest drift",
);
const doWhileBreakBugPath = `${doWhileBreakDir}/bug.ngc`;
verifyExpectedOutput(
"interp_do_while_break_bug_wasm",
interp.runFile(doWhileBreakBugPath),
@@ -1399,13 +1388,7 @@ assert.deepEqual(
interpRegressionNgcFilesRecursive("oword-bug315"),
"interp oword-bug315 fixture coverage drift",
);
assert.deepEqual(
[
owordBug315Path,
],
owordBug315NgcFiles.map((file) => `/work/interp/oword-bug315/${file}`),
"interp oword-bug315 staging manifest drift",
);
assertInterpRegressionFileStaging("oword-bug315", "test.ngc", owordBug315Path);
verifyExpectedOutput(
"interp_oword_bug315_wasm",
interp.runFile(owordBug315Path),
@@ -1429,13 +1412,7 @@ assert.deepEqual(
interpRegressionNgcFilesRecursive("oword-bug315-p2"),
"interp oword-bug315-p2 fixture coverage drift",
);
assert.deepEqual(
[
owordBug315P2Path,
],
owordBug315P2NgcFiles.map((file) => `/work/interp/oword-bug315-p2/${file}`),
"interp oword-bug315-p2 staging manifest drift",
);
assertInterpRegressionFileStaging("oword-bug315-p2", "test.ngc", owordBug315P2Path);
verifyExpectedOutput(
"interp_oword_bug315_p2_wasm",
interp.runFile(owordBug315P2Path),
@@ -1459,13 +1436,7 @@ assert.deepEqual(
interpRegressionNgcFilesRecursive("exists"),
"interp exists fixture coverage drift",
);
assert.deepEqual(
[
existsPath,
],
existsNgcFiles.map((file) => `/work/interp/exists/${file}`),
"interp exists staging manifest drift",
);
assertInterpRegressionFileStaging("exists", "test.ngc", existsPath);
verifyExpectedOutput(
"interp_exists_wasm",
interp.runFile(existsPath),
@@ -1489,13 +1460,7 @@ assert.deepEqual(
interpRegressionNgcFilesRecursive("return-value"),
"interp return-value fixture coverage drift",
);
assert.deepEqual(
[
returnValuePath,
],
returnValueNgcFiles.map((file) => `/work/interp/return-value/${file}`),
"interp return-value staging manifest drift",
);
assertInterpRegressionFileStaging("return-value", "test.ngc", returnValuePath);
verifyExpectedOutput(
"interp_return_value_wasm",
interp.runFile(returnValuePath),