Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Record maven-invoker-plugin failures via junit rather than console #301

Merged
merged 1 commit into from
Feb 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For CI. Inspired by a similar profile in pom / plugin-pom.

<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>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For local devs.

<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