-
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
Summary view navigation #150
Conversation
* home: get back to index.html in basedir * <: back one page * \>: forward one page
@LorenzoBettini hi again, This should all run fine. I run all tests with my eclipse on Windows and Linux successfully, but for whatever reason on Windows mvn clean verify fails. Can you help me and tell me how this can be? |
You removed the PitNotifier and this breaks the synchronization I guess and makes the tests unreliable. |
Also removed checks in PitclipseUiRunnerTest for coverage generatetd, because there is no report generatetd anymore
@LorenzoBettini now they are reliable again in regard of waiting for the result. |
@LorenzoBettini I ran the test now multiple times on my Windows PC and they are always successful. Would you mind taking a look? |
You removed the PitNotifier.java and you removed a few checks in the existing tests... |
I only removed the part of the test, where empty results are expected and no html is created and the checks were to look at the html. Furthermore all checks which were present are working fine and only my test case is failing, but only online. Tested them on windows and linux multiple times. |
tests/org.pitest.pitclipse.ui.tests/src/org/pitest/pitclipse/ui/swtbot/PitNotifier.java
Outdated
Show resolved
Hide resolved
...s/org.pitest.pitclipse.ui.tests/src/org/pitest/pitclipse/ui/tests/PitclipseUiRunnerTest.java
Outdated
Show resolved
Hide resolved
...s/org.pitest.pitclipse.ui.tests/src/org/pitest/pitclipse/ui/tests/PitclipseUiRunnerTest.java
Outdated
Show resolved
Hide resolved
See my detailed comments |
but did you also run the Maven build? The failure you get in the CI is as follows:
|
Yes, I also ran maven. |
Usually when it works locally but not on the CI you have synchronization problems, maybe because the CI virtual environment is faster than your machine or vice-versa. Note that now you have a failure in the macOS CI environment, while before you had it in the Windows virtual environment. Once again, my suggestion is to keep the implementation extremely simple (e.g., don't keep track of the url string, just set it in the browser and let the buttons do the rest); similarly, tests must also be simple and reproducible. For example, don't rely on the browser to be reactive on changing pages. If I remember correctly there are lots of asynchronous operations going on there. Moreover, rely on the summary view automatically opened after running PIT, and don't try to open the view yourself: the browser might be out of date. Once again, if you want I can simplify both the implementation and try to implement the tests. |
What do you mean by don't keep track of the url string? Do you refer to the "Home" button? How would you test the navigation with the buttons, if you dont wait for the pages to load? The summary view itself gets disposed and the browser can't be out of date, because a new one gets created while opening. If you want to change things feel free, but I want to know why things are changed. So I can learn from that for the future. |
It seems the issue we were having with macOS were causing the reliability issues I was having. |
Or not ... @LorenzoBettini Is there any way to know which version of Eclipse and which Browser is used on the server site? |
bundles/org.pitest.pitclipse.ui/src/org/pitest/pitclipse/ui/view/PitView.java
Outdated
Show resolved
Hide resolved
bundles/org.pitest.pitclipse.ui/src/org/pitest/pitclipse/ui/view/PitView.java
Outdated
Show resolved
Hide resolved
bundles/org.pitest.pitclipse.ui/src/org/pitest/pitclipse/ui/view/PitView.java
Outdated
Show resolved
Hide resolved
bundles/org.pitest.pitclipse.ui/src/org/pitest/pitclipse/ui/view/PitView.java
Outdated
Show resolved
Hide resolved
...st.pitclipse.ui.tests/src/org/pitest/pitclipse/ui/behaviours/pageobjects/PitSummaryView.java
Outdated
Show resolved
Hide resolved
tests/org.pitest.pitclipse.ui.tests/src/org/pitest/pitclipse/ui/swtbot/PitResultNotifier.java
Outdated
Show resolved
Hide resolved
tests/org.pitest.pitclipse.ui.tests/src/org/pitest/pitclipse/ui/swtbot/PitResultNotifier.java
Outdated
Show resolved
Hide resolved
tests/org.pitest.pitclipse.ui.tests/src/org/pitest/pitclipse/ui/swtbot/ResultsParser.java
Outdated
Show resolved
Hide resolved
...pitest.pitclipse.ui.tests/src/org/pitest/pitclipse/ui/tests/AbstractPitclipseSWTBotTest.java
Outdated
Show resolved
Hide resolved
...pitest.pitclipse.ui.tests/src/org/pitest/pitclipse/ui/tests/PitclipsePitSummaryViewTest.java
Show resolved
Hide resolved
@JKutscha are you talking about the CI server? It should use the versions defined in the target plaform. Those should be the same as when you run Pitclipse from your IDE if your configured it with the TP. And regarding the browser, according to the documentation SWT embeds Safari on macOS. |
Tests are still not working, because the bot waits not for page loads?!
...pitest.pitclipse.ui.tests/src/org/pitest/pitclipse/ui/tests/PitclipsePitSummaryViewTest.java
Outdated
Show resolved
Hide resolved
It waited for the PitSummary (PitView) to have the HTML set and parses this HTML source. |
* own wait condition in PitResultNotifier * actions now have the same suffix and are no longer fields, was not necessary
@JKutscha @echebbi I've just created a companion PR #169 because I'd like the code to be analyzed by SonarCloud (which cannot currently be done for external PRs, see #161). I basically took the branch of @JKutscha and pushed to this repo (using the same branch name) and created a separate PR. I'd just like to experiment with such a mechanism... |
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.
As you see in the comments, I guess I should not review the tests since when #167 is merged this PR should be updated as well, is that right?
Besides that, I have a few concerns about uncovered lines (see the comments), see also https://sonarcloud.io/component_measures?id=org.pitest%3Aorg.pitest.pitclipse&metric=new_coverage&pullRequest=169&selected=org.pitest%3Aorg.pitest.pitclipse%3Abundles%2Forg.pitest.pitclipse.ui%2Fsrc%2Forg%2Fpitest%2Fpitclipse%2Fui%2Fview%2FPitView.java&view=list
Thank you!
bundles/org.pitest.pitclipse.ui/src/org/pitest/pitclipse/ui/view/PitView.java
Outdated
Show resolved
Hide resolved
bundles/org.pitest.pitclipse.ui/src/org/pitest/pitclipse/ui/view/PitView.java
Outdated
Show resolved
Hide resolved
bundles/org.pitest.pitclipse.ui/src/org/pitest/pitclipse/ui/view/PitView.java
Outdated
Show resolved
Hide resolved
bundles/org.pitest.pitclipse.ui/src/org/pitest/pitclipse/ui/view/PitView.java
Outdated
Show resolved
Hide resolved
...st.pitclipse.ui.tests/src/org/pitest/pitclipse/ui/behaviours/pageobjects/PitSummaryView.java
Show resolved
Hide resolved
.../org.pitest.pitclipse.ui.tests/src/org/pitest/pitclipse/ui/behaviours/pageobjects/Views.java
Outdated
Show resolved
Hide resolved
...g.pitest.pitclipse.ui.tests/src/org/pitest/pitclipse/ui/behaviours/steps/PitclipseSteps.java
Outdated
Show resolved
Hide resolved
...pitest.pitclipse.ui.tests/src/org/pitest/pitclipse/ui/tests/AbstractPitclipseSWTBotTest.java
Outdated
Show resolved
Hide resolved
@LorenzoBettini @echebbi please review this PR, if you find some time. From my part, this PR is ready. |
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.
I'm basically fine, but I left a few (cosmetic) comments, some questions, and one crucial change to be done.
bundles/org.pitest.pitclipse.ui/src/org/pitest/pitclipse/ui/view/PitView.java
Outdated
Show resolved
Hide resolved
/** | ||
* Set URL to blank and reset homeUrl, to have a clean browser after | ||
* creation<br> | ||
* <b>Needed</b> for testing purposes |
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.
This is not needed anymore by tests, isn't it?
Indeed it's private
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.
This is still needed.
It is called while creating and if an update()
has no file.
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.
Directly from the tests? By reflection?
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.
No, in the methods update(...)
and createPartControl(...)
.
bundles/org.pitest.pitclipse.ui/src/org/pitest/pitclipse/ui/view/PitView.java
Outdated
Show resolved
Hide resolved
...st.pitclipse.ui.tests/src/org/pitest/pitclipse/ui/behaviours/pageobjects/PitSummaryView.java
Show resolved
Hide resolved
...st.pitclipse.ui.tests/src/org/pitest/pitclipse/ui/behaviours/pageobjects/PitSummaryView.java
Show resolved
Hide resolved
...pitest.pitclipse.ui.tests/src/org/pitest/pitclipse/ui/tests/AbstractPitclipseSWTBotTest.java
Outdated
Show resolved
Hide resolved
...pitest.pitclipse.ui.tests/src/org/pitest/pitclipse/ui/tests/PitclipsePitSummaryViewTest.java
Outdated
Show resolved
Hide resolved
@echebbi Are you happy with the result and can we merge from your POV? |
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.
I'm fine with that... I only have a doubt on that Javadoc on the private method, but probably it's just my misunderstanding (when I read "Needed for tests" I mean a method, typically package-private, that is meant to be called directly by tests...)
@echebbi , if you're fine with the PR please merge it
@echebbi can I merge this or do you want to further review it? |
@LorenzoBettini I don't have the time to review it right now but @JKutscha addressed my previous comments so if it looks good to you please proceed |
Issue #62