safety: a lot more exception checker progress (#20817)

This commit is contained in:
Meghan Denny
2025-07-10 14:34:51 -08:00
committed by GitHub
parent c6bce38ead
commit 6c5b863530
107 changed files with 967 additions and 2209 deletions

View File

@@ -236,26 +236,24 @@ function getTestExpectations() {
return expectations;
}
const skipArray = (() => {
const path = join(cwd, "test/no-validate-exceptions.txt");
if (!existsSync(path)) {
return [];
}
return readFileSync(path, "utf-8")
.split("\n")
.filter(line => !line.startsWith("#") && line.length > 0);
})();
/**
* Returns whether we should validate exception checks running the given test
* @param {string} test
* @returns {boolean}
*/
const shouldValidateExceptions = (() => {
let skipArray;
return test => {
if (!skipArray) {
const path = join(cwd, "test/no-validate-exceptions.txt");
if (!existsSync(path)) {
skipArray = [];
}
skipArray = readFileSync(path, "utf-8")
.split("\n")
.filter(line => !line.startsWith("#") && line.length > 0);
}
return !(skipArray.includes(test) || skipArray.includes("test/" + test));
};
})();
const shouldValidateExceptions = test => {
return !(skipArray.includes(test) || skipArray.includes("test/" + test));
};
/**
* @param {string} testPath
@@ -448,7 +446,7 @@ async function runTests() {
NO_COLOR: "1",
BUN_DEBUG_QUIET_LOGS: "1",
};
if (basename(execPath).includes("asan") && shouldValidateExceptions(testPath)) {
if ((basename(execPath).includes("asan") || !isCI) && shouldValidateExceptions(testPath)) {
env.BUN_JSC_validateExceptionChecks = "1";
}
await runTest(title, async () => {