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

Summary view navigation #150

Merged
merged 32 commits into from
Aug 7, 2021
Merged

Conversation

JKutscha
Copy link
Contributor

@JKutscha JKutscha commented Jul 16, 2021

Issue #62

  • Added navigation via Buttons in Summary view

JKutscha and others added 3 commits July 16, 2021 12:57
@JKutscha
Copy link
Contributor Author

@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?

@LorenzoBettini
Copy link
Collaborator

You removed the PitNotifier and this breaks the synchronization I guess and makes the tests unreliable.

JKutscha added 2 commits July 18, 2021 09:35
Also removed checks in PitclipseUiRunnerTest for coverage generatetd,
because there is no report generatetd anymore
@JKutscha
Copy link
Contributor Author

You removed the PitNotifier and this breaks the synchronization I guess and makes the tests unreliable.

@LorenzoBettini now they are reliable again in regard of waiting for the result.

@JKutscha
Copy link
Contributor Author

@LorenzoBettini I ran the test now multiple times on my Windows PC and they are always successful. Would you mind taking a look?

@LorenzoBettini
Copy link
Collaborator

You removed the PitNotifier.java and you removed a few checks in the existing tests...
Please don't change the architecture of the existing testing infrastructure...
if you can't succeed in testing the new scenarios I'll try to write the tests myself on top of your new feature, but please first restore the existing working tests

@JKutscha
Copy link
Contributor Author

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.

@LorenzoBettini
Copy link
Collaborator

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.

See my detailed comments

@LorenzoBettini
Copy link
Collaborator

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.

but did you also run the Maven build?

The failure you get in the CI is as follows:

Failures: 
  PitclipsePitSummaryViewTest.navigateWithButtons:60 
Expected: a string ending with "index.html"
     but: was "file:///D:/a/pitclipse/pitclipse/tests/org.pitest.pitclipse.ui.tests/target/work/data/.metadata/.plugins/org.pitest.pitclipse.core/html_results/202107180752/foo.bar/Foo.java.html"

@JKutscha
Copy link
Contributor Author

Yes, I also ran maven.

@JKutscha
Copy link
Contributor Author

Yes, I also ran maven.

grafik

@LorenzoBettini
Copy link
Collaborator

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.

@JKutscha
Copy link
Contributor Author

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.

@JKutscha JKutscha requested a review from LorenzoBettini July 22, 2021 14:56
@JKutscha
Copy link
Contributor Author

It seems the issue we were having with macOS were causing the reliability issues I was having.

@JKutscha
Copy link
Contributor Author

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?

@echebbi
Copy link
Collaborator

echebbi commented Jul 24, 2021

Is there any way to know which version of Eclipse and which Browser is used on the server site?

@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.

@JKutscha JKutscha marked this pull request as draft July 24, 2021 09:46
Tests are still not working, because the bot waits not for page loads?!
@JKutscha
Copy link
Contributor Author

IIRC until now the tests were waiting for the Mutations view to send an event telling it received the results from Pit. Your mechanism waits for mutations results to be available, assumes that the view is updated then immediately moves on. I want to make sure I understand correctly and that there's no synchronization issues (e.g., when the view has a lot of mutations to display).

It waited for the PitSummary (PitView) to have the HTML set and parses this HTML source.

JKutscha added 4 commits July 29, 2021 09:28
* own wait condition in PitResultNotifier
* actions now have the same suffix and are no longer fields, was not necessary
@LorenzoBettini
Copy link
Collaborator

@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...

Copy link
Collaborator

@LorenzoBettini LorenzoBettini left a 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!

@LorenzoBettini LorenzoBettini mentioned this pull request Aug 2, 2021
@JKutscha
Copy link
Contributor Author

JKutscha commented Aug 3, 2021

@LorenzoBettini @echebbi please review this PR, if you find some time. From my part, this PR is ready.

Copy link
Collaborator

@LorenzoBettini LorenzoBettini left a 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.

/**
* Set URL to blank and reset homeUrl, to have a clean browser after
* creation<br>
* <b>Needed</b> for testing purposes
Copy link
Collaborator

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

Copy link
Contributor Author

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.

Copy link
Collaborator

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?

Copy link
Contributor Author

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(...).

@JKutscha JKutscha requested a review from LorenzoBettini August 4, 2021 13:02
@JKutscha
Copy link
Contributor Author

JKutscha commented Aug 4, 2021

Mostly ask for cosmetic changes. I will also take the time to review the code from the IDE. I mostly want to check the way you changed the synchronization mechanism.

@echebbi Are you happy with the result and can we merge from your POV?

Copy link
Collaborator

@LorenzoBettini LorenzoBettini left a 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

@LorenzoBettini
Copy link
Collaborator

@echebbi can I merge this or do you want to further review it?

@echebbi
Copy link
Collaborator

echebbi commented Aug 6, 2021

@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

@echebbi echebbi merged commit 157167f into pitest:master Aug 7, 2021
@JKutscha JKutscha deleted the Summary_View_Navigation branch August 9, 2021 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants