Skip to content

fix(tests): wire module tests into zig build test - #9

Open
addadi wants to merge 1 commit into
nullclaw:mainfrom
addadi:fix/wire-module-tests
Open

fix(tests): wire module tests into zig build test#9
addadi wants to merge 1 commit into
nullclaw:mainfrom
addadi:fix/wire-module-tests

Conversation

@addadi

@addadi addadi commented Aug 22, 2026

Copy link
Copy Markdown

Fixes #6

The test step roots at src/main.zig, which never imports the other modules' test declarations — so zig build test silently runs 0 tests (see #6 for 1-command repro).

Changes:

  • add root test {} block in main.zig referencing store/api/domain/config
  • fix zig-0.16 compile breakage in those tests: std_compat.fs.Dir.wrap for tmpDir writeFile/realpathAlloc/makePath, ObjectMap.deinit(alloc)
  • fix arena leaks in 3 api.zig auth tests

Result: 18 unit tests run (previously 0). zig build test, zig build, and full e2e (tests/test_e2e.sh, 96 passed) verified locally.

The test step compiles only src/main.zig, which never imports the other
modules' test declarations, so 'zig build test' silently runs 0 tests.
Add a root test block referencing store/api/domain/config.

Fixes latent compile errors in those module tests left by the zig 0.16
migration: std.testing.tmpDir Dir must be wrapped via
std_compat.fs.Dir.wrap for writeFile/realpathAlloc/makePath, and
ObjectMap.deinit now requires an allocator argument.

Also fixes arena leaks in three api.zig auth tests (Context.allocator
now backed by a per-test ArenaAllocator) so the suite passes cleanly
under the testing allocator.

After this change: 18 unit tests run (previously 0).
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.

zig build test silently runs 0 unit tests

1 participant