Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JENKINS-72538 - SKIP status configurable when calculating all tests #77

Merged
merged 16 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions src/main/java/hudson/plugins/robot/AggregatedRobotAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,33 +109,34 @@

private static final long serialVersionUID = 1L;
private final transient AggregatedRobotAction parent;
private int passed, failed, skipped, criticalPassed, criticalFailed;
private int passed, failed, skipped;

public AggregatedRobotResult(AggregatedRobotAction parent) {
this.parent = parent;
}

public void addResult(RobotResult result) {
criticalFailed += result.getCriticalFailed();
criticalPassed += result.getCriticalPassed();
failed += result.getOverallFailed();
passed += result.getOverallPassed();
skipped += result.getOverallSkipped();
}

@Deprecated
@Override
public long getCriticalPassed() {
return criticalPassed;
return this.getOverallPassed();
}

@Deprecated
@Override
public long getCriticalFailed() {
return criticalFailed;
return this.getOverallFailed();
}

@Deprecated
@Override
public long getCriticalTotal() {
return criticalFailed + criticalPassed;
return this.getOverallTotal();

Check warning on line 139 in src/main/java/hudson/plugins/robot/AggregatedRobotAction.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered lines

Lines 127-139 are not covered by tests
}

@Override
Expand Down
14 changes: 13 additions & 1 deletion src/main/java/hudson/plugins/robot/RobotBuildAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@
private RobotResult result;
private String xAxisLabel;

private boolean countSkippedTests;

static {
XSTREAM.alias("result",RobotResult.class);
XSTREAM.alias("suite",RobotSuiteResult.class);
Expand All @@ -83,7 +85,8 @@
* @param enableCache Whether we want to enable caching or not
*/
public RobotBuildAction(Run<?, ?> build, RobotResult result,
String outputPath, TaskListener listener, String logFileLink, String logHtmlLink, boolean enableCache, String xAxisLabel) {
String outputPath, TaskListener listener, String logFileLink, String logHtmlLink, boolean enableCache, String xAxisLabel,
boolean countSkippedTests) {
super();
super.onAttached(build);
this.build = build;
Expand All @@ -92,6 +95,7 @@
this.logHtmlLink = logHtmlLink;
this.enableCache = enableCache;
this.xAxisLabel = xAxisLabel;
this.countSkippedTests = countSkippedTests;
setResult(result, listener);
}

Expand Down Expand Up @@ -333,4 +337,12 @@
public List<RobotCaseResult> getAllTests() {
return getResult().getAllCases();
}

public boolean isCountSkippedTests() {
return countSkippedTests;
}

public void setCountSkippedTests(boolean countSkippedTests) {
this.countSkippedTests = countSkippedTests;
}

Check warning on line 347 in src/main/java/hudson/plugins/robot/RobotBuildAction.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered lines

Lines 346-347 are not covered by tests
}
4 changes: 2 additions & 2 deletions src/main/java/hudson/plugins/robot/RobotParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ private RobotCaseResult processTest(XMLStreamReader reader, RobotSuiteResult res
caseResult.setLogFile(this.logFileName);
//parse attributes
caseResult.setName(reader.getAttributeValue(null, "name"));
setCriticalityIfAvailable(reader, caseResult);
//setCriticalityIfAvailable(reader, caseResult);
caseResult.setId(reader.getAttributeValue(null, "id"));
//parse test tags
caseResult.setDescription("");
Expand Down Expand Up @@ -346,7 +346,7 @@ private RobotCaseResult processTest(XMLStreamReader reader, RobotSuiteResult res
if (schemaVersion >= 5) {
caseResult.setElapsedTime(reader.getAttributeValue(null, elapsedLocalName));
}
setCriticalityIfAvailable(reader, caseResult);
// setCriticalityIfAvailable(reader, caseResult);
while(reader.hasNext()){
reader.next();
if(reader.isCharacters()){
Expand Down
Loading
Loading