Skip to content

Commit d53b7f7

Browse files
committed
changed logging style for parsing test-results
1 parent db3c3a7 commit d53b7f7

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

src/main/java/com/haufelexware/gocd/plugin/octane/converter/OctaneJUnitTestResultsBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public List<TestRun> convert(String artifactUrl) {
4040
try (InputStream report = new GoGetArtifact(goApiClient).get(artifactUrl)) { // try to parse the given artifact as JUnit report file.
4141
return convert(report);
4242
} catch (JAXBException e) {
43-
Log.info("parsing artifact '" + artifactUrl + "' as JUnit report failed");
43+
Log.debug("parsing artifact '" + artifactUrl + "' as JUnit report failed");
4444
} catch (IOException e) {
4545
Log.error("could not read artifact '" + artifactUrl + "' from server", e);
4646
}

src/main/java/com/haufelexware/gocd/plugin/octane/converter/OctaneNUnit25TestResultsBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public List<TestRun> convert(String artifactUrl) {
4040
try (InputStream report = new GoGetArtifact(goApiClient).get(artifactUrl)) { // try to parse the given artifact as JUnit report file.
4141
return convert(report);
4242
} catch (JAXBException e) {
43-
Log.info("parsing artifact '" + artifactUrl + "' as NUnit report failed");
43+
Log.debug("parsing artifact '" + artifactUrl + "' as NUnit(2.5) report failed");
4444
} catch (IOException e) {
4545
Log.error("could not read artifact '" + artifactUrl + "' from server", e);
4646
}

src/main/java/com/haufelexware/gocd/plugin/octane/converter/OctaneNUnit30TestResultsBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public List<TestRun> convert(String artifactUrl) {
4040
try (InputStream report = new GoGetArtifact(goApiClient).get(artifactUrl)) { // try to parse the given artifact as JUnit report file.
4141
return convert(report);
4242
} catch (JAXBException e) {
43-
Log.info("parsing artifact '" + artifactUrl + "' as NUnit report failed");
43+
Log.debug("parsing artifact '" + artifactUrl + "' as NUnit(3.0) report failed");
4444
} catch (IOException e) {
4545
Log.error("could not read artifact '" + artifactUrl + "' from server", e);
4646
}

src/main/java/com/haufelexware/gocd/plugin/octane/converter/OctaneTestResultsBuilder.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ public List<TestRun> convert(GoArtifact artifact) {
4646
testResults.addAll(new OctaneJUnitTestResultsBuilder(goApiClient).convert(artifact.getUrl()));
4747
testResults.addAll(new OctaneNUnit25TestResultsBuilder(goApiClient).convert(artifact.getUrl()));
4848
testResults.addAll(new OctaneNUnit30TestResultsBuilder(goApiClient).convert(artifact.getUrl()));
49+
// create some logfile output.
50+
if (!testResults.isEmpty()) {
51+
Log.info("artifact '" + artifact.getUrl() + "' could be parsed as test-result-file. Found " + testResults.size() + " tests.");
52+
} else {
53+
Log.debug("artifact '" + artifact.getUrl() + "' could not be parsed as test-result-file");
54+
}
4955
return testResults;
5056
}
5157
}

0 commit comments

Comments
 (0)