Skip to content

Commit

Permalink
Allow developer control of parallel testing
Browse files Browse the repository at this point in the history
Move the definition of parallel testing from the Maven pom file into the
Jenkinsfile so that ci.jenkins.io continues to run the tests with one
process per available core, while developers are allowed to configure
the amount of parallel testing based on the configuration and use of
their computer.

Developers can adjust parallel execution by passing a command line
argument to Maven like this:

  mvn clean -DforkCount=1C verify

Developers can define a Maven profile that sets the forkCount in their
~/.m2/settings.xml like this:

  <profile>
    <id>faster</id>
    <activation>
      <activeByDefault>true</activeByDefault>
    </activation>
    <properties>
      <forkCount>.45C</forkCount>
    </properties>
  </profile>

With that entry in the settings.xml file, then 0.45C will be used for:

  mvn clean verify
  • Loading branch information
MarkEWaite committed Sep 13, 2023
1 parent 8c39121 commit 9f58cce
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 10 deletions.
1 change: 1 addition & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ def configurations = [

def params = [
failFast: false,
forkCount: '1C',
configurations: configurations,
checkstyle: [qualityGates: [[threshold: 1, type: 'NEW', unstable: true]]],
pmd: [qualityGates: [[threshold: 1, type: 'NEW', unstable: true]]],
Expand Down
2 changes: 1 addition & 1 deletion SUPPORTED-FORMATS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!--- DO NOT EDIT -- Generated at 2023-08-01T11:30:25.603198 - Run the `main` method of `ParserRegistry` to regenerate after changing parsers -- DO NOT EDIT --->
<!--- DO NOT EDIT -- Generated at 2023-09-13T02:05:34.531773 - Run the `main` method of `ParserRegistry` to regenerate after changing parsers -- DO NOT EDIT --->
# Supported Report Formats

The static analysis model supports the following report formats.
Expand Down
9 changes: 0 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -476,15 +476,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<parallel>all</parallel>
<useUnlimitedThreads>true</useUnlimitedThreads>
<forkCount>1C</forkCount>
</configuration>
</plugin>
</plugins>
</build>

Expand Down

0 comments on commit 9f58cce

Please sign in to comment.