Skip to content

Commit

Permalink
fix(SmartRunner): Run tracing agent (and test one by one) only until …
Browse files Browse the repository at this point in the history
…a divergence is found
  • Loading branch information
nharrand committed Jun 28, 2018
1 parent 585a72c commit b3e0bd0
Showing 1 changed file with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ protected void run(Transformation trans) throws Exception {
//p.setProperty("test", );
status = -2;
boolean divergent = false;
for(int i = 0; i < tests.length; i++) {
int i = 0;
for(; i < tests.length; i++) {
p.setProperty("test", tests[i]);
String argLine = buildAgentLine(tests[i]);
if(argLine != null) {
Expand All @@ -83,6 +84,22 @@ protected void run(Transformation trans) throws Exception {
break;
} else if (status >= 1) {
divergent = true;
break;
}
}
if(status >= 0) {
String remainingTests = "";
int first = i;
for(; i < tests.length; i++) {
if(i != first) remainingTests += "," + tests[i];
else remainingTests += tests[i];
}
if(!remainingTests.equals("")) {

Properties p2 = new Properties();
p2.setProperty("test", remainingTests);
p2.setProperty("failIfNoTests","false");
status = runTest(tmpDir, p2);
}
}
if(divergent && status >= 0) status = 1;
Expand Down

0 comments on commit b3e0bd0

Please sign in to comment.