Skip to content

pitestDiff reports no mutant when the project directory contains a comma #30

Done

Description

@vlsi

In a Gradle project whose directory path contains a comma, pitestDiff mutates nothing and reports that the changed lines have no bytecode, although the same project in a directory without a comma gets its mutants. cribro 1.2.0, Gradle 9.8.2, OpenJDK 21.0.9, macOS 26.5.1 (aarch64).

The same two-commit project, copied into $TMPDIR/cribro-comma-repro/plain and $TMPDIR/cribro-comma-repro/a,b, run with ./gradlew --quiet pitestDiff -Pcribro.diffBase=HEAD~1:

== plain
Mutation testing of changed lines against HEAD~1 (79b26590b), all tests
  5 mutants on 1 of 1 changed line: 2 killed, 2 survived, 1 not reached by any test
  ...
== a,b
Mutation testing of changed lines against HEAD~1 (79b26590b), all tests
  no mutant: no changed line has bytecode PIT may mutate

build/reports/pitest-diff/pit.log in a,b:

12:13:47 PIT >> INFO : Created 0 mutation test units in pre scan
12:13:47 PIT >> WARNING : No mutations found. This probably means there is an issue with either the supplied classpath or filters.

The project: settings.gradle applies io.github.cribro-dev.cribro 1.2.0, build.gradle is java-library with JUnit Jupiter 5.14.4 and test { useJUnitPlatform() }, the base commit is empty, and the second commit adds src/main/java/demo/Calc.java (public class Calc { public static int max(int a, int b) { if (a > b) { return a; } return b; } }) and a test that calls Calc.max(2, 1).

Expected: in the a,b directory pitestDiff reports the same five mutants as in plain. Where a path cannot be passed to PIT, the task fails with a message that names the path, rather than reporting that the changed lines have no bytecode, which is false for Calc.java.

Cause, from reading the code, not tested. PIT splits --mutableCodePaths at commas (OptionsParser, withValuesSeparatedBy(',')), so .../a,b/build/classes/java/main reaches it as two entries, neither of which matches the class directory. #18 is the same splitting for --jvmArgs; #29 adds the module's jar as a code path and does not change this.

Activity

  1. added
    bug
    on Nov 30, 2026
  2. added a commit that references this issue on Dec 1, 2026
    e84e750
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions