Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed failing test

The issue was that the test runner (i.e., ``CollectProblemsTest``), had an
hardcoded reference to the Scala library, which is needed to correctly run the
test. However, due to recent git-history re-writing (which has considerably
reduced the repo's size), the Scala library JAR referenced in the test was no
longer available.

The fix is to pass the ``testClasspath`` to the test runner, and at the moment
the ``testClasspath`` only contains a reference to the Scala library's path
used to build the project itself.
  • Loading branch information...
commit 0e6fa08c86c32c747153c9c9033a642d009be130 1 parent 04f00e0
@dotta dotta authored
View
7 project/Build.scala
@@ -217,17 +217,20 @@ object MimaBuild extends Build {
val testClass = loader.loadClass("com.typesafe.tools.mima.lib.CollectProblemsTest")
val testRunner = testClass.newInstance().asInstanceOf[
- { def runTest(testName: String, oldJarPath: String, newJarPath: String,
+ { def runTest(testClasspath: List[String], testName: String, oldJarPath: String, newJarPath: String,
oraclePath: String): Unit
}]
+ // Add the scala-library to the MiMa classpath used to run this test
+ val testClasspath = data(cp).filter(_.getName endsWith "scala-library.jar").map(_.getAbsolutePath).toList
+
val projectPath = proj.build.getPath + "reporter" + "/" + "functional-tests" + "/" + "src" +
"/" + "test" + "/" + proj.project
val oraclePath = projectPath + "/problems.txt"
try {
- testRunner.runTest(proj.project, v1.getAbsolutePath, v2.getAbsolutePath, oraclePath)
+ testRunner.runTest(testClasspath, proj.project, v1.getAbsolutePath, v2.getAbsolutePath, oraclePath)
streams.log.info("Test '" + proj.project + "' succeeded.")
} catch {
case e: Exception => streams.log.error(e.toString)
View
5 ...ter/functional-tests/src/main/scala/com/typesafe/tools/mima/lib/CollectProblemsTest.scala
@@ -8,11 +8,10 @@ case class TestFailed(msg: String) extends Exception(msg)
class CollectProblemsTest {
- def runTest(testName: String, oldJarPath: String, newJarPath: String, oraclePath: String) {
+ def runTest(testClasspath: List[String])(testName: String, oldJarPath: String, newJarPath: String, oraclePath: String) {
// load test setup
Config.setup("scala com.typesafe.tools.mima.MiMaLibUI <old-dir> <new-dir>", Array(oldJarPath, newJarPath))
- var scalaLib = "regressions-tests/scala-library/scala-library-2.9.0.jar"
- val cp = scalaLib :: ClassPath.split(Config.baseClassPath.asClasspathString)
+ val cp = testClasspath ::: ClassPath.split(Config.baseClassPath.asClasspathString)
val cpString = ClassPath.join(cp: _*)
Config.baseClassPath = new JavaClassPath(ClassPath.DefaultJavaContext.classesInPath(cpString).toIndexedSeq, ClassPath.DefaultJavaContext)
Please sign in to comment.
Something went wrong with that request. Please try again.