Skip to content

Add invoker.failedGoal to assert which goal an IT build failed on - #763

Draft
slachiewicz wants to merge 1 commit into
masterfrom
agent/assert-failed-goal
Draft

slachiewicz wants to merge 1 commit into
masterfrom
agent/assert-failed-goal

Conversation

@slachiewicz

Copy link
Copy Markdown
Member

Adds invoker.failedGoal, which pins a failing IT to one goal so that invoker.buildResult = failure can no longer be satisfied by an unrelated failure. The value is a colon separated list of fragments matched in order against the groupId:artifactId:version:goal coordinates Maven logs, with an optional execution id in parentheses, so maven-enforcer-plugin:enforce and the full coordinates both work. The check reads the Failed to execute goal ... line out of the build.log the plugin already owns rather than hooking into the forked build, and it is rejected when invoker.buildResult is not failure or when noLog disabled the log.

Fixes #503

This change was created with AI assistance.

invoker.buildResult = failure accepts any failure, so a test stays green
when the IT build breaks for an unrelated reason. The exit code cannot
tell which goal failed, so the goal is read back from build.log.

Fixes #503
@slachiewicz slachiewicz added the enhancement New feature or request label Sep 15, 2026
@slachiewicz
slachiewicz marked this pull request as ready for review September 15, 2026 23:58
@slawekjaranowski

slawekjaranowski commented Sep 16, 2026 •

Copy link
Copy Markdown
Member

As we execute new Maven instance for each test we can provide a extension with ExecutionListener which collect status of executed goals instead of parsing logs.

We can save report in file and should be easy to read it

@slachiewicz
slachiewicz marked this pull request as draft September 17, 2026 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[MINVOKER-229] Add a property in invoker.properties to check the failed mojo

2 participants