Skip to content

Fix #406: make integration tests test the locally built version - #408

Open
elharo wants to merge 2 commits into
masterfrom
fix/issue-406-evaluate-artifact-it-flaky
Open

Fix #406: make integration tests test the locally built version#408
elharo wants to merge 2 commits into
masterfrom
fix/issue-406-evaluate-artifact-it-flaky

Conversation

@elharo

@elharo elharo commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #406.

Three effective-pom/evaluate ITs were flaky on CI (while usually passing locally). Each ran its goal with artifact=org.apache.maven.plugins:maven-help-plugin (no version). The artifact parameter treats a missing version as LATEST, which the plugin resolves by fetching maven-metadata.xml and the plugin POM from remote repositories (Maven Central through the mock repository manager proxy).

This made the ITs depend on:

  • network access to Maven Central at test time (transiently slow/unavailable on CI),
  • whatever the "latest" released version is at that moment (a floating, non-hermetic input).

Change

Pinned the artifact to the plugin version under test by configuring it in the ITs' (invoker-filtered) POMs:

<configuration>
  <artifact>org.apache.maven.plugins:maven-help-plugin:@project.version@</artifact>
</configuration>

@project.version@ is filtered to the locally built version (e.g. 3.5.3-SNAPSHOT), which the invoker install goal already places into the IT local repository. The fake project is therefore built from the local plugin POM: no LATEST metadata resolution, no Central downloads, and the output stays exactly what verify.groovy asserts. Removed the now-redundant artifact lines from the ITs' test.properties.

Applied to:

  • evaluate-artifact-with-expression-with-output (MPH-114): the artifact parameter builds a fake project and evaluates expressions against it while session.currentProject remains the real project (per the enforcer rule).
  • effective-pom-artifact (MPH-106): prints the effective POM of the given artifact.
  • effective-pom-multimodule-artifact (MPH-105): same, in a multi-module reactor.

Verification

  • mvn -Prun-its -Dinvoker.test=evaluate-artifact-with-expression-with-output verify: passes.
  • mvn -Prun-its -Dinvoker.test=effective-pom-artifact,effective-pom-multimodule-artifact verify: passes.
  • Full mvn -Prun-its verify: BUILD SUCCESS, 33 ITs passed (2 skipped, unchanged), 26 unit tests pass.
  • build.log shows Skipped remote request for ...:3.5.3-SNAPSHOT/maven-metadata.xml locally installed metadata up-to-date, i.e. no remote access.

@elharo elharo added the build Pull requests that change the build process label Aug 4, 2026
@elharo elharo changed the title Fix #406: make evaluate-artifact-with-expression-with-output IT hermetic Fix #406: make integration tests test the locally built version Aug 4, 2026
@elharo
elharo requested a review from slachiewicz August 7, 2026 12:34
@elharo elharo added the priority:blocker Blocks development and/or testing work, production could not run label Aug 7, 2026
@slachiewicz
slachiewicz removed their request for review August 10, 2026 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Pull requests that change the build process priority:blocker Blocks development and/or testing work, production could not run

Projects

None yet

Development

Successfully merging this pull request may close these issues.

evaluate-artifact-with-expression-with-output broken or flaky

1 participant