- Notifications
You must be signed in to change notification settings - Fork18
[WIP] Upgrade Pitest to 1.15.8#224
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:master
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
@echebbi I created#226 and build is green. Please have a look and merge it if you're OK with that. I tried to cherry pick some of your commits but of you course you should expect merging conflicts. I wonder if some of the failures I see in your builds (unbound Java 1.8 classpath container) might be due to Java 21 not supporting Java 8 anymore. In any case, I think the main build should be with Java 17 and we could have another build testing that, at least the runtime tests are green. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
bundles/org.pitest.pitclipse.core/src/org/pitest/pitclipse/core/Mutators.java OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
bundles/org.pitest.pitclipse.core/src/org/pitest/pitclipse/core/Mutators.java OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
...rg.pitest.pitclipse.runner/src/org/pitest/pitclipse/runner/results/summary/ClassSummary.java OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
....pitclipse.runner/src/org/pitest/pitclipse/runner/results/summary/SummaryResultListener.java OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
...t.pitclipse.ui.tests/src/org/pitest/pitclipse/ui/behaviours/pageobjects/DurationElapsed.java OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
....ui.tests/src/org/pitest/pitclipse/ui/behaviours/pageobjects/PitMutationsViewPageObject.java OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
....ui.tests/src/org/pitest/pitclipse/ui/behaviours/pageobjects/PitMutationsViewPageObject.java OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
...test.pitclipse.ui.tests/src/org/pitest/pitclipse/ui/tests/PitclipseMultipleProjectsTest.java OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
// run test and confirm result is as expected | ||
PAGES.getRunMenu().runPitWithConfiguration(TEST_CONFIG_NAME); | ||
coverageReportGenerated(TESTED_CLASSES,COVERAGE,1,84,1); | ||
coverageReportGenerated(TESTED_CLASSES,COVERAGE,5,20,1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
We lose all these mutators because of the mutators removed by default in PIT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Looks like it, yes. We did lose a lot of mutations operators (seeMutations.java,MutatorApiOfPitTest.java andthe list of research mutators). That being said I believe we should take some time to make sure I didn't miss something while upgrading.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
@echebbi So creating a new bundle forhttps://github.com/pitest/pitest-rv-plugin and adding it to our distribution would bring the old mutators back?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Yes, just like we did for thepitest-junit5
plugin. Do you think that we should integrate thepitest-rv
plugin after all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
@echebbi maybe we should/could. I'm a bit worried by the fact that people using Pitclipse would have more mutators than those using Maven and ignoring the newpitest-rv
, but maybe we can rely on them knowing the Maven plugin as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
By default we run Pitest's DEFAULT mutator group so our mutators set would still be the same as a bare Pitest configuration.pitest-rv
's mutators would only be exposed through the preferences/configuration pages which feels fair to me.
We can even add a column to the mutators table that explicitely states the origin of each mutator:
Name | Description | Contributor |
---|---|---|
Conditionals Boundary | Replaces the relational operators <, <=, >, >= | pitest |
Negation | Replaces any use of a numeric variable (local variable, field, array cell) with its negation | pitest-rv-plugin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
@echebbi yes that'd be useful; but would such information be easily (automatically) retrieved and easy to maintain?
Moreover, withpitest-rv
we would restore the "old defaults" or not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
would such information be easily (automatically) retrieved and easy to maintain?
It might be possible to retrieve/infer the information through reflection. My intuition is that since we have access to theMethodFactoryFactory
instances (each mutation operator is implemented as a child ofMethodMutatorFactory
) we should be able to get the info with something along the lines of:
// maps plugin ID to the name we want to display in the table//Map<String,String>pluginIdToContributorName =Map.of("org.pitest","pitest","org.pitest.pitest-rv-plugin","pitest-rv");Collection<MethodMutatorFactory>mutators =ServiceLoader.load(MethodMutatorFactory.class,IsolationUtils.getContextClassLoader());for (MethodMutatorFactorymutator :mutators) {//// retrieve the contributor through reflection//Bundlebundle =FrameworkUtil.getBundle(mutator.getClass());//// update our 'Mutators' enum with the contributor name//StringcontributorName =pluginIdToContributorName.get(bundle.getBundleId());Mutators.valueOf(mutator.getName()).setContributorName(contributorName);}
Or, if we want to be really extensible it should be possible to craft a solution based on a custom extension point so that external plug-ins can provide new mutators without having to change a single piece of code in Pitclipse's core. That would require some refactoring though so I believe that such a work would deserve its own PR.
Moreover, with pitest-rv we would restore the "old defaults" or not?
We wouldn't because this group is not related to the research operators and has been completely removed. We may want to somehow supportthe groups related to research operators though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
@echebbi thanks for the clarification, especially about the old defaults, which are now gone for good. I thought thepitest-rv
was related to that so I was reluctant to addpitest-rv
right away because that would have required to undo the removal of old defaults, but it's not like that :)
So, shall we addresspitest-rv
in a new PR and go on with this one?
I would also try to build with Java 21 and have a UI test with Java 21, but we can do that in another PR as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
shall we address
pitest-rv
in a new PR and go on with this one?
@LorenzoBettini fine by me!
echebbi commentedApr 1, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Finally a green build 🎉@LorenzoBettini thanks for your help :) I'm not 100% confident regarding the new mutators/groups set and the current results though. I think we should take some time to make sure everything is ok before merging. |
@echebbi shall we merge this and release? |
1 similar comment
@echebbi shall we merge this and release? |
Uh oh!
There was an error while loading.Please reload this page.
Closes#221 by upgrading Pitest to 1.15.8
This upgrade comes with several API breaking changes. A notable change is the removal of several "research-oriented" mutators from PIT and which are now wrapped in a dedicated PIT plug-in. Seehcoles/pitest#993 for the changes and#221 (comment) for our decision to discard those mutators for now.