test: profile-map drift guard + reverse-switch coverage for profile deactivation (#822) - #826
Merged
Merged
Conversation
…eactivation Two stack-tier hardenings for the merged profile-deactivation fix: - test_compose.sh: enumerate every profile-gated service from docker-compose.yml (--profile '*') and diff against the service<->profile map parsed out of remove_deactivated_profile_containers in the pithead script. A new profile-gated service, a renamed profile, or a stale map entry now fails CI until both sides agree — same pattern as the depends_on count guard. - run.sh: black-box tari remote->local reverse switch through apply against the stubs. Asserts the reconcile removes only the still-off profiles (no tari in the rm list), the recreate up follows the reconcile, and local_tari is back in the committed profile list so that up brings the container up again. Closes #822 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Two test-tier hardenings for the merged #804 profile-deactivation fix. Tests only — no behavior changes; the drift guard passes green against the current map, so no unmapped service exists today.
Drift guard (tests/stack/test_compose.sh)
remove_deactivated_profile_containershardcodes the service↔profile map, so a future profile-gated service added to docker-compose.yml would silently escape removal. The guard (same pattern as #565's depends_on count guard):--profile '*'so every profile-gated service appears regardless of its profile name, and extractsservice=profilepairs via jq;pitheadscript;Negative-tested: dropping the monerod line from the map makes the guard fail with both sets shown.
Reverse-switch coverage (tests/stack/run.sh)
New case (4) in the #795 block: commits a tari-remote
.env, then drives a tari remote→local switch throughapplyagainst the stubs and asserts:compose rm -sf monerod wallet-rpc tari-wallet— notariin the list, so the reactivated service's container is never touched);upruns after that reconcile;local_tariis back in the committedCOMPOSE_PROFILES, which is what makes thatupbring the tari container up again.Verification
tests/stack/run.sh: 1696 passed, 0 failedtests/stack/test_compose.sh: all greenmake lint: rc 0Closes #822
🤖 Generated with Claude Code