mercredi 30 décembre 2015

testOptions setting is ignored when redefining the test task

I have a subproject named servision with 2 tests configs:

  • ti
  • test

Here is my project config:

val beforeTest := taskKey[Unit]("Before test")

val ti = config("ti") extend (Test)
lazy val servision = project
    .configs(regresion, ti)
    .settings(
        inConfig(ti)(Defaults.testTasks) ++
            Seq(
                testOptions in test := Seq(Tests.Filter(!_.startsWith("ti.")})),
                testOptions in ti := Seq(Tests.Filter(_.startsWith("ti.")})),
                test in ti := {
                   Def.sequential(beforeTest, test in ti).value
                   afterTest()
                }
            )
        )

I've discovered, that if I redefine ti:test, then ti:testOptions are fully ignored, and test:testOptions are used instead.

If I comment out the redefinition, then ti:testOptions are used.

I think this is rather a bug in SBT, that a misconfiguration.

Aucun commentaire:

Enregistrer un commentaire