maiflai / gradle-scalatest

A plugin to enable the use of scalatest in a gradle Scala project.
The Unlicense
73 stars 35 forks source link

excludeTestsMatching does not work #81

Open JLLeitschuh opened 4 years ago

JLLeitschuh commented 4 years ago

I was attempting to exclude some tests from Scalatest and quickly realized that this did not work:

val test = tasks.named("test", Test::class) {
    filter {
        excludeTestsMatching("*IntegTest")
        excludeTestsMatching("*IntegSpec")
        excludeTestsMatching("*.thirdpartyInteg.*")
    }
}

It seems that the excluded patterns aren't currently taken into account by this plugin, only the includePatterns are. https://github.com/maiflai/gradle-scalatest/blob/master/src/main/groovy/com/github/maiflai/ScalaTestAction.groovy#L159

Does Scalatest support excluding specific tests? If so, is there a quick way I can add this support?

maiflai commented 4 years ago

Sorry, http://www.scalatest.org/user_guide/using_the_runner suggests that it does not support excluding tests in this way.

You might do better using the bare excludes API? I think that it might exclude classes from the runtime classpath, which would hide them from ScalaTest.

lionralfs commented 12 months ago

I'm running into the same issue, excludes doesn't work unfortunately. I think it's scalatest's -R argument that always includes build/classes/scala/test.

maiflai commented 12 months ago

Have you tried https://github.com/helmethair-co/scalatest-junit-runner please?