test(kernel): skip the kernel-only suites when CODEGRAPH_KERNEL=0

CODEGRAPH_KERNEL=0 sends every language through wasm, and running the
suite with it is how the wasm path is exercised on a machine that has the
kernel built. Three kernel-only blocks failed in that run instead of
skipping, because they skipped only when the .node file was missing:
kernel-deep-nesting asserts in beforeAll that some language is routed to
the kernel, kernel-retry-materialize asks for a raw kernel result and gets
null, and the C++ brace-scope kernel parity block in cpp-brace-scopes
gets no kernel result either.

Each of the three describe.skipIf conditions now also skips when
CODEGRAPH_KERNEL is '0', the same outcome as a checkout without a kernel.
The kernel-independent self-heal block in kernel-retry-materialize still
runs.

Validation, the three files: on main with CODEGRAPH_KERNEL=0, 5 tests
fail and kernel-deep-nesting fails at beforeAll; here, 13 pass and 13
skip. With the kernel (CODEGRAPH_KERNEL_EXPECT=1), 26 of 26 pass, nothing
newly skipped. All 75 test files that reference the kernel pass with
CODEGRAPH_KERNEL=0 on this commit (1,832 passed, 0 failed), so these were
the only kernel-only blocks that failed that way. Test-only, so no
CHANGELOG entry.

Original PR #2372 by @danusha2345.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
danusha2345
2026-10-23 16:43:22 +00:00
committed by Colby Mchenry
co-authored by Claude Opus 5.5
parent 679c4e095a
commit 2def0a6d6d
3 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -350,7 +350,7 @@ describe('scanCppBraceScopes', () => {
});
});
describe.skipIf(!kernelAvailable)('C++ brace scopes: native kernel parity (error-extract hatch)', () => {
describe.skipIf(!kernelAvailable || process.env.CODEGRAPH_KERNEL === '0')('C++ brace scopes: native kernel parity (error-extract hatch)', () => {
beforeAll(async () => {
await initGrammars();
await loadGrammarsForLanguages(['cpp']);
+2 -1
View File
@@ -113,7 +113,8 @@ function deepBraces(depth: number): string {
const ENV_KEYS = ['CODEGRAPH_KERNEL', 'CODEGRAPH_KERNEL_LANGS', 'CODEGRAPH_KERNEL_PATH'] as const;
let savedEnv: Record<string, string | undefined>;
describe.skipIf(!kernelBuilt)('kernel deep-nesting guard (#1581)', () => {
// CODEGRAPH_KERNEL=0 turns the kernel off: these assert what it does.
describe.skipIf(!kernelBuilt || process.env.CODEGRAPH_KERNEL === '0')('kernel deep-nesting guard (#1581)', () => {
let routed: Language[] = [];
beforeAll(async () => {
+2 -1
View File
@@ -37,7 +37,8 @@ const KERNEL_PATH = path.join(
);
const kernelBuilt = fs.existsSync(KERNEL_PATH);
describe.skipIf(!kernelBuilt)('kernel buffer-transport storage (#1541)', () => {
// CODEGRAPH_KERNEL=0 turns the kernel off: these assert what it does.
describe.skipIf(!kernelBuilt || process.env.CODEGRAPH_KERNEL === '0')('kernel buffer-transport storage (#1541)', () => {
let dir: string;
let cg: CodeGraph;