Skip to content

test(fixtures): add reusable temp paths helper#41

Open
vernonstinebaker wants to merge 1 commit intonullclaw:mainfrom
vernonstinebaker:test/backend-fixtures
Open

test(fixtures): add reusable temp paths helper#41
vernonstinebaker wants to merge 1 commit intonullclaw:mainfrom
vernonstinebaker:test/backend-fixtures

Conversation

@vernonstinebaker
Copy link
Copy Markdown
Contributor

Summary

  • add a small shared src/test_helpers.zig fixture with TempPaths, which creates an isolated temporary NullHub root backed by std.testing.tmpDir
  • use the new fixture in existing backend tests that previously relied on hardcoded /tmp/... paths and manual cleanup
  • adopt the fixture in real tests across three subsystems: supervisor runtime-state persistence, supervisor manager log/restart behavior, and installer directory creation
  • keep the helper intentionally narrow so it unlocks later testing work without introducing a broad test framework

Validation

  • zig build test -Dembed-ui=false -Dbuild-ui=false --summary all
  • npm --prefix ui ci --no-audit --no-fund
  • npm --prefix ui run build
  • bash tests/test_e2e.sh
  • zig fmt --check src/
  • git diff --check

Notes

  • this PR focuses only on temporary NullHub root/path isolation; it does not yet add fake upstream HTTP helpers or broader integration harnesses
  • the immediate benefit is removal of several hardcoded /tmp test roots and more reliable cleanup semantics for future TDD-style backend tests
  • a natural follow-up is extending the fixture layer with a tiny fake upstream helper for orchestration and installer/update integration tests

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