munit icon indicating copy to clipboard operation
munit copied to clipboard

Tagging: `--include-tags` does not override the option set in sbt

Open bphenriques opened this issue 3 years ago • 1 comments

Hello,

In my use-case I want to have two set of integration tests:

  1. Ones that I can run entirely locally. No tags set.
  2. Others that require connecting to a real testing environment. Tests tagged with uat-integration.

By default I want to skip tests in 2. but optionally override the sbt command to run those same tests. As in:

IntegrationTest / testOptions += Tests.Argument("--exclude-tags=uat-integration"), // also works albeit different from the docs

And then:

$ sbt "it:test -- --include-tags=uat-integration"

However, it seems that the parameter does not override the default option. Passing parameters to sbt is a bit finicky so I might be wrong as well.

My current workaround is to create a custom sbt task LocalIntegrationTest that excludes the tag (however I wanted to avoid that approach). I might be approaching munit incorrectly therefore I look forward for your feedback.

If the problem is not clear, I can setup a sample project with this scenario when I get the chance.

bphenriques avatar Jul 22 '22 11:07 bphenriques

I no longer have a need for this but leave the issue open as it documents unexpected behaviour as far as I can tell.

bphenriques avatar Aug 02 '22 09:08 bphenriques