Add with_campaign fixture for per-test parallel-safety - #61
Merged
P3az3 merged 2 commits intoJul 22, 2026
Merged
Conversation
usmanimamu17-create
force-pushed
the
fix/issue-32-per-test-cleanup-hook
branch
from
July 22, 2026 15:30
e050388 to
35cc187
Compare
Add a CampaignFixture struct and with_campaign helper that sets up a fully initialized campaign environment, enabling: - Clean per-test isolation via dedicated Env instances - Optional human-readable prefix for future parallel-test scoping - Consistent mock_all_auths and ordering guidance - Existing tests can opt in incrementally Closes MillestoneX#32
The use crate::types::{...} import in the test module was split across
four lines, causing cargo fmt --check to fail. Collapse to a single line
to satisfy the rustfmt style enforced by CI.
usmanimamu17-create
force-pushed
the
fix/issue-32-per-test-cleanup-hook
branch
from
July 22, 2026 16:26
143881a to
549ed23
Compare
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
Add a reusable test fixture that sets up a fully initialized campaign environment with clean per-test isolation.
Changes
CampaignFixturestruct with env, creator, contract_id, and campaign statewith_campaign(prefix)helper that creates anEnv, registers and initializes the campaign contractmock_all_auths, contract method invocation, and storage assertionsCloses #32