Skip to content

Commit 840cc46

Browse files
dfa1claude
andcommitted
build: hoist common pitest config into parent pluginManagement
Review feedback: define the PIT setup once in the parent. The parent `pitest` profile now holds the plugin version, the pitest-junit5-plugin dependency, the verify-phase execution, and the shared output config under <pluginManagement>. Each module's `pitest` profile keeps only its <targetClasses>; targetTests falls back to PIT's default (test packages matching the targets), so it no longer needs spelling out per module. Reader 95% / core 100% mutation scores unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent ff21a21 commit 840cc46

3 files changed

Lines changed: 45 additions & 53 deletions

File tree

core/pom.xml

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@
179179

180180
<!-- Mutation testing for the bounds primitive (ADR 0003 Phase E). Opt-in only:
181181
./mvnw -pl core -P pitest verify
182+
Common PIT setup is inherited from the parent `pitest` profile; only the scope differs.
182183
Report: core/target/pit-reports/. -->
183184
<profile>
184185
<id>pitest</id>
@@ -187,35 +188,10 @@
187188
<plugin>
188189
<groupId>org.pitest</groupId>
189190
<artifactId>pitest-maven</artifactId>
190-
<version>1.20.0</version>
191-
<dependencies>
192-
<dependency>
193-
<groupId>org.pitest</groupId>
194-
<artifactId>pitest-junit5-plugin</artifactId>
195-
<version>1.2.3</version>
196-
</dependency>
197-
</dependencies>
198-
<executions>
199-
<execution>
200-
<id>pit-report</id>
201-
<phase>verify</phase>
202-
<goals>
203-
<goal>mutationCoverage</goal>
204-
</goals>
205-
</execution>
206-
</executions>
207191
<configuration>
208192
<targetClasses>
209193
<param>io.github.dfa1.vortex.core.IoBounds</param>
210194
</targetClasses>
211-
<targetTests>
212-
<param>io.github.dfa1.vortex.core.*</param>
213-
</targetTests>
214-
<outputFormats>
215-
<param>HTML</param>
216-
<param>XML</param>
217-
</outputFormats>
218-
<timestampedReports>false</timestampedReports>
219195
</configuration>
220196
</plugin>
221197
</plugins>

pom.xml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,46 @@
536536
</plugins>
537537
</build>
538538
</profile>
539+
<!-- Mutation testing (opt-in: -P pitest). Common PIT setup lives here once; each module's
540+
own `pitest` profile only adds the plugin to <plugins> and names its <targetClasses>.
541+
targetTests is left to PIT's default (test packages matching the target classes). -->
542+
<profile>
543+
<id>pitest</id>
544+
<build>
545+
<pluginManagement>
546+
<plugins>
547+
<plugin>
548+
<groupId>org.pitest</groupId>
549+
<artifactId>pitest-maven</artifactId>
550+
<version>1.20.0</version>
551+
<dependencies>
552+
<dependency>
553+
<groupId>org.pitest</groupId>
554+
<artifactId>pitest-junit5-plugin</artifactId>
555+
<version>1.2.3</version>
556+
</dependency>
557+
</dependencies>
558+
<executions>
559+
<execution>
560+
<id>pit-report</id>
561+
<phase>verify</phase>
562+
<goals>
563+
<goal>mutationCoverage</goal>
564+
</goals>
565+
</execution>
566+
</executions>
567+
<configuration>
568+
<outputFormats>
569+
<param>HTML</param>
570+
<param>XML</param>
571+
</outputFormats>
572+
<timestampedReports>false</timestampedReports>
573+
</configuration>
574+
</plugin>
575+
</plugins>
576+
</pluginManagement>
577+
</build>
578+
</profile>
539579
</profiles>
540580

541581
</project>

reader/pom.xml

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -76,33 +76,17 @@
7676

7777
<profiles>
7878
<!-- Mutation testing pilot (ADR: test-suite strength). Opt-in only:
79-
./mvnw -pl reader -P pitest test-compile org.pitest:pitest-maven:mutationCoverage
80-
Scoped to the file-structure bounds-checking parse classes that have
81-
dedicated security tests. Report: reader/target/pit-reports/. -->
79+
./mvnw -pl reader -am -P pitest verify -DskipITs
80+
Common PIT setup is inherited from the parent `pitest` profile; only the scope differs:
81+
the file-structure bounds-checking parse classes with dedicated security tests.
82+
Report: reader/target/pit-reports/. -->
8283
<profile>
8384
<id>pitest</id>
8485
<build>
8586
<plugins>
8687
<plugin>
8788
<groupId>org.pitest</groupId>
8889
<artifactId>pitest-maven</artifactId>
89-
<version>1.20.0</version>
90-
<dependencies>
91-
<dependency>
92-
<groupId>org.pitest</groupId>
93-
<artifactId>pitest-junit5-plugin</artifactId>
94-
<version>1.2.3</version>
95-
</dependency>
96-
</dependencies>
97-
<executions>
98-
<execution>
99-
<id>pit-report</id>
100-
<phase>verify</phase>
101-
<goals>
102-
<goal>mutationCoverage</goal>
103-
</goals>
104-
</execution>
105-
</executions>
10690
<configuration>
10791
<targetClasses>
10892
<param>io.github.dfa1.vortex.reader.Footer</param>
@@ -112,14 +96,6 @@
11296
<param>io.github.dfa1.vortex.reader.Layout</param>
11397
<param>io.github.dfa1.vortex.reader.FlatSegmentDecoder</param>
11498
</targetClasses>
115-
<targetTests>
116-
<param>io.github.dfa1.vortex.reader.*</param>
117-
</targetTests>
118-
<outputFormats>
119-
<param>HTML</param>
120-
<param>XML</param>
121-
</outputFormats>
122-
<timestampedReports>false</timestampedReports>
12399
</configuration>
124100
</plugin>
125101
</plugins>

0 commit comments

Comments
 (0)