Skip to content

Commit 4c573db

Browse files
authored
Merge pull request #38 from retronym/topic/tolerate
Make corpus version auto-selection fail gracefully
2 parents 6989dd9 + 69e5fb2 commit 4c573db

File tree

1 file changed

+21
-17
lines changed

1 file changed

+21
-17
lines changed

infrastructure/src/main/java/scala/bench/ScalacBenchmarkRunner.java

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,27 +21,31 @@ private static String corpusVersion(String source) throws IOException {
2121
throw new RuntimeException("Please provide -DscalaRef=...");
2222

2323
// TODO: git fetch --tags
24+
try {
2425

25-
switch(source) {
26-
case "vector":
27-
if (GitWalker.isAncestor("v2.11.0", scalaRef, repo))
28-
return "fb04376"; // compiles with 2.11.0, but not with 2.10.6
29-
break;
26+
switch (source) {
27+
case "vector":
28+
if (GitWalker.isAncestor("v2.11.0", scalaRef, repo))
29+
return "fb04376"; // compiles with 2.11.0, but not with 2.10.6
30+
break;
3031

31-
case "scalap":
32-
if (GitWalker.isAncestor("v2.10.1", scalaRef, repo))
33-
return "a8c43dc"; // compiles with 2.10.1, but not with 2.9.3
34-
break;
32+
case "scalap":
33+
if (GitWalker.isAncestor("v2.10.1", scalaRef, repo))
34+
return "a8c43dc"; // compiles with 2.10.1, but not with 2.9.3
35+
break;
3536

36-
case "better-files":
37-
if (GitWalker.isAncestor("v2.10.2", scalaRef, repo))
38-
return "a45f905"; // compiles with 2.10.2, but not with 2.10.1
39-
break;
37+
case "better-files":
38+
if (GitWalker.isAncestor("v2.10.2", scalaRef, repo))
39+
return "a45f905"; // compiles with 2.10.2, but not with 2.10.1
40+
break;
4041

41-
case "scala":
42-
if (GitWalker.isAncestor("v2.11.5", scalaRef, repo))
43-
return "21d12e9";
44-
break;
42+
case "scala":
43+
if (GitWalker.isAncestor("v2.11.5", scalaRef, repo))
44+
return "21d12e9";
45+
break;
46+
}
47+
} catch (IllegalArgumentException iae){
48+
// ignore, we might be on a dotty commit, just pick latest
4549
}
4650

4751
return null;

0 commit comments

Comments
 (0)