Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider pitest task cacheability #67

Closed
szpak opened this issue Sep 6, 2017 · 7 comments · Fixed by #295
Closed

Consider pitest task cacheability #67

szpak opened this issue Sep 6, 2017 · 7 comments · Fixed by #295

Comments

@szpak
Copy link
Owner

szpak commented Sep 6, 2017

If sensible mark task with @CacheableTask. It would be especially useful with Gradle Build cache introduced in Gradle 4.

Potential issues. That annotation has been added in Gradle 3.0. Check Gradle 2 compatibility in runtime.

@C-Otto
Copy link
Contributor

C-Otto commented May 17, 2021

I'd say Gradle4/3/2 support isn't necessary nowadays.

@szpak
Copy link
Owner Author

szpak commented May 17, 2021

Nevertheless the cacheability is still trendy :-D.

@C-Otto Maybe you would like to take a look at the implementation options and eventually provide a PR? :-)

@SimY4
Copy link

SimY4 commented May 18, 2021

@szpak isn't adding an annotation not binary breaking? I mean, whether you have annotation in your classpath or not doesn't stop classes from loading. So, if you run a version of Gradle with APIs where this annotation is present - it will be taken in effect, and if not - it'll work as it works today.

@szpak
Copy link
Owner Author

szpak commented May 18, 2021

I believe that there were some other requirements for cacheability to be effective, however, as the project migrated to the property-based task parameters it might be fulfilled automatically. Still, there would need to be written a functional test confirming that in fact caching holds.

@davidburstrom
Copy link
Contributor

I've been using

tasks.named<PitestTask>("pitest").configure {
  outputs.cacheIf { true }
}

since December 2019 and have yet to see any issues related to caching. My thinking is that it's pretty safe to turn it on, with a functional test, and deal with any subsequent issues as regular bugs.

@szpak
Copy link
Owner Author

szpak commented Sep 12, 2021

Thanks for your comment. The inputs/ooutputs migration to the Property-based replacement could do the trick. Would you like to add a functional test confirming that the second execution is cached (to verify it now and keep it as a regression test)?

davidburstrom added a commit to davidburstrom/gradle-pitest-plugin that referenced this issue Sep 12, 2021
@davidburstrom
Copy link
Contributor

Done!

davidburstrom added a commit to davidburstrom/gradle-pitest-plugin that referenced this issue Sep 12, 2021
davidburstrom added a commit to davidburstrom/gradle-pitest-plugin that referenced this issue Sep 12, 2021
@szpak szpak added this to the 1.7.0 milestone Sep 13, 2021
@szpak szpak closed this as completed in 2482cf2 Sep 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants