You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Share one scoped env-var test guard: EnvGuard is copy-pasted 11 times across core unit and integration tests #1889
Add one #[cfg(test)] pub(crate) mod test_env in core, beside test_rng. It holds EnvGuard::set(key, value), ::unset(key) and a multi-key form taking OsStr values, plus with_env(pairs, f).
Unit tests use it.
The three integration-test files share one copy in tests/common/, or through a test-support feature if one already exists.
Where a function under test already takes injected env (*_with variants), switch the test to that and drop the guard.
Size
About 12 files, about −150 lines. Tests only.
Acceptance criteria
No production code changes.
Every touched test still runs under #[serial] where it did before and passes.
grep -rn "struct EnvGuard" crates/socket-patch-core/src finds one definition.
Activity
audit-core: crawlers composer..maven, A30-A39, file #1887-#1889
mikolalysenko commentedon Oct 30, 2026
[agent] Claiming this issue (CI/test-infra lane). Branch: agent/fix-ci-test-env-guard. Claim-ID: 2026-10-30T06:51:13Z-66005a
Generated by Claude Code
mikolalysenko commentedon Oct 30, 2026
[agent] Draft PR: #1891
Generated by Claude Code