Including `munit` tests that are excluded by default

54 views Asked by At

I have an munit test:

package myawesomeproject

import munit.FunSuite

class MySillyTest extends FunSuite {
  val theTag = new munit.Tag("tagname")
  test("THETEST".tag(theTag)) {
    assertEquals(2, 3)
  }
}

and in my build.sbt, I want to exclude this test by default:

lazy val myawesomeproject = project
  .in(file("myawesomeproject"))
  .settings(
    // ...
    Test / testOptions += Tests.Argument(MUnitFramework, "--exclude-tags=tagname")
  )

When I run test, the test is excluded, as expected.

But when I try to manually override the exclusion with

myawesomeproject / testOnly -- --tests=THETEST --include-tags=tagname

then the test is still not executed, i.e. it seems that the command line setting does not override the build.sbt setting.

Are there any workarounds? How can I run a test that is excluded by default?


0

There are 0 answers