Skip to content
Permalink
Browse files

Revert "JENKINS-45887 : Automatically archive JGiven reports"

  • Loading branch information
Cyrille Le Clerc
Cyrille Le Clerc committed Oct 3, 2017
1 parent 41ff6e8 commit 58419d3133447883212fc2ca8e992f30ecb92eee
@@ -59,7 +59,6 @@ Maven build executions inside the `withMaven(){...}` wil be detected and Jenkins
| Generated Findbugs reports | Publishing of the Findbugs reports generated by the Maven build | [FindBugs Plugin](https://wiki.jenkins-ci.org/display/JENKINS/FindBugs+Plugin) | `.skip-publish-findbugs-results` |
| Generated Invoker reports | Publishing of the Invoker reports generated by the Maven build | [Maven Invoker Plugin](https://wiki.jenkins.io/display/JENKINS/Maven+Invoker+Plugin) | `.skip-publish-invoker-results` |
| Generated Concordion reports | Publishing of the Concordion reports generated by the Maven build | [HTML Publisher Plugin](https://wiki.jenkins.io/display/JENKINS/HTML+Publisher+Plugin) | `.skip-publish-concordion-results` |
| Generated JGiven reports | Publishing of the JGiven reports generated by the Maven build | [JGiven Plugin](https://wiki.jenkins.io/display/JENKINS/JGiven+Plugin) | `.skip-publish-jgiven-results` |
(1) Jenkins Plugin to publish the reports on the Jenkins build page
@@ -168,13 +168,6 @@
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>jgiven</artifactId>
<version>0.15.1</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>maven-invoker-plugin</artifactId>
@@ -85,15 +85,15 @@ public void process(@Nonnull StepContext context, @Nonnull Element mavenSpyLogsE

if (sureFireTestEvents.isEmpty()) {
if (LOGGER.isLoggable(Level.FINE)) {
listener.getLogger().println("[withMaven] invokerPublisher - No " + GROUP_ID + ":" + ARTIFACT_ID + ":" + GOAL + " execution found");
listener.getLogger().println("[withMaven] No " + GROUP_ID + ":" + ARTIFACT_ID + ":" + GOAL + " execution found");
}
return;
}

try {
Class.forName("org.jenkinsci.plugins.maveninvoker.MavenInvokerRecorder");
} catch (ClassNotFoundException e) {
listener.getLogger().print("[withMaven] invokerPublisher - Jenkins ");
listener.getLogger().print("[withMaven] Jenkins ");
listener.hyperlink("https://wiki.jenkins.io/display/JENKINS/Maven+Invoker+Plugin", "Maven Invoker Plugin");
listener.getLogger().println(" not found, don't display " + GROUP_ID + ":" + ARTIFACT_ID + ":" + GOAL + " results in pipeline screen.");
return;
@@ -128,14 +128,14 @@ private void executeReporter(StepContext context, TaskListener listener, List<El
if (reportsDirectory == null || projectsDirectory == null ) continue;

String testResults = reportsDirectory + fileSeparatorOnAgent + "*.xml";
listener.getLogger().println("[withMaven] invokerPublisher - Archive invoker results for Maven artifact " + mavenArtifact.toString() + " generated by " +
listener.getLogger().println("[withMaven] Archive invoker results for Maven artifact " + mavenArtifact.toString() + " generated by " +
pluginInvocation + ": " + testResults);
MavenInvokerRecorder archiver = new MavenInvokerRecorder("**/" + reportsDirectory + "/BUILD*.xml", "**/" + (cloneProjectsTo != null ? cloneProjectsTo : projectsDirectory));

try {
archiver.perform(run, workspace, launcher, listener);
} catch (Exception e) {
listener.error("[withMaven] invokerPublisher - Silently ignore exception archiving Invoker runs for Maven artifact " + mavenArtifact.toString() + " generated by " + pluginInvocation + ": " + e);
listener.error("[withMaven] Silently ignore exception archiving Invoker runs for Maven artifact " + mavenArtifact.toString() + " generated by " + pluginInvocation + ": " + e);
LOGGER.log(Level.WARNING, "Exception processing " + XmlUtils.toString(testEvent), e);
}

@@ -144,7 +144,7 @@ private void executeReporter(StepContext context, TaskListener listener, List<El

private String expandAndRelativize(Element element, String name, Element testEvent, Element projectElt, FilePath workspace, TaskListener listener) {
if (element == null) {
listener.getLogger().println("[withMaven] invokerPublisher - No <" + name + "> element found for <plugin> in " + XmlUtils.toString(testEvent));
listener.getLogger().println("[withMaven] No <" + name + "> element found for <plugin> in " + XmlUtils.toString(testEvent));
return null;
}

@@ -159,7 +159,7 @@ private String expandAndRelativize(Element element, String name, Element testEve
if (result.contains("${project.build.directory}")) {
String projectBuildDirectory = XmlUtils.getProjectBuildDirectory(projectElt);
if (projectBuildDirectory == null || projectBuildDirectory.isEmpty()) {
listener.getLogger().println("[withMaven] invokerPublisher - '${project.build.directory}' found for <project> in " + XmlUtils.toString(testEvent));
listener.getLogger().println("[withMaven] '${project.build.directory}' found for <project> in " + XmlUtils.toString(testEvent));
return null;
}

@@ -168,7 +168,7 @@ private String expandAndRelativize(Element element, String name, Element testEve
} else if (result.contains("${basedir}")) {
String baseDir = projectElt.getAttribute("baseDir");
if (baseDir.isEmpty()) {
listener.getLogger().println("[withMaven] invokerPublisher - '${basedir}' found for <project> in " + XmlUtils.toString(testEvent));
listener.getLogger().println("[withMaven] '${basedir}' found for <project> in " + XmlUtils.toString(testEvent));
return null;
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 58419d3

Please sign in to comment.
You can’t perform that action at this time.