awired/visuwall — Issue #125: TeamCity plugin fails to extract test status when additional information is present in build status
Author: ArturDorochowicz
Created: 2012-02-07 19:11:52+00:00
State: open

The TeamCity build status may have a format like this:

Tests failed: 1 (1 new), passed: 3, ignored: 5; code inspections: ...

(In fact TeamCity build status may be anything, because it can be set arbitrarily from build script using so called service messages.)

The TeamCity plugin fails to extract test status from such build status. The issue is in
https://github.com/awired/visuwall/blob/develop/plugins/teamcity-plugin/src/main/java/net/awired/visuwall/plugin/teamcity/TestResultExtractor.java#L22

int indexOfBlank = t.indexOf(" ");
if (indexOfBlank != -1) {
String substring = t.substring(0, indexOfBlank);
int parseInt = Integer.parseInt(substring);
return parseInt;
} else {
return Integer.parseInt(t);
}

It should be indexOfFirstNonDigit (with appropriate calculation) instead of indexOfBlank.