Exclude via tags in ScalaTest
I have a suite of tests using ScalaTest (and specifically FunSpec), and I have assigned some tags to some tests as described here:
http://www.scalatest.org/user_guide/tagging_your_tests
I would like to exclude some tests based on these tags, which seems to be possible with other ways of running the tests (eg. the Runner, the Maven plugin, ant, etc.).
Is that supported by the plugin? If yes, how? If not, will it be supported in the near future?
请先登录再写评论。
You should be able to exclude them via Test options property of ScalaTest run configuration. I use "-n pl.package.test.MyTagName" to include tags, so "-l" should work for exclusion. Other Runner oprions should work as well..
Thanks! I hadn't realized what this Test options field accepted. Perhaps it should be noted somewhere.
Hello, I am trying to exclude by tags but in Intellj 2023.3 I don't see Test options field in ScalaTest run configuration. How to do in modern Intellij?
In 2025.3 and probably earlier the field ‘Program arguments’ works for me. Originally I tried adding “-- -l myexcludetag” per the SBT style command line. Then I searched for a solution which led me here. Finally, I just tried removing the “--” part and it worked :)
I'd like to find some explanation of the magical org.jetbrains.plugins.scala.testingSupport.scalaTest.ScalaTestRunner. Of course it is nice to have this integration but I would like to know a little more what is going on.