fix(ci): tighten slow bucket guardrails

This commit is contained in:
Tam Nhu Tran committed 2026-04-22 15:54:07 -04:00
1 parent 572b184220
commit 5af639ddf7
4 files changed
+79 -22

No files matched your search

@@ -0,0 +1,24 @@
const { describe, expect, test } = require('bun:test');
const path = require('node:path');
const bucket = require('../../../scripts/run-test-bucket.js');
describe('run-test-bucket', () => {
test('all declared slow tests still exist on disk', () => {
for (const relativePath of bucket.slowTests) {
const absolutePath = path.resolve(__dirname, '../../../', relativePath);
expect(Bun.file(absolutePath).exists()).resolves.toBe(true);
}
});
test('forces npm tests into the slow bucket', () => {
expect(bucket.shouldForceSlow('tests/npm/cli.test.js')).toBe(true);
});
test('keeps dist-independent javascript tests in the fast bucket', () => {
expect(bucket.shouldForceSlow('tests/unit/flag-parsing-simple.test.js')).toBe(false);
});
test('still forces dist-dependent tests into the slow bucket', () => {
expect(bucket.shouldForceSlow('tests/unit/config-dir-override.test.js')).toBe(true);
});
});