Skip to content

Commit

Permalink
Optimize Maven test execution using forked JVMs
Browse files Browse the repository at this point in the history
Build time went from the 40-50 s range down to the 10-20 s range.
  • Loading branch information
MaisiKoleni committed Mar 18, 2022
1 parent 940b40e commit f271e17
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
restore-keys: |
ares-maven-
- name: Test with Maven and JDK ${{ matrix.java }}
run: mvn -B clean test
run: mvn -B clean test -P fast
test-gradle:
runs-on: ubuntu-latest
strategy:
Expand Down
21 changes: 21 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,27 @@
</snapshotRepository>
</distributionManagement>
</profile>
<!-- Profile for fast builds and tests (~ 16 s) -->
<profile>
<id>fast</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
<configuration>
<forkCount>4</forkCount>
<reuseForks>true</reuseForks>
<properties>
<!-- There seem to be race conditions with forks and jqwik -->
<configurationParameters>jqwik.database=</configurationParameters>
</properties>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<!-- Profile for manually deploying to Maven Central -->
<profile>
<id>ossrh</id>
Expand Down

0 comments on commit f271e17

Please sign in to comment.