Menu

How to Run Test Impact Analysis in Maven Without Breaking JaCoCo Code Coverage
📰

How to Run Test Impact Analysis in Maven Without Breaking JaCoCo Code Coverage

DEV Community: cicd·BaoKhang·1 day ago
#UMYzAJ9e
#devtocicd#devto#dev#jacoco#agent
Reading 0:00
15s threshold

Test impact analysis (TIA) and code coverage both want the same thing from your build: a seat on the test JVM's command line. Coverage tools attach a Java agent through argLine . Many TIA tools do too. When two agents, or two plugins writing the same property, meet in one argLine , the usual outcomes are a corrupted jacoco.exec , an empty report, or a team quietly turning coverage off on pull requests.

This post walks through how blastradius avoids that on pull requests, where the one setup that does collide on the base branch is, and the one-property fix. Everything here comes from a small fixture I built and ran, so the results are reproducible rather than asserted.

Where the collision comes from

JaCoCo's prepare-agent goal writes a -javaagent: option into a Maven property, argLine by default. Surefire then reads that property when it forks the test JVM.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.