Skip to content

excludedGroups not working with jUnit @Tag annotation #1446

@jonathanmdr

Description

@jonathanmdr

In my project, I have separated classes for tests based on jUnit @Tag annotation specifying the following groups:

  • @Tag("unit")
  • @Tag("integration")

In my build.gradle file, I declared the following configuration:

plugins {
    id "info.solidsoft.pitest" version "1.19.0-rc.1"
}

group = "com.myproject.mutation"

pitest {
    pitestVersion = "1.21.0"
    junit5PluginVersion = "1.2.3"
    useClasspathFile = true
    targetClasses = [
        "com.myproject.**"
    ]
    targetTests = [
        "*Test"
    ]
    excludedClasses = [
        "*Configuration*",
        "*Exception*"
    ]
    excludedGroups = [
        "integration"
    ]
    reportDir = file("$rootDir/build/reports/pitest")
    timestampedReports = false
    threads = Runtime.getRuntime().availableProcessors()
    outputFormats = ["HTML", "XML"]
    mutationThreshold = 85
}

When I run the Pitest coverage report excluding my integration tests based on your groups, declared on the property excludedGroups, the execution runs normally, but all test classes that contain the @Tag("integration") are analyzed by Pitest, and these classes are not excluded from analysis and report.
For example, if I specify the same classes on the excludedClasses property, the classes are excluded normally, one by one, but using the group configuration, it does not work for me.

Why does it occur? Is it a problem with Pitest or a misconfiguration in my setup?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions