mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-14 23:32:20 +00:00
fix(ci): run allocation gates on Node 26
This commit is contained in:
1 parent
2dca762e4a
commit
bbfb23a765
8 files changed
+46
-48
No files matched your search
@@ -13,7 +13,7 @@ import { isCalibratedAllocationRuntime } from '../../scripts/run-unit-tests.mjs'
|
||||
*/
|
||||
test('converged focus treatment stays within the GC-bracketed allocation budget', (t) => {
|
||||
if (!isCalibratedAllocationRuntime()) {
|
||||
return t.skip(`allocation budgets are calibrated for Node 24; running ${process.versions.node}`);
|
||||
return t.skip(`allocation budgets are calibrated for Node 24 or 26; running ${process.versions.node}`);
|
||||
}
|
||||
const result = spawnSync(
|
||||
process.execPath,
|
||||
|
||||
@@ -333,7 +333,7 @@ function runAllocationProbe(entryCount, profile = 'generic') {
|
||||
for (const workload of WORKLOADS) {
|
||||
test(`steady moving-source frames stay in budget ${workload.name}`, (t) => {
|
||||
if (!CALIBRATED_ALLOCATION_RUNTIME) {
|
||||
return t.skip(`allocation budgets are calibrated for Node 24; running ${process.versions.node}`);
|
||||
return t.skip(`allocation budgets are calibrated for Node 24 or 26; running ${process.versions.node}`);
|
||||
}
|
||||
const payload = runAllocationProbe(workload.entries, workload.profile);
|
||||
|
||||
|
||||
@@ -127,9 +127,10 @@ test('an unevaluable engines range reports unknown rather than guessing', () =>
|
||||
// A full pass run under `mise exec node@24 --` still re-execed system Node 25
|
||||
// through npm; the forced gate refused ("received 25.6.1") and A3 reported it
|
||||
// as a product failure. A3 now invokes the binary directly and checks it.
|
||||
test('only a parseable Node 24 counts as the calibrated allocation runtime', () => {
|
||||
test('every supported Node major counts as a calibrated allocation runtime', () => {
|
||||
assert.equal(isCalibratedAllocationRuntime('v24.19.0'), true);
|
||||
assert.equal(isCalibratedAllocationRuntime('24.19.0'), true, 'the v prefix is optional');
|
||||
assert.equal(isCalibratedAllocationRuntime('v26.3.0'), true);
|
||||
assert.equal(isCalibratedAllocationRuntime('v25.6.1'), false, 'the npm re-resolution case');
|
||||
assert.equal(isCalibratedAllocationRuntime('v22.21.1'), false);
|
||||
for (const junk of ['', ' ', 'node', undefined, null]) {
|
||||
|
||||
+10
-13
@@ -7,7 +7,7 @@ import {
|
||||
ALLOCATION_TEST_FILES,
|
||||
UNIT_TEST_ROOTS,
|
||||
allocationTestArgs,
|
||||
assertNode24AllocationRuntime,
|
||||
assertCalibratedAllocationRuntime,
|
||||
buildUnitTestPlan,
|
||||
discoverUnitTestFiles,
|
||||
isCalibratedAllocationRuntime,
|
||||
@@ -87,30 +87,27 @@ test('the runner discovers every test file in the repository', () => {
|
||||
}
|
||||
});
|
||||
|
||||
test('allocation runtime calibration is explicit and pinned to Node 24', () => {
|
||||
assert.equal(assertNode24AllocationRuntime('24.19.0'), '24.19.0');
|
||||
test('allocation runtime calibration covers both supported Node majors', () => {
|
||||
assert.equal(assertCalibratedAllocationRuntime('24.19.0'), '24.19.0');
|
||||
assert.throws(
|
||||
() => assertNode24AllocationRuntime('22.23.1'),
|
||||
/calibrated Node 24 runtime/,
|
||||
);
|
||||
assert.throws(
|
||||
() => assertNode24AllocationRuntime('26.0.0'),
|
||||
/calibrated Node 24 runtime/,
|
||||
() => assertCalibratedAllocationRuntime('22.23.1'),
|
||||
/calibrated Node 24 or 26/,
|
||||
);
|
||||
assert.equal(assertCalibratedAllocationRuntime('26.0.0'), '26.0.0');
|
||||
assert.equal(isCalibratedAllocationRuntime('24.19.0'), true);
|
||||
assert.equal(isCalibratedAllocationRuntime('22.23.1'), false);
|
||||
assert.equal(isCalibratedAllocationRuntime('26.3.0'), false);
|
||||
assert.equal(isCalibratedAllocationRuntime('26.3.0'), true);
|
||||
});
|
||||
|
||||
test('npm test stays green on every supported engine, not only the calibrated one', () => {
|
||||
test('npm test calibrates both supported engines while retaining off-range warnings', () => {
|
||||
// package.json wiring: `npm test` must invoke this runner, and the engines
|
||||
// range it advertises must not be narrower than what the runner tolerates.
|
||||
const pkg = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8'));
|
||||
assert.equal(pkg.scripts.test, 'node scripts/run-unit-tests.mjs');
|
||||
const enginesNode = String(pkg.engines?.node || '');
|
||||
assert.ok(enginesNode, 'engines.node must be declared');
|
||||
// The runner throws for uncalibrated runtimes ONLY behind the explicit
|
||||
// opt-in env; by default it skips, so a supported non-24 engine cannot fail.
|
||||
// Unsupported runtimes only skip probes without the explicit opt-in hard gate.
|
||||
// Node 26 is calibrated and runs those probes with the same budgets.
|
||||
const runner = readFileSync(new URL('../scripts/run-unit-tests.mjs', import.meta.url), 'utf8');
|
||||
assert.match(runner, /GEV_REQUIRE_ALLOCATION_GATE/);
|
||||
assert.match(runner, /SKIPPED .*allocation microbenchmarks/);
|
||||
|
||||
Reference in new issue
Block a user