Skip to content

Commit

Permalink
Adapt to upstream scalatest change (pantsbuild#9707)
Browse files Browse the repository at this point in the history
### Problem

ScalaTestUtil tries to hydrate org.scalatest.junit.JUnitRunner. However, it turns out that class was moved to org.scalatestplus.junit.JUnitRunner, and we never caught up. Now that they've deleted the type alias for JUnitRunner, we can't upgrade our scalatest version to 3.1.x. 

### Solution

use `org.scalatestplus.junit.JUnitRunner` instead as the junitRunnerClass

[ci skip-rust-tests]
  • Loading branch information
wisechengyi authored May 8, 2020
1 parent bcbb4e5 commit 1d889a5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion 3rdparty/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ jar_library(name='junit',

jar_library(name='scalatest',
jars=[
scala_jar('org.scalatest', 'scalatest', '3.0.0')
scala_jar('org.scalatest', 'scalatest', '3.0.8')
])

jar_library(name='wire-runtime',
Expand Down
2 changes: 1 addition & 1 deletion examples/src/java/org/pantsbuild/example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ especially relevant.
> Pants also includes support for using the ScalaTest framework. The
> testing framework automatically picks up scala tests that extend the
> org.scalatest.Suite class and runs them
> using org.scalatest.junit.JUnitRunner.
> using org.scalatestplus.junit.JUnitRunner.
>
> Most other scala test frameworks support running with JUnit via a base
> class/trait or via a `@RunWith` annotation; so you can use
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ private ScalaTestUtil() {}
static {
try {
suiteClass = Class.forName("org.scalatest.Suite");
junitRunnerClass = Class.forName("org.scalatest.junit.JUnitRunner");
junitRunnerClass = Class.forName("org.scalatestplus.junit.JUnitRunner");
} catch (ClassNotFoundException e) {
// No scalatest tests on classpath
}
Expand Down

0 comments on commit 1d889a5

Please sign in to comment.