Repository navigation
test: isolate filesystem tests from the real ~/.foc-devnet - #249
Closed
OzzyHelper wants to merge 1 commit into
Closed
OzzyHelper wants to merge 1 commit into
OzzyHelper wants to merge 1 commit into
Conversation
Add a test-only TestHome override to paths::foc_devnet_home(), serialized by a process-wide lock shared with FOC_DEVNET_BASEDIR tests. Use it in all tests that persist keys, mnemonics, run IDs, or the latest symlink. Rewrite the latest-symlink test to call create_latest_symlink directly and cover broken-link recreation plus valid-link replacement. Drop test_print_running_status, which only asserted is_ok() while shelling out to Docker.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Cargo tests no longer read or write the real
~/.foc-devnet. A test-onlyTestHomeoverride redirects path resolution into a temp directory, serialized by a process-wide lock shared withFOC_DEVNET_BASEDIRtests.Closes #247
Changes
paths::TestHome, a#[cfg(test)]-only override forfoc_devnet_home()guarded by a process-wide lock;TestHome::lock_only()shares that lock withFOC_DEVNET_BASEDIRtests.TestHomefor keys/mnemonic, run-ID persistence, latest symlink, build status, and disk usage tests.create_latest_symlink, covering broken-link recreation and valid-link replacement.test_print_running_status, which only assertedis_ok()while shelling out to Docker.Test plan
cargo fmt --all -- --checkcargo clippy --all-targets --all-features -- -D warningscargo test --lib -- --skip test_print_uptime— 51 passed~/.foc-devnetmtimes unchanged after the test run.test_print_uptimewas skipped because it needs a Docker CLI unavailable in this environment (pre-existing).Quality Report
Changes: 7 files changed, 113 insertions(+), 59 deletions(-)
Code scan: clean
Tests: skipped
Branch hygiene: 1 issue(s)