New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ScalaTest runner issue with SBT, scala.js and Slow test selections #2232
Comments
@OndrejSpanel Sorry for the delay, I am looking into this now to see if I can see anything. |
@OndrejSpanel @sjrd It seems like the error is coming from Reflect.lookupInstantiatableClass in this line: I first thought it was the .asInstanceOf[Suite], but as some investigation it blows up when calling Reflect.lookupInstantiatableClass, and the passed in class name is correct. Also, when the SBT way of selecting the tests is not used, the same class can be loaded and run successfully. @sjrd I wonder if you may have a better idea what's different in Reflect.lookupInstantiatableClass when using with/without the sbt test selection? |
@OndrejSpanel @sjrd Fyi I think some side effects happens in inConfig to Reflect.lookupInstantiatableClass, if you remove the Test / testOptions and Slow / testOptions and leave the inConfig line in build.sbt and run |
@OndrejSpanel @sjrd It seems to blow up at this 'innocent' line: Unfortunately I have no idea what side effect could have caused it. |
The original error message is a JVM error message, not a Scala.js one. Somehow you're trying to run some Scala.js code on the JVM. |
@sjrd Yes, I think you are right, I am trying to see if it is this line:
that's causing the problem and make it to run on JVM instead of JS, if I change it to:
The error goes away but the filtering does not work also, I wonder if we should use something different in place of Defaults.testTasks for scala-js? |
@sjrd @OndrejSpanel Using the following inConfig seems to work:
@sjrd Do you mind to verify that it is the correct thing to do? Thanks. |
Oh, you use a custom Config? Then you also need to add Edit: cross-post ^^ Yes, that's the correct thing to do. |
Thanks @sjrd ! 🙏🏻 @OndrejSpanel can you see if the solution works for you? |
Yes. it works fine, thanks. I can see this is documented in https://www.scala-js.org/doc/project/testing.html Could perhaps something be made to make this more discoverable for people who do not read documentation (I did not), and just hit the error by using the configuration from JVM by blindly copying or using it in a crossproject? |
I have reported the issue in the SBT repository, but after inspecting the callstack, perhaps it would rather belong here?
sbt/sbt#7184
When using a technique described in How to disable "Slow" tagged Scalatests by default, allow execution with option? to allow running some tests with a dedicated "Slow" configuration, no tests, are run, exception is thrown instead.
The relevant part of the callstack is:
The error can be reproduced by running
sbt Slow/test
from a very small repository at https://github.com/OndrejSpanel/ScalaJSSlowTestThe text was updated successfully, but these errors were encountered: