Bug 386676 - [JUnit] JUnit View shall show reason given using @Ignore or in assumption failure
Summary: [JUnit] JUnit View shall show reason given using @Ignore or in assumption fai...
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.8   Edit
Hardware: All All
: P3 enhancement with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Christian Georgi CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-06 08:06 EDT by Markus KARG CLA
Modified: 2017-10-14 13:43 EDT (History)
6 users (show)

See Also:
noopur_gupta: review-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus KARG CLA 2012-08-06 08:06:18 EDT
The JUnit View already shows a strike-through icon in the tree for each @Ignore'd test. It would be great if hovering over such a test in the tree would pop up a bubble that tells the reason for ignoring, given as a test to the @Ignore annotation. This would allow people to better understand why a test was skipped, without the need to open the source code of the test.
Comment 1 Markus Keller CLA 2012-08-14 10:49:43 EDT
Probably a place where we could try org.eclipse.jface.window.DefaultToolTip (and thereby fix bugs in the infrastructure).

The search for the element can be non-trivial and should use the same code as org.eclipse.jdt.internal.junit.ui.OpenTestAction#findElement(IJavaProject, String)
Comment 2 Markus Keller CLA 2013-05-01 06:59:56 EDT
We need to change the wire format to transfer the message from the test VM to the Eclipse VM. I guess the easiest solution is to send the message as first line of the failure trace or as MessageIds.ACTUAL_START/END message.

In the serialization code, we should should put the message into the IXMLTags.ATTR_MESSAGE attribute of the <skipped> node, like https://issues.apache.org/bugzilla/show_bug.cgi?id=43969

This should work for ignored tests as well as for tests with an assumption failure.
Comment 3 Christian Georgi CLA 2015-01-13 15:44:30 EST
(In reply to Markus Keller from comment #2)
> We need to change the wire format to transfer the message from the test VM
> to the Eclipse VM. I guess the easiest solution is to send the message as
> first line of the failure trace or as MessageIds.ACTUAL_START/END message.

I have implemented @Ignore reason support with change https://git.eclipse.org/r/39533.  The reason is sent as part of the start/end message.

> In the serialization code, we should should put the message into the
> IXMLTags.ATTR_MESSAGE attribute of the <skipped> node, like
> https://issues.apache.org/bugzilla/show_bug.cgi?id=43969

The <skipped> node's message is already used for assumption failures, so I am not sure how, or if at all, ignore reason shall be supported here.  I have implemented the reason for the <testcase> node though, as an 'ignorereason' attribute next to the 'ignored' attribute.
Comment 4 Christian Georgi CLA 2015-02-18 04:57:12 EST
Any chance that this will be considered for Mars?
Comment 5 Christian Georgi CLA 2016-03-19 06:39:43 EDT
Now that my patch has celebrated its first anniversary, is there a chance it will be included in Eclipse Neon?  I appreciate any feedback that is more than changing the target milestone for this bug ;)
Comment 6 Dani Megert CLA 2016-04-21 04:20:42 EDT
(In reply to Christian Georgi from comment #5)
> Now that my patch has celebrated its first anniversary, is there a chance it
> will be included in Eclipse Neon?  I appreciate any feedback that is more
> than changing the target milestone for this bug ;)

I'm sorry Christian. I have to move this to 4.7. Markus is just too busy with other stuff at the moment.
Comment 7 Christian Georgi CLA 2016-04-21 04:29:39 EDT
(In reply to Dani Megert from comment #6)
> I'm sorry Christian. I have to move this to 4.7. Markus is just too busy
> with other stuff at the moment.

Well, isn't there anybody else that is able and willing to review this?
Is Markus the only active committer in JDT UI?
Comment 8 Dani Megert CLA 2016-04-21 04:38:46 EDT
(In reply to Christian Georgi from comment #7)
> (In reply to Dani Megert from comment #6)
> > I'm sorry Christian. I have to move this to 4.7. Markus is just too busy
> > with other stuff at the moment.
> 
> Well, isn't there anybody else that is able and willing to review this?
> Is Markus the only active committer in JDT UI?

Markus is most familiar with the JUnit code and hoped to find time at some point. I suggest you ping again during the first 4.7 milestone.
Comment 9 Noopur Gupta CLA 2016-10-13 06:00:58 EDT
Thanks for the patch, Christian. These are the review comments:

1. This patch handles only the @Ignore reason. But it should also handle the reason/message given in assumption failures (see bug summary).

2. For accessibility, the reason should also be shown in the JUnit view's failure trace (in addition to the tooltip on the test node).

3. The patch doesn't use the recommendations from comment #2. With the above two requests, you could also use these suggestions.
Comment 10 Noopur Gupta CLA 2017-05-10 05:26:55 EDT
Target can be reassigned when updated patch is received.