szpak / gradle-pitest-plugin

Gradle plugin for PIT Mutation Testing
http://gradle-pitest-plugin.solidsoft.info/
211 stars 57 forks source link

pitest build cache not working if the absolute path changes #314

Closed SidB3 closed 1 year ago

SidB3 commented 1 year ago

Steps to reproduce:

This causes CI builds to rerun pitest for every build when there are no code updates

Additional information: Gradle version - 7.5

Attaching sample project to run the pitest task sample_building_java_applications-kotlin-dsl.zip

Running from two different folders produces two different cache keys

Stored cache entry for task ':app:pitest' with cache key 4668219a852060cc33eb7756bcde035c
Stored cache entry for task ':app:pitest' with cache key 05465e68091575f0fe62c6e51188307c

From my cursory knowledge of gradle plugin development, I see no issues in the PitestTask.groovy file. All file properties are annotated with @PathSensitive(PathSensitivity.RELATIVE)

C-Otto commented 1 year ago
Task ':application:pitest' is not up-to-date because:
  Value of input property 'additionalClasspathFilePath' has changed for task ':application:pitest'
  Value of input property 'defaultFileForHistoryDataPath' has changed for task ':application:pitest'
C-Otto commented 1 year ago

I don't know a whole lot about gradle plugins, but it seems these two methods/properties are not in use? I managed to get things working by simply removing them.

szpak commented 1 year ago

@C-Otto Looking at the field level, there is:

    //Workaround with @Internal for "Unable to store input properties for task" - https://github.com/gradle/gradle/issues/12351
    @Internal
    final RegularFileProperty additionalClasspathFile

And https://github.com/gradle/gradle/issues/12351 seems to be still open, so @SidB3 change in #315 seems to be more accurate.

szpak commented 1 year ago

Implemented in #315 and available in 1.9.0.