Skip to content

test: prevent ambient environment from leaking into daemon builds on CI (2.x) - #1711

Merged
slachiewicz merged 1 commit into
masterfrom
fix/master-test-isolation
Aug 3, 2026
Merged

test: prevent ambient environment from leaking into daemon builds on CI (2.x)#1711
slachiewicz merged 1 commit into
masterfrom
fix/master-test-isolation

Conversation

@slachiewicz

Copy link
Copy Markdown
Member

Description

Backports the integration test hermeticity fixes from mvnd-1.x (commit b3a40f2 / PR #1666) to master (2.x).

  • Extract buildRequestEnvironment() in DefaultClient for subclass override.
  • Strip MAVEN_ARGS from JvmTestClient and NativeTestClient to block per-test flag overrides by ambient environment variables on CI.
  • Write an isolated settings.xml in MvndTestExtension so daemon tests never fall back to the runner's user settings (~/.m2/settings.xml).

@gnodet gnodet left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean backport of test-infrastructure hermeticity fixes from mvnd-1.x.

Three changes — all correct:

  1. buildRequestEnvironment() extractionDefaultClient now exposes a protected method (defaults to System.getenv()) that test subclasses override to strip MAVEN_ARGS. Production behavior unchanged.
  2. MAVEN_ARGS stripping — Both JvmTestClient (via override) and NativeTestClient (via ProcessBuilder env) strip the variable, covering both code paths that feed into Server.java:624.
  3. Isolated settings.xml — Written per-test to testDir with valid <settings/> defaults, preventing ambient ~/.m2/settings.xml from leaking into daemon builds.

The backport faithfully adapts the 1.x fix (882d615) for 2.x's different code structure. Test-infrastructure-only changes — no production logic modified.

This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.

Claude Code on behalf of @gnodet

@slachiewicz
slachiewicz force-pushed the fix/master-test-isolation branch from c352683 to e8a8e51 Compare August 3, 2026 23:24
@slachiewicz
slachiewicz merged commit 67d0a23 into master Aug 3, 2026
4 of 12 checks passed
@slachiewicz
slachiewicz deleted the fix/master-test-isolation branch August 3, 2026 23:25
@github-actions github-actions Bot added this to the 2.0.0-rc-4 milestone Aug 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants