okf: keep test files out of the store output; run git tests in the check - #29
Merged
Merged
Conversation
bun's test scanner follows the `result` symlink `nix build` leaves in the flake root, so the shipped *.test.ts files ran as a stale second copy of the suite alongside the working tree's (24 files instead of 12, doubled counts that skewed numbers recorded in knowledge/log.md). Split the fileset: the runtime package excludes test/ and viz-app/*.test.ts; a full-tree testSrc feeds checks.test unchanged. Also add git to the test derivation's nativeBuildInputs — the sandbox was git-less, which failed the one unguarded git-dependent assertion (explicit-git error message) and skipIf-skipped the gitProvider tests (evil-merge dating, auto-selection). With git present, matching the runtime wrapper's PATH, the check runs all 289 tests: 0 fail, 0 skip.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
flakes/okf/package.nix: split the source fileset. The runtime package ($out/lib/okf) now excludestest/andviz-app/*.test.ts; a separate full-treetestSrcfeeds thetests.unitcheck derivation, sochecks.<system>.teststill runs the complete suite.package.nix(check): addedgitto the test derivation'snativeBuildInputs, matching the runtime wrapper's PATH.test/vcs.test.ts: updated the stale header comment ("the nix check sandbox has bun only").knowledge/: recorded the gotcha inpackages/okf.mdand appended alog.mdentry;okf index+okf validatepass.Why
bun testfromflakes/okfwas running the local suite plus a stale copy from the nix store: bun's test scanner follows theresultsymlinknix buildleaves in the flake root, and the store output shipped its own*.test.tsfiles. Symptom: "Ran 578 tests across 24 files" with/nix/store/...-okf-0.1.0/lib/okf/...paths — stale store tests could mask or duplicate failures and skew counts recorded inknowledge/log.md.Separately (pre-existing, surfaced while verifying):
nix flake checkwas already failing — the unguarded assertion attest/vcs.test.ts:142expects the "not inside a git repository" error, but the git-less sandbox produced "git is not installed" instead. Providing git fixes that and un-skips the twoskipIf(!hasGit)gitProvider tests (evil-merge dating — the subject of recent commits — and auto-selection), which previously never ran in CI.Verification
resultpresent,bun testran 578 tests / 24 files; after the fix, 289 / 12 (local only)find result/lib/okf -name '*.test.ts'→ empty;./result/bin/okf --helpworksnix flake checkinflakes/okfpasses; check log shows 289 pass, 0 fail, 0 skip.#okf;nix fmtno-op; statix/deadnix cleanokf validate: 160 files checked, 0 errors