-
Notifications
You must be signed in to change notification settings - Fork 93
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
Show progress when searching test methods in JUnit run configuration #653 #675
Show progress when searching test methods in JUnit run configuration #653 #675
Conversation
4ade735
to
d98100b
Compare
Random test failure of |
5820765
to
7ed50be
Compare
7ed50be
to
00c49ff
Compare
Hello all, I just rebased and solved the conflicts to ease the review. |
@fedejeanne Will take a look |
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.
Tried it out. Works well, but have the following comment.
I used your delay code to be able to cancel a search. When a search is cancelled, it would be helpful if the error message states that it cannot find method after cancelled search. After cancelling, I believe the search button for method should remain active and if pressed, should restart the search. Otherwise, after cancelling a search a user has no options other than to close without saving. I had a case where it was running all tests and after cancelling it left the Run button active because it did not have to do the verification which is fine.
51bcb12
to
b0ac9ea
Compare
Hi @fedejeanne Thanks for the changes. Could you take a look at the test failures? Monday is cut-off for M3 so if we can't get this in by then, it will have to wait until 4.30 M1. |
There was a fix recently in jdt.ui for Junit 4/5 failures. Please rebase on master (don't merge) and do a force push if needed. |
…e-jdt#653 Move the logic to search for test methods from `JUnitLaunchConfigurationTab` to `TestSearchEngine::findTestMethods`. Extract the whole logic for caching the results into `TestMethodsCache` (new class) and do the whole searching and caching more efficiently i.e. only when necessary and showing the progress with a monitor by using `ModalContext::run` Fixes eclipse-jdt#683 Contributes to eclipse-jdt#653
b0ac9ea
to
169cc10
Compare
I made the rebase for you. I had a similar problem with a PR and rebasing fixed the test failures. |
Thanks @fedejeanne I made a couple tweaks (no logging interrupt exception and fixing error message to not spit out null when the testmethods field not filled in). Merged for M3. |
Thank you very much for the review, changes and merging @jjohnstn ! And I'm glad to see that it's a noteworthy change! |
@fedejeanne With regards to noteworthy, would you like to create a N&N PR for this in eclipse-platform/www.eclipse.org-eclipse.git if you haven't already? If you're not sure, I can do it for you. |
My pleasure! |
…clipse-jdt#653 (eclipse-jdt#675) * Show progress when searching test methods in run configuration eclipse-jdt#653 Move the logic to search for test methods from `JUnitLaunchConfigurationTab` to `TestSearchEngine::findTestMethods`. Extract the whole logic for caching the results into `TestMethodsCache` (new class) and do the whole searching and caching more efficiently i.e. only when necessary and showing the progress with a monitor by using `ModalContext::run` Fixes eclipse-jdt#683 Contributes to eclipse-jdt#653 Co-authored-by: Jeff Johnston <[email protected]>
…clipse-jdt#653 (eclipse-jdt#675) * Show progress when searching test methods in run configuration eclipse-jdt#653 Move the logic to search for test methods from `JUnitLaunchConfigurationTab` to `TestSearchEngine::findTestMethods`. Extract the whole logic for caching the results into `TestMethodsCache` (new class) and do the whole searching and caching more efficiently i.e. only when necessary and showing the progress with a monitor by using `ModalContext::run` Fixes eclipse-jdt#683 Contributes to eclipse-jdt#653 Co-authored-by: Jeff Johnston <[email protected]>
What it does
Move the logic to search for test methods from
JUnitLaunchConfigurationTab
toTestSearchEngine::findTestMethods
. Extract the whole logic for caching the results intoTestMethodsCache
(new class) and do the whole searching and caching more efficiently i.e. only when necessary and showing the progress with a monitor by usingModalContext::run
Fixes #683
Contributes to #653
This PR shows a progress indicator when searching for test methods in a class (which may happen when one opens a JUnit run configuration). The progress indicator looks like this when you first open the Run configurations and a JUnit configuration is selected:
... and like this when you select or edit an existing JUnit run configuration and force a new search for test methods (the progress indicator appears at the bottom of the Run configurations dialog).
How to test
The main goal is to open some Run configurations for JUnit tests and move between them, letting them search the necessary test methods.
All of the following must hold true while testing:
A
in projectB
and forJUnit5
then changing to classA2
might trigger a search (ifA2
exists) but setting the class back toA
should not trigger another search.A small hack to help testing
If you need more time to see the progress dialog/bar then you can modify
TestSearchEngine::collectMethodNames
like this:How did I test?
These are all the stuff I did and tried when testing:
Browse...
andSearch
buttons to change the project and the class in the run configurationAuthor checklist