Skip to content

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

Closed
danusha2345 wants to merge 1 commit into
colbymchenry:mainfrom
danusha2345:test/kernel-only-suites-skip-wasm
Closed

danusha2345 wants to merge 1 commit into
colbymchenry:mainfrom
danusha2345:test/kernel-only-suites-skip-wasm

Conversation

@danusha2345

@danusha2345 danusha2345 commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Test-only, no changelog entry.

Problem

CODEGRAPH_KERNEL=0 is the switch that sends every language through wasm, and running the suite with it is how the wasm path gets exercised on a machine that has the kernel built. Two suites fail in that run instead of skipping:

$ CODEGRAPH_KERNEL=0 npx vitest run __tests__/kernel-*.test.ts
 FAIL  __tests__/kernel-deep-nesting.test.ts > kernel deep-nesting guard (#1581)
 FAIL  __tests__/kernel-retry-materialize.test.ts > kernel buffer-transport storage (#1541) > storeExtractionResult persists the decoded nodes of a raw kernel result
 Test Files  2 failed | 16 passed (18)

kernel-deep-nesting asserts in beforeAll that at least one language is routed to the kernel, and none is. kernel-retry-materialize asks for a raw kernel result and gets null. Both skip only when the .node file is missing. The other kernel-* suites call the kernel directly or clear the variable themselves and pass either way.

Fix

The two describe.skipIf(!kernelBuilt) blocks also skip when CODEGRAPH_KERNEL === '0' — the same outcome as a checkout without a kernel. The kernel-independent zero-node row self-heal block in kernel-retry-materialize and the CODEGRAPH_KERNEL_EXPECT=1 presence checks are untouched.

Tests

All 18 kernel-* files plus c-fnptr-kernel-sweep:

  • with the kernel (CODEGRAPH_KERNEL_EXPECT=1): 18 files, 258 tests pass, nothing newly skipped;
  • with CODEGRAPH_KERNEL=0: 17 files pass, kernel-deep-nesting is skipped, and one test of kernel-retry-materialize is skipped while its self-heal test runs. On main the same command ends with the two failures above.

Update (rebased onto ed199e6). #2426 added a third kernel-only block, "C++ brace scopes: native kernel parity (error-extract hatch)" in __tests__/cpp-brace-scopes.test.ts, which fails the same way under CODEGRAPH_KERNEL=0 (4 tests). It gets the same one-line condition here. The three files now give 26/26 with the kernel and 13 passed / 13 skipped with CODEGRAPH_KERNEL=0.

🤖 Generated with Claude Code

@danusha2345
danusha2345 force-pushed the test/kernel-only-suites-skip-wasm branch from dffab3e to d6175b0 Compare October 7, 2026 11:42
@danusha2345
danusha2345 force-pushed the test/kernel-only-suites-skip-wasm branch 2 times, most recently from 3f5a111 to 4bc4339 Compare October 21, 2026 17:49
CODEGRAPH_KERNEL=0 is the kill switch that sends every language to wasm.
The deep-nesting guard, the buffer-transport storage suite and the C++
brace-scope kernel-parity block (colbymchenry#2426) skip only when the kernel binary
is missing, so a WASM run of them failed: the first found no
kernel-routed language, the others got no raw kernel result. They now
skip under the kill switch too, as they would without a kernel.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@danusha2345
danusha2345 force-pushed the test/kernel-only-suites-skip-wasm branch from 4bc4339 to 51d98cc Compare October 22, 2026 10:40
colbymchenry pushed a commit that referenced this pull request Oct 23, 2026
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>
colbymchenry pushed a commit that referenced this pull request Oct 23, 2026
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>
@colbymchenry

Copy link
Copy Markdown
Owner

Thanks @danusha2345! A kernel-off run that fails instead of skipping hides real regressions on the wasm path, so this is a good fix, and your condition matches the loader's own kill switch exactly.

We landed your commit unchanged in #2848, with you as the author. We also ran every other test file that references the kernel with CODEGRAPH_KERNEL=0, and these three were the only ones that failed that way. Closing this in favor of #2848, which is now merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants