1

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?


Andrey Tyukin
  • 43,673
  • 4
  • 57
  • 93
  • Removing unrelated munit tag which is used for MuleSoft MUnit testing framework. scalameta seems a more appropriate tag. Feel free to update the tags. – aled Sep 01 '23 at 11:50
  • 2
    @aled Oh... Thanks. The pigeonhole principle states that if one keeps naming unit-test frameworks like `unit`, then one will definitely run into a collision after the 27th framework. – Andrey Tyukin Sep 01 '23 at 12:01

0 Answers0