Skip to content

Commit

Permalink
Merge pull request #301 from jglick/invoker
Browse files Browse the repository at this point in the history
Record `maven-invoker-plugin` failures via `junit` rather than console
  • Loading branch information
jglick authored Feb 25, 2022
2 parents 2668939 + ac75f6d commit bc6de22
Show file tree
Hide file tree
Showing 17 changed files with 44 additions and 26 deletions.
4 changes: 2 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ properties([buildDiscarder(logRotator(numToKeepStr: '20'))])
node('maven') {
checkout scm
timeout(time: 1, unit: 'HOURS') {
// TODO Azure mirror
ansiColor('xterm') {
withEnv(['MAVEN_OPTS=-Djansi.force=true']) {
sh 'mvn -B -Dstyle.color=always -ntp -Prun-its clean install site'
sh 'mvn -B -Dstyle.color=always -ntp -Prun-its -Dmaven.test.failure.ignore clean install site'
junit 'target/invoker-reports/TEST-*.xml'
}
}
}
Expand Down
36 changes: 27 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -319,15 +319,17 @@
<cloneProjectsTo>${project.build.directory}/its</cloneProjectsTo>
<localRepositoryPath>${basedir}/target/local-repo</localRepositoryPath>
<settingsFile>src/it/settings.xml</settingsFile>
<showErrors>true</showErrors>
<streamLogs>true</streamLogs>
<pomIncludes>
<pomInclude>*/pom.xml</pomInclude>
</pomIncludes>
<postBuildHookScript>verify</postBuildHookScript>
<filterProperties>
<repository.proxy.url>${repository.proxy.url}</repository.proxy.url>
</filterProperties>
<environmentVariables>
<!-- block anything set by a CI environment -->
<JENKINS_HOME />
</environmentVariables>
</configuration>
</plugin>
<plugin>
Expand Down Expand Up @@ -411,13 +413,6 @@
<goal>install</goal>
<goal>run</goal>
</goals>
<configuration>
<streamLogs>true</streamLogs>
<environmentVariables>
<!-- block anything set by a CI environment -->
<JENKINS_HOME />
</environmentVariables>
</configuration>
</execution>
</executions>
</plugin>
Expand All @@ -436,5 +431,28 @@
</plugins>
</build>
</profile>
<profile>
<id>all-tests</id>
<activation>
<property>
<name>!invoker.test</name>
</property>
</activation>
<properties>
<invoker.writeJunitReport>true</invoker.writeJunitReport>
<invoker.junitPackageName>io.jenkins.tools.maven_hpi_plugin.its</invoker.junitPackageName>
</properties>
</profile>
<profile>
<id>specific-tests</id>
<activation>
<property>
<name>invoker.test</name>
</property>
</activation>
<properties>
<invoker.streamLogs>true</invoker.streamLogs>
</properties>
</profile>
</profiles>
</project>
2 changes: 1 addition & 1 deletion src/it/JENKINS-45740-metadata/invoker.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# install, not verify, because we want to check the artifact as we would be about to deploy it
# release.skipTests normally set in jenkins-release profile since release:perform would do the tests
invoker.goals=-Dstyle.color=always -ntp -Pjenkins-release -Drelease.skipTests=false clean install
invoker.goals=-ntp -Pjenkins-release -Drelease.skipTests=false clean install
2 changes: 1 addition & 1 deletion src/it/JENKINS-58771-packaged-plugins-2/invoker.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
invoker.goals=-Dstyle.color=always -ntp clean install
invoker.goals=-ntp clean install
2 changes: 1 addition & 1 deletion src/it/JENKINS-58771-packaged-plugins-3/invoker.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
invoker.goals=-Dstyle.color=always -ntp clean install
invoker.goals=-ntp clean install
2 changes: 1 addition & 1 deletion src/it/JENKINS-58771-packaged-plugins/invoker.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
invoker.goals=-Dstyle.color=always -ntp clean install
invoker.goals=-ntp clean install
2 changes: 1 addition & 1 deletion src/it/assemble-dependencies-as-jpi/invoker.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
# under the License.
#

invoker.goals=-Dstyle.color=always -ntp clean generate-resources
invoker.goals=-ntp clean generate-resources
2 changes: 1 addition & 1 deletion src/it/assemble-dependencies/invoker.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
# under the License.
#

invoker.goals=-Dstyle.color=always -ntp clean generate-resources
invoker.goals=-ntp clean generate-resources
2 changes: 1 addition & 1 deletion src/it/check-core-version-failure/invoker.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@
# under the License.
#

invoker.goals=-Dstyle.color=always -ntp validate
invoker.goals=-ntp validate
invoker.buildResult = failure
2 changes: 1 addition & 1 deletion src/it/check-core-version-success/invoker.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
# under the License.
#

invoker.goals=-Dstyle.color=always -ntp validate
invoker.goals=-ntp validate
2 changes: 1 addition & 1 deletion src/it/compile-fork-it/invoker.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
# under the License.
#

invoker.goals=-Dstyle.color=always -ntp clean compile
invoker.goals=-ntp clean compile
2 changes: 1 addition & 1 deletion src/it/compile-it/invoker.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
# under the License.
#

invoker.goals=-Dstyle.color=always -ntp clean compile
invoker.goals=-ntp clean compile
2 changes: 1 addition & 1 deletion src/it/compile-multimodule-it/invoker.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
# under the License.
#

invoker.goals=-Dstyle.color=always -ntp clean compile
invoker.goals=-ntp clean compile
2 changes: 1 addition & 1 deletion src/it/parent-3x/invoker.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# install, not verify, because we want to check the artifact as we would be about to deploy it
# release.skipTests normally set in jenkins-release profile since release:perform would do the tests
invoker.goals=-Dstyle.color=always -ntp -Pjenkins-release -Drelease.skipTests=false clean install hpi:run
invoker.goals=-ntp -Pjenkins-release -Drelease.skipTests=false clean install hpi:run
2 changes: 1 addition & 1 deletion src/it/process-jar/invoker.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
# under the License.
#

invoker.goals=-Dstyle.color=always -ntp clean verify
invoker.goals=-ntp clean verify
2 changes: 1 addition & 1 deletion src/it/snapshot-version-override/invoker.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
# under the License.
#

invoker.goals=-Dstyle.color=always -ntp clean verify
invoker.goals=-ntp clean verify
2 changes: 1 addition & 1 deletion src/it/verify-it/invoker.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
# under the License.
#

invoker.goals=-Dstyle.color=always -ntp clean verify
invoker.goals=-ntp clean verify

0 comments on commit bc6de22

Please sign in to comment.