-
Notifications
You must be signed in to change notification settings - Fork 17
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
Mutator configuration #152
Mutator configuration #152
Conversation
Added fields for text, that it can be used in tests
We used almost the same Strings in the tests as in the creation of the preferences itself. Now all are using the same Strings. Show always the Package Explorer when selecting something to be sure. (Sped up the tests locally for me a lot.)
* combined MutatorGroups and Mutators, because they are basically the same and pit handles it similar * using reflection to get all ids of the mutators from pit
* if the custom mutators option is selected for the first time, the default mutators are selected
* exclude main group from mutators now
Also disable run and apply, if the selection is not valid
They were added within the last commits and are also a group listet on pitest.org
… into Mutator_configuration
bundles/org.pitest.pitclipse.core/src/org/pitest/pitclipse/core/preferences/PitPreferences.java
Outdated
Show resolved
Hide resolved
...pse.ui.tests/src/org/pitest/pitclipse/ui/tests/PitclipseRunConfigurationMutationTabTest.java
Outdated
Show resolved
Hide resolved
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.
Besides a few questions and small changes, I left a few hints that in my opinion might be the cause of flaky tests
bundles/org.pitest.pitclipse.core/src/org/pitest/pitclipse/core/Mutators.java
Show resolved
Hide resolved
bundles/org.pitest.pitclipse.launch.ui/src/org/pitest/pitclipse/launch/ui/PitArgumentsTab.java
Outdated
Show resolved
Hide resolved
...les/org.pitest.pitclipse.launch.ui/src/org/pitest/pitclipse/launch/ui/PitLaunchShortcut.java
Outdated
Show resolved
Hide resolved
bundles/org.pitest.pitclipse.launch.ui/src/org/pitest/pitclipse/launch/ui/PitMutatorsTab.java
Outdated
Show resolved
Hide resolved
...test.pitclipse.launch/src/org/pitest/pitclipse/launch/config/LaunchConfigurationWrapper.java
Outdated
Show resolved
Hide resolved
...pitest.pitclipse.ui.tests/src/org/pitest/pitclipse/ui/tests/AbstractPitclipseSWTBotTest.java
Outdated
Show resolved
Hide resolved
...pse.ui.tests/src/org/pitest/pitclipse/ui/tests/PitclipseRunConfigurationMutationTabTest.java
Show resolved
Hide resolved
...pse.ui.tests/src/org/pitest/pitclipse/ui/tests/PitclipseRunConfigurationMutationTabTest.java
Show resolved
Hide resolved
...pse.ui.tests/src/org/pitest/pitclipse/ui/tests/PitclipseRunConfigurationMutationTabTest.java
Outdated
Show resolved
Hide resolved
bundles/org.pitest.pitclipse.core/src/org/pitest/pitclipse/core/preferences/PitPreferences.java
Outdated
Show resolved
Hide resolved
The reason why I would like to get this merged first, is that on my red hat pc all tests tend to fail now sometimes and this is regarded to the fixes which are done there. I also got to the point of waiting for the shell to be active, but this alone does not always fix the problem for me. |
Looks like we're working (and probably found a fix) for flaky UI tests... I'd also like to have full coverage on the code of this PR and it looks like I have to do that myself on my branch |
That's what I understood from the comments; thanks for your insights about why KDE might have brought the bugs to show up.
You sound a bit annoyed, I'm sorry if you feel like the only one who cares about code coverage. Do you have any update on #161? It would help monitoring code coverage without having to keep another branch synchronized and to go back and forth between two PRs. |
48e2c74
to
3002ac3
Compare
@JKutscha it looks like the fix I proposed highly reduced the failure of those UI tests, but not completely. I pushed another commit that hopefully fixes the problem for good, f85742b Note that this really forces the activation of the Eclipse workbench, because when the test fails it's because the current shell is not active at all. That's why, also in #175 (comment), I was suggesting to force the activation of the workbench programmatically like I've just done. |
The same was happening to me and not just in the UI tests for this newly created test cases. This was the reason why I created #175 and don't want to rely on the focus at all while getting the menu. |
So you mean that code like the following one SWTBotMenuHelper menuHelper = new SWTBotMenuHelper();
menuHelper.findMenu(...); does not need an active shell at all? |
Yours would, but not this one: SWTBotMenuHelper menuHelper = new SWTBotMenuHelper();
menuHelper.findWorkbenchMenu(...); It would still require the workbench to be opened, but would not need to shift the focus. |
I don't want to speak for @echebbi but your solution introduced a fixed hardcoded timeout, which in general is to avoid. I'd remove that mechanism and then if @echebbi wanted it back we could re-introduce that, but I'm pretty sure that's unlikely ;) |
@JKutscha in my branch the part that needs to have full coverage is this one: private class UpdateDialogOnCurrentMutatorGroupChanged extends SelectionAdapter {
@Override
public void widgetSelected(SelectionEvent event) {
final String old = currentMutatorGroup;
currentMutatorGroup = (String) event.widget.getData();
if (((Button) event.widget).getSelection() && !old.equals(currentMutatorGroup)) {
updateLaunchConfigurationDialog();
disableTableIfUnused();
}
}
} The if is marked as 1 of 4 branches missed, and I'm not able to understand what is still to be tested... |
I will take a look right now. |
@JKutscha in this code private class UpdateDialogOnCurrentMutatorGroupChanged extends SelectionAdapter {
@Override
public void widgetSelected(SelectionEvent event) {
final String old = currentMutatorGroup;
currentMutatorGroup = (String) event.widget.getData();
if (((Button) event.widget).getSelection() && !old.equals(currentMutatorGroup)) {
updateLaunchConfigurationDialog();
disableTableIfUnused();
}
}
} I don't see how |
This looks good to me on your branch.
I looked into your code and if everything works as expected I think your condition will work just fine. |
@LorenzoBettini Should I cherry-pick your commits or how should we continue this PR? |
If you want to further work on this branch you should merge yours with mine. Otherwise, if you agree with the current version of my branch, in particular if you agree that the additional check of the selection is useless, I can simply go on merging my PR. |
I‘m fine, if you merge your PR. |
Issue #114