Skip to content

Commit

Permalink
Revert "JENKINS-45887 : Automatically archive JGiven reports"
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyrille Le Clerc committed Oct 3, 2017
1 parent 41ff6e8 commit 58419d3
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 179 deletions.
1 change: 0 additions & 1 deletion jenkins-plugin/README.md
Expand Up @@ -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

Expand Down
7 changes: 0 additions & 7 deletions jenkins-plugin/pom.xml
Expand Up @@ -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>
Expand Down
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}

Expand All @@ -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;
}

Expand All @@ -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;
}

Expand All @@ -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;
}

Expand Down

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.