Skip to content

sbt ScalaCheckRunner: loss of test selection fidelity #1105

Open
@dubinsky

Description

@dubinsky

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 :(

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions