From 69e5fb225f84abf217aaef0457e867bf4301e399 Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Wed, 23 Aug 2017 19:08:58 +1000 Subject: [PATCH] Make corpus version auto-selection fail gracefully --- .../scala/bench/ScalacBenchmarkRunner.java | 38 ++++++++++--------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/infrastructure/src/main/java/scala/bench/ScalacBenchmarkRunner.java b/infrastructure/src/main/java/scala/bench/ScalacBenchmarkRunner.java index 3ea15b9..58ab090 100644 --- a/infrastructure/src/main/java/scala/bench/ScalacBenchmarkRunner.java +++ b/infrastructure/src/main/java/scala/bench/ScalacBenchmarkRunner.java @@ -21,27 +21,31 @@ private static String corpusVersion(String source) throws IOException { throw new RuntimeException("Please provide -DscalaRef=..."); // TODO: git fetch --tags + try { - switch(source) { - case "vector": - if (GitWalker.isAncestor("v2.11.0", scalaRef, repo)) - return "fb04376"; // compiles with 2.11.0, but not with 2.10.6 - break; + switch (source) { + case "vector": + if (GitWalker.isAncestor("v2.11.0", scalaRef, repo)) + return "fb04376"; // compiles with 2.11.0, but not with 2.10.6 + break; - case "scalap": - if (GitWalker.isAncestor("v2.10.1", scalaRef, repo)) - return "a8c43dc"; // compiles with 2.10.1, but not with 2.9.3 - break; + case "scalap": + if (GitWalker.isAncestor("v2.10.1", scalaRef, repo)) + return "a8c43dc"; // compiles with 2.10.1, but not with 2.9.3 + break; - case "better-files": - if (GitWalker.isAncestor("v2.10.2", scalaRef, repo)) - return "a45f905"; // compiles with 2.10.2, but not with 2.10.1 - break; + case "better-files": + if (GitWalker.isAncestor("v2.10.2", scalaRef, repo)) + return "a45f905"; // compiles with 2.10.2, but not with 2.10.1 + break; - case "scala": - if (GitWalker.isAncestor("v2.11.5", scalaRef, repo)) - return "21d12e9"; - break; + case "scala": + if (GitWalker.isAncestor("v2.11.5", scalaRef, repo)) + return "21d12e9"; + break; + } + } catch (IllegalArgumentException iae){ + // ignore, we might be on a dotty commit, just pick latest } return null;