The only code that looks at the test selectors supplied via the sbt.testing.TaskDef is ScalaCheckRunner.checkPropTask(); it recognizes sbt.testing.TestSelectors and selects the properties with the exact names supplied; it should also recognize sbt.testing.TestWildcardSelectors and select the properties with the names containing the wildcard supplied.
Also, ScalaCheckRunner.deserializeTask() should probably count sbt.testing.TestWildcardSelectors towards countTestSelectors and thus dispatch to ScalaCheckRunner.checkPropTask() and not to ScalaCheckRunner.rootTask() if any are supplied.
Finally, whatever test selection functionality ScalaCheck provides only kicks in in very specific use cases:
- when
ScalaCheckRunner.deserializeTask() is called or
- when class name of the
sbt.testing.Fingerprint used contains "ForkMain".
When running ScalaCheck the "official" sbt.testing way, by calling ScalaCheckRunner.tasks() with the fingerprints returned from ScalaCheckFramework.fingerprints() (none of which contain "ForkMain" in their class names), ScalaCheckRunner.checkPropTask() is never called, and no test selection is applied.
Context: Scala.js Gradle plugin integrates with sbt.testing-enabled test frameworks, and ScalaCheck is among them. Plugin does its own TaskDef serialization/deserialization in a way that is not specific to the test framework used, but works with Gradle. As a result of the above idiosyncrasies in the ScalaCheck's test selection functionality, plugin can not access any of it :(
The only code that looks at the test selectors supplied via the
sbt.testing.TaskDefisScalaCheckRunner.checkPropTask(); it recognizessbt.testing.TestSelectors and selects the properties with the exact names supplied; it should also recognizesbt.testing.TestWildcardSelectors and select the properties with the names containing the wildcard supplied.Also, ScalaCheckRunner.deserializeTask() should probably count
sbt.testing.TestWildcardSelectors towardscountTestSelectorsand thus dispatch toScalaCheckRunner.checkPropTask()and not toScalaCheckRunner.rootTask()if any are supplied.Finally, whatever test selection functionality
ScalaCheckprovides only kicks in in very specific use cases:ScalaCheckRunner.deserializeTask()is called orsbt.testing.Fingerprintused contains"ForkMain".When running
ScalaCheckthe "official"sbt.testingway, by callingScalaCheckRunner.tasks()with the fingerprints returned fromScalaCheckFramework.fingerprints()(none of which contain"ForkMain"in their class names),ScalaCheckRunner.checkPropTask()is never called, and no test selection is applied.Context: Scala.js Gradle plugin integrates with
sbt.testing-enabled test frameworks, andScalaCheckis among them. Plugin does its ownTaskDefserialization/deserialization in a way that is not specific to the test framework used, but works with Gradle. As a result of the above idiosyncrasies in theScalaCheck's test selection functionality, plugin can not access any of it :(