Skip to content

okf: keep test files out of the store output; run git tests in the check - #29

Merged
kriswill merged 1 commit into
mainfrom
claude/xenodochial-lamport-ac2808
Jul 5, 2026
Merged

okf: keep test files out of the store output; run git tests in the check#29
kriswill merged 1 commit into
mainfrom
claude/xenodochial-lamport-ac2808

Conversation

@kriswill

@kriswill kriswill commented Jul 5, 2026

Copy link
Copy Markdown
Owner

What changed

  • flakes/okf/package.nix: split the source fileset. The runtime package ($out/lib/okf) now excludes test/ and viz-app/*.test.ts; a separate full-tree testSrc feeds the tests.unit check derivation, so checks.<system>.test still runs the complete suite.
  • package.nix (check): added git to the test derivation's nativeBuildInputs, 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 in packages/okf.md and appended a log.md entry; okf index + okf validate pass.

Why

bun test from flakes/okf was running the local suite plus a stale copy from the nix store: bun's test scanner follows the result symlink nix build leaves in the flake root, and the store output shipped its own *.test.ts files. 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 in knowledge/log.md.

Separately (pre-existing, surfaced while verifying): nix flake check was already failing — the unguarded assertion at test/vcs.test.ts:142 expects 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 two skipIf(!hasGit) gitProvider tests (evil-merge dating — the subject of recent commits — and auto-selection), which previously never ran in CI.

Verification

  • Reproduced first: with result present, bun test ran 578 tests / 24 files; after the fix, 289 / 12 (local only)
  • find result/lib/okf -name '*.test.ts' → empty; ./result/bin/okf --help works
  • nix flake check in flakes/okf passes; check log shows 289 pass, 0 fail, 0 skip
  • Root flake still builds .#okf; nix fmt no-op; statix/deadnix clean
  • okf validate: 160 files checked, 0 errors

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.
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.

1 participant