Skip to content

Skip Pitest task execution test when source set is empty #294

@davidburstrom

Description

@davidburstrom

For a regular Gradle test task from the Java plugin, if there is no test source, it will just be skipped indicating NO-SOURCE. In contrast, Pitest tasks will fail with Coverage generation minion exited abnormally. I propose that the Pitest tasks should behave similarly as the test task. As for backwards compatibility, this would cause e.g. CI builds that are currently failing to pass instead, but I have a hard time seeing that as a problem.

The current workaround I use is pretty hard-coded (and deals with configuration caching, hence it looks a little weird):

tasks.named<PitestTask>("pitest").configure {
  inputs.property("src", file("src/test"))
  onlyIf {
    (inputs.properties.get("src") as File).exists()
  }
}

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions