passing args to junit (but not scalatest) in sbt

18 views
Skip to first unread message

Imran Rashid

unread,
Jan 25, 2019, 12:38:06 PM1/25/19
to scalatest-users
Hi,

I'm not sure if this a question for scalatest or sbt or something else.  I have a project which has both scalatests and junit tests.  This all works fine when I'm just trying to run all tests, but things don't work when I try to pass extra arguments to the junit test runner.  It *does* work if I pass extra arguments to the scalatest runner -- eg. "-z" to filter down the set of tests to run.  But I try to pass junit the "--tests" parameter (https://github.com/sbt/junit-interface) in sbt, then scalatest ends up complaining that it doesn't know about that argument:

> test-only *spark.shuffle.sort.* -- --tests=writeEmptyIterator

...

[error] (core/test:testOnly) java.lang.IllegalArgumentException: Argument unrecognized by ScalaTest's Runner: --tests=writeEmptyIterator



Is there any way around this? I understand why you want scalatest to fail fast on unrecognized arguments, but in this case that argument is also getting passed somewhere else and so its fine that scalatest doesn't know what to do with it.  Maybe there is an extra flag I can pass like --scalatest-ignore-unrecognized-args?

thanks,
Imran
Reply all
Reply to author
Forward
0 new messages