Skip to content

refactor(test): migrate health_check.rs to BoxTestBase#311

Merged
DorianZheng merged 1 commit intomainfrom
refactor/health-check-use-box-test-base
Feb 27, 2026
Merged

refactor(test): migrate health_check.rs to BoxTestBase#311
DorianZheng merged 1 commit intomainfrom
refactor/health-check-use-box-test-base

Conversation

@DorianZheng
Copy link
Copy Markdown
Member

Summary

  • Split BoxTestBase::with_options() to return a created-but-not-started box, so tests can observe pre-start state (e.g. HealthState::Starting). new() still returns a running box.
  • Rewrites health_check.rs to use BoxTestBase instead of a hand-rolled TestContext, eliminating manual setup and explicit cleanup.
  • Fixes per-test tmp directory leaks: replaces persistent /tmp/boxlite-test warm home with ephemeral TempDir, introduces LinkedCache RAII handle for automatic cleanup.

Test plan

  • cargo clippy -p boxlite-test-utils --tests -- -D warnings — clean
  • cargo clippy -p boxlite --tests -- -D warnings — clean
  • cargo fmt --check — clean
  • cargo test -p boxlite-test-utils — 39/39 passed
  • Integration tests via pre-push hook — both health_check tests passed

…eanup

Split BoxTestBase::with_options() to return a created-but-not-started
box, allowing tests to observe pre-start state (e.g. HealthState::Starting).
new() still returns a running box for convenience.

Rewrites health_check.rs to use BoxTestBase instead of a hand-rolled
TestContext, eliminating manual TempDir/runtime setup and explicit
stop/remove cleanup.

Also fixes per-test tmp directory leaks: replaces the persistent
/tmp/boxlite-test warm home with an ephemeral TempDir, and introduces
LinkedCache as an RAII handle so per-test tmp dirs under
target/boxlite-test/tmp/ are cleaned up on drop.
@DorianZheng DorianZheng merged commit da23a0e into main Feb 27, 2026
17 checks passed
@DorianZheng DorianZheng deleted the refactor/health-check-use-box-test-base branch February 27, 2026 07:56
DorianZheng added a commit that referenced this pull request Feb 27, 2026
… assertion

Migrate all 7 jailer integration tests from the ad-hoc JailerTestCtx to the
shared BoxTestBase infrastructure, matching the pattern established in #311.

Fix the `jailer_enabled_custom_profile_deny_boxes_subpath_blocks_start` test
which failed after migration: the sandbox denial now manifests as "File exists"
(EEXIST from mkdir when stat() is blocked) rather than "operation not permitted".
Add "file exists" as valid deny evidence since create_dir_all only surfaces
EEXIST when the sandbox prevents the stat() verification of an existing directory.
DorianZheng added a commit that referenced this pull request Feb 27, 2026
… assertion (#312)

Migrate all 7 jailer integration tests from the ad-hoc JailerTestCtx to the
shared BoxTestBase infrastructure, matching the pattern established in #311.

Fix the `jailer_enabled_custom_profile_deny_boxes_subpath_blocks_start` test
which failed after migration: the sandbox denial now manifests as "File exists"
(EEXIST from mkdir when stat() is blocked) rather than "operation not permitted".
Add "file exists" as valid deny evidence since create_dir_all only surfaces
EEXIST when the sandbox prevents the stat() verification of an existing directory.
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