Bug 298603 - [JUnit] Add a filter for ignored tests
Summary: [JUnit] Add a filter for ignored tests
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.5.1   Edit
Hardware: All All
: P3 enhancement with 1 vote (vote)
Target Milestone: 4.5 M7   Edit
Assignee: Andrej Zachar CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-29 06:25 EST by Ulli Hafner CLA
Modified: 2015-04-28 01:58 EDT (History)
6 users (show)

See Also:
noopur_gupta: review+


Attachments
Patch for filtering ignored tests (24.91 KB, patch)
2014-02-19 00:41 EST, Andrej Zachar CLA
no flags Details | Diff
Patch for filtering ignored tests against master branch (25.53 KB, patch)
2014-02-19 00:45 EST, Andrej Zachar CLA
no flags Details | Diff
Patch for filtering ignored tests against master branch with API baseline fixes (21.42 KB, patch)
2014-02-20 06:30 EST, Andrej Zachar CLA
no flags Details | Diff
Add a filter for ignored tests (final) (52.46 KB, patch)
2014-04-09 22:37 EDT, Andrej Zachar CLA
no flags Details | Diff
Patch (14.43 KB, patch)
2015-03-27 08:31 EDT, Noopur Gupta CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ulli Hafner CLA 2009-12-29 06:25:06 EST
Build Identifier: M20090917-0800

The JUnit view has a filter to show only failures. It would be nice to have an additional filter (toolbar and menu) that shows only the ignored tests. Otherwise it is very hard to find the ignored tests in a large test suite.

Reproducible: Always
Comment 1 Markus Keller CLA 2010-01-08 12:47:58 EST
> very hard to find the ignored tests in a large test suite

For now, you can do a search for references to the 'Ignore' annotation.
Comment 2 Philippe Couton CLA 2011-08-18 09:59:11 EDT
True, but this is painful and slow on large code bases. You have to start a new search, and then you have to explore the search results, and next you have to open the file to read the reason in the annotation argument. Very counter-productive.

On an other way, having a filter in the JUnit view allowing you to quickly show the ignored tests with the associated reason would be a great benefit!
Comment 3 Andrej Zachar CLA 2014-02-12 13:20:34 EST
Hello All,
I have implemented this feature and is available in the branch show_ignored_tests at https://github.com/azachar/org.eclipse.jdt.junit4.runtime/tree/show_ignored_tests

The feature is based on Branch R4_3_1.

Please let me know if there is need any additional work. 

PS: I would like to provide tests for it as well, but I am not sure, where are similar tests implemented for show failures only. If you can point it out, I will provide tests as well.



Best regards,
Andrej
Comment 4 Dani Megert CLA 2014-02-13 06:37:55 EST
(In reply to Andrej Zachar from comment #3)
> Hello All,
> I have implemented this feature and is available in the branch
> show_ignored_tests at
> https://github.com/azachar/org.eclipse.jdt.junit4.runtime/tree/
> show_ignored_tests
> 
> The feature is based on Branch R4_3_1.

Can you rebase the fix on 'master' and then attach a patch here? Make sure you've added your credentials to the copyright notices. When attaching the patch please state the following:

"This contribution complies with http://www.eclipse.org/legal/CoO.php"


> PS: I would like to provide tests for it as well, but I am not sure, where
> are similar tests implemented for show failures only. If you can point it
> out, I will provide tests as well.

We don't have UI tests for this.
Comment 5 Andrej Zachar CLA 2014-02-14 05:47:42 EST
Hello Dani, 
I will rebase it and I will let you know as soon as possible.
Yes this contribution complies  http://www.eclipse.org/legal/CoO.php

PS: Are there any other UI tests that I can use as an example one for this particular case? Thank you!

Cheers,
Andrej
Comment 6 Andrej Zachar CLA 2014-02-19 00:41:34 EST
Created attachment 240099 [details]
Patch for filtering ignored tests

Hello, 
here is the patch for the filtering of ignored tests against today's master.

Cheers,
Andrej
Comment 7 Andrej Zachar CLA 2014-02-19 00:45:37 EST
Created attachment 240100 [details]
Patch for filtering ignored tests against master branch

Here is the correct patch.
Comment 8 Andrej Zachar CLA 2014-02-20 06:30:52 EST
Created attachment 240147 [details]
Patch for filtering ignored tests against master branch with API baseline fixes

Hello!

I have enabled API checking that was previously ignored and I have fixed some small issues with versions in the java doc. For applying patch it could be easier to use this patch.

Also I have set error warning for missing java 1.5 to warning otherwise I was unable to compile it on my computer. I hope it won't be a big deal to skip it. By any chance why it is restricted to error and not just to warning. On a mac it is quite hard to install java 1.5 at this time...

Anyway the patch was made from my fork of Luna at https://github.com/azachar/org.eclipse.jdt.ui/tree/master-show-skipped-tests 

Here is also available branch for backporting to Kepler 4.3.1. if one is interested in: https://github.com/azachar/org.eclipse.jdt.ui/tree/R4_3_1-show-skipped-tests


Best regards,
Andrej
Comment 9 Andrej Zachar CLA 2014-02-27 12:12:25 EST
For the simplicity I have created a pull request 
https://github.com/eclipse/eclipse.jdt.ui/pull/4

So now it could be quite easy to merge. This time there are no additional changes only the source code. Warnings about the java 1.5 i left untouched.
Comment 10 Andrej Zachar CLA 2014-03-06 13:46:34 EST
Hello, 
In the mean time I have added a new feature:

Assumptions failures are shown within the ignored tests.

It is still part of the open pull request:

https://github.com/eclipse/eclipse.jdt.ui/pull/4


Best regards,
Andrej
Comment 11 Martin Mathew CLA 2014-04-09 00:35:10 EDT
Hello Andrej,
Is the patch mentioned in comment 8 the final patch? Kindly make sure in all the modified files the Copyright year and the contribution details are updated. Go through https://wiki.eclipse.org/JDT_UI/How_to_Contribute before creating a patch.

Manju
Comment 12 Andrej Zachar CLA 2014-04-09 21:21:51 EDT
Hello Manju, 
the latest code to integrate is located at the open pull request:

https://github.com/eclipse/eclipse.jdt.ui/pull/4


So the comment-8 is outdated.


Please let me know if this is ok.

PS:Contribution is mentioned everywhere, the implementation year is unfortunately 2013. If you want I can change it. No problem.


Best regards,
Andrej
Comment 13 Martin Mathew CLA 2014-04-09 21:48:14 EDT
(In reply to Andrej Zachar from comment #12)
> Hello Manju, 
> the latest code to integrate is located at the open pull request:
> 
> https://github.com/eclipse/eclipse.jdt.ui/pull/4
Kindly attach the latest fix as a patch to this bug. When you attach the latest patch mark the other patches as obsolete.
 
> PS:Contribution is mentioned everywhere, the implementation year is
> unfortunately 2013. If you want I can change it. No problem.
The Copyright year of all modified files should be updated to the current year. e.g. Copyright (c) 2000, 2014
Also you have to add you details and the bug details under "Contributors:" in each of the modified files.
e.g.
Andrej Zachar <andrej@chocolatejar.eu> - [JUnit] Add a filter for ignored tests
- https://bugs.eclipse.org/bugs/show_bug.cgi?id=298603
Comment 14 Andrej Zachar CLA 2014-04-09 22:18:56 EDT
Hello Manju, 
here is the updated (including updated year 2014) patch to download, unfortunately I cannot mark the existing attachment patch as obsolete when I am providing a link like this

https://github.com/eclipse/eclipse.jdt.ui/pull/4.patch

If you want to see changed files look here https://github.com/eclipse/eclipse.jdt.ui/pull/4/files


The patch is based on today's master.

Cheers,
Andrej

PS: Some people provided sucessfully their patches as pull requests via github.
I am just wondering - was it just a private initiative? Or this will be a standard way to provide patch too?
Comment 15 Martin Mathew CLA 2014-04-09 22:23:21 EDT
(In reply to Andrej Zachar from comment #14)
> Hello Manju, 
> here is the updated (including updated year 2014) patch to download,
> unfortunately I cannot mark the existing attachment patch as obsolete when I
> am providing a link like this
> 
> https://github.com/eclipse/eclipse.jdt.ui/pull/4.patch
> 
> If you want to see changed files look here
> https://github.com/eclipse/eclipse.jdt.ui/pull/4/files
> 
> 
> The patch is based on today's master.
I would prefer a ".patch" file attached to this bug(same as you did in comment 8) and not a link to github.
Comment 16 Andrej Zachar CLA 2014-04-09 22:37:50 EDT
Created attachment 241808 [details]
Add a filter for ignored tests (final)

Hello Manju,
here is the final patch against today's master :)

Best regards,
Andrej
Comment 17 Martin Mathew CLA 2014-04-11 03:24:49 EDT
Comment on attachment 241808 [details]
Add a filter for ignored tests (final)

I am unable to apply this patch. On opening the patch in text editor i can see lot of unnecessary texts.  To create a clean patch from your development workspace, select the modified files > right click > Team > Create Patch. Once you create it test by applying the same patch on a clean development workspace. Also before creating the patch, compare each of the modified files against head to make sure only necessary changes are part of the file.
Comment 18 Andrej Zachar CLA 2014-04-13 19:23:36 EDT
Hello Manju, 
I am just asking myself, in time of tools like git -  Do I still need to generate a patch via Eclipse... I have already created the patch via github, but it seems that it doesn't work for you...


Isn't it easier to use just git and merge / squish my changes from my repo https://github.com/azachar/org.eclipse.jdt.ui.git branch master-show-skipped-test that is up-to-date with the today's eclipse master?

I did this changes a while ago I do not want to make any mistake by creating a wrong patch via eclipse. The change is not just in one plugin or file, so it isn't a simple operation. 

Also if other people can use pull request directly from github within eclipse jdt ui (https://github.com/eclipse/eclipse.jdt.ui/pulls?direction=desc&page=1&sort=created&state=closed) why it is not possible to do it in my case too?


Thank you for your answer.

Best regards,
Andrej
Comment 19 Dani Megert CLA 2014-04-14 05:25:18 EDT
(In reply to Andrej Zachar from comment #18)
> Hello Manju, 
> I am just asking myself, in time of tools like git -  Do I still need to
> generate a patch via Eclipse... I have already created the patch via github,
> but it seems that it doesn't work for you...
> 
> 
> Isn't it easier to use just git and merge / squish my changes from my repo
> https://github.com/azachar/org.eclipse.jdt.ui.git branch
> master-show-skipped-test that is up-to-date with the today's eclipse master?
> 
> I did this changes a while ago I do not want to make any mistake by creating
> a wrong patch via eclipse. The change is not just in one plugin or file, so
> it isn't a simple operation. 
> 
> Also if other people can use pull request directly from github within
> eclipse jdt ui
> (https://github.com/eclipse/eclipse.jdt.ui/
> pulls?direction=desc&page=1&sort=created&state=closed) why it is not
> possible to do it in my case too?

JDT did not pull those AFAIK. We either take a patch or a Gerrit change. For more details see
http://wiki.eclipse.org/JDT_UI/How_to_Contribute#Contributing_Code
Comment 20 Andrej Zachar CLA 2014-04-19 16:37:09 EDT
Hello Manju, 
here is the gerrit patch, I hope it is fine now:

https://git.eclipse.org/r/25305

Cheers,
Andrej
Comment 21 Andrej Zachar CLA 2014-09-06 14:08:21 EDT
Hello Manu, 
I have updated the gerrit patch some time ago, but I am not sure if you are notified about it. 

So anyway there is a new patch that contains all comments based on your review.

I hope that it is fine now.


Cheers,
Andrej
Comment 22 Noopur Gupta CLA 2015-03-27 08:31:40 EDT
Created attachment 251956 [details]
Patch

(In reply to Andrej Zachar from comment #20)
> https://git.eclipse.org/r/25305

Attached updated patch based on current master branch.
- Bundle version updates were not required, hence removed that.
- Updated copyright year, fixed formatting, Javadoc and made some minor changes. 

Patch looks good and can be merged after checking these points:

- Not sure if the following is required in TestViewer.IgnoredOnlyFilter.select(TestElement testElement):

!fTestRunSession.isRunning() && testElement.getStatus() == Status.RUNNING; // rerunning

- Image for the new tool button (Show Skipped Tests Only): testignored.gif or testassumptionfailed.gif or a new image?

Markus, please share your input on the above points.
Comment 23 Noopur Gupta CLA 2015-04-21 04:40:08 EDT
(In reply to Noopur Gupta from comment #22)
> Created attachment 251956 [details] [diff]
> Patch

Uploaded the patch to Gerrit change: https://git.eclipse.org/r/25305
Comment 25 Markus Keller CLA 2015-04-27 17:15:32 EDT
The change looked OK, so I pushed it, but then I realized that the "Next/Previous Failed Test" buttons don't work any more when "Show Skipped Tests Only" is enabled. Filed bug 465630 for that.