Skip to content

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

Merged
vernonstinebaker merged 1 commit into
nullclaw:mainfrom
addadi:fix/wire-module-tests
Sep 29, 2026
Merged

vernonstinebaker merged 1 commit into
nullclaw:mainfrom
addadi:fix/wire-module-tests

Conversation

@addadi

@addadi addadi commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

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

@vernonstinebaker vernonstinebaker left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Validated live: on main, zig build test runs effectively zero tests (the test step roots at main.zig, which never imported the other modules) — CI has been passing on an empty suite. This PR's branch: 18/18 tests pass, including the Zig 0.16 compile fixes (std_compat fs wrap for tmpDir, arena allocators for Context) needed to bring them back. This is the foundational fix for the whole repo's validation story. Merging.

@vernonstinebaker
vernonstinebaker merged commit 63349dc into nullclaw:main Sep 29, 2026
3 checks passed
vernonstinebaker added a commit that referenced this pull request Oct 3, 2026
fix(tests): repair config.zig test after #5/#9 merge
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

2 participants