Skip to content
Permalink
Browse files
[JENKINS-31770] fixed ATX report links for multiple archived ATX files
  • Loading branch information
cpoenisch committed Nov 27, 2015
1 parent 2ad60ed commit 80f2287c9a90d875e5ea1f7cf44512f38ab4d667
Showing with 6 additions and 3 deletions.
  1. +6 −3 src/main/java/de/tracetronic/jenkins/plugins/ecutest/report/atx/ATXReportGenerator.java
@@ -153,7 +153,8 @@ public boolean generate(final boolean allowMissing, final ATXInstallation instal
*/
private int traverseReports(final List<ATXZipReport> atxReports, final FilePath archiveTargetDir, int id)
throws IOException, InterruptedException {
final FilePath[] zipFiles = archiveTargetDir.list(ATX_TEMPLATE_NAME + "/*.zip");
final FilePath[] zipFiles = archiveTargetDir.list(String.format("%s/%s.zip", ATX_TEMPLATE_NAME,
archiveTargetDir.getName()));
if (zipFiles.length == 1) {
final FilePath zipFile = zipFiles[0];
final String relFilePath = archiveTargetDir.getParent().toURI().relativize(zipFile.toURI())
@@ -189,16 +190,18 @@ private int traverseReports(final List<ATXZipReport> atxReports, final FilePath
private int traverseSubReports(final ATXZipReport atxReport, final FilePath testReportDir,
final FilePath subTestReportDir, int id) throws IOException, InterruptedException {
for (final FilePath subDir : subTestReportDir.listDirectories()) {
final FilePath[] reportFiles = subDir.list(ATX_TEMPLATE_NAME + "/*.zip");
final FilePath[] reportFiles = subDir.list(String.format("%s/%s.zip", ATX_TEMPLATE_NAME,
subDir.getName()));
if (reportFiles.length == 1) {
// Prepare ATX report information for sub-report
final FilePath reportFile = reportFiles[0];
final String fileName = reportFile.getBaseName().replaceFirst("^Report\\s", "");
final String relFilePath = testReportDir.toURI().relativize(reportFile.toURI()).getPath();
final ATXZipReport subReport = new ATXZipReport(String.format("%d", ++id), fileName, relFilePath,
reportFile.length());

atxReport.addSubReport(subReport);

// Search for sub-reports
id = traverseSubReports(subReport, testReportDir, subDir, id);
}
}

0 comments on commit 80f2287

Please sign in to comment.