-
Notifications
You must be signed in to change notification settings - Fork 338
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
Add a list of all Skipped tests to the Test Result report #106
base: master
Are you sure you want to change the base?
Conversation
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.
Any chance for an integration test? Is there an existing one that could be adapted?
*/ | ||
@Exported(visibility=9) | ||
public int getSkippedSince() { | ||
// If we haven't calculated failedSince yet, and we should, |
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.
skippedSince
if (skippedSince==0 && getSkipCount()==1) { | ||
CaseResult prev = getPreviousResult(); | ||
if(prev!=null && !prev.isPassed()) | ||
this.skippedSince = prev.getSkippedSince(); |
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.
What happens if in previous
the test failed and therefore it has been disabled now? Then previous.isPassed
is false
, too. Might be a good setup for an integration test.
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.
You're absolutely right - when a test becomes skipped, its skippedSince counter is set to the current build number.
In a subsequent build:
- If the test passes or fails, the skippedSince counter will be reset to 0.
- If the test is skipped again, the skippedSince is carried over from the previous build.
// do it now. | ||
if (skippedSince==0 && getSkipCount()==1) { | ||
CaseResult prev = getPreviousResult(); | ||
if(prev!=null && !prev.isPassed()) |
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.
It would make sense to always use {}
for ifs.
2. Comments typo, fit on one line 3. if brackets included
2. Avoid NPE possibility in getFailedSince() test
Added an integration test which indeed helped to fix a logical error in getSkippedSince(). |
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.
LGTM
* | ||
* If {@link #isPassed() passing}, this field is left unused to 0. | ||
*/ | ||
private /*final*/ int skippedSince; |
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.
shouldn't /*final*/
be removed?
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.
Thanks - removing
* If this test was skipped, then return the build number | ||
* when this test was first skipped. | ||
*/ | ||
@Exported(visibility=9) |
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.
Shouldn't the visibility of the skipped tests be higher than the visibility of failed tests?
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.
On second thought I think the visibility for getFailedSince and getSkippedSince should be identical.
@jglick ping |
src/main/resources/lib/hudson/test/aggregated-failed-tests.jelly
Outdated
Show resolved
Hide resolved
I like the change in general. One small thing I would like to see improved is making the list of skipped tests less significant in the UI. Collapsed by default? Moved to the very bottom? It is useful for sure but probably distracting most of the time... |
if (skippedSince==0 && getSkipCount()==1) { | ||
CaseResult prev = getPreviousResult(); | ||
if(prev!=null && prev.isSkipped()){ | ||
this.skippedSince = prev.getSkippedSince(); |
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.
Unlike failedSince, skippedSince is not available in XML, so this could recursively load all the skipped builds leading to StackOverflowError like JENKINS-31660 . IMHO it would be safer to save skippedSince in XML too and assume current build is the first skipped one if no information is found in XML, avoiding recursion. (Related to #117.)
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.
Good catch! I will review this and suggest a fix
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.
@zbynek I've given this some thought.. as I understand we only parse the XML and have no control over its contents. Do you see any other way to protect against a StackOverflowError ?
to prevent issues with implementations predating it
@olivergondza |
The skippedSince value is saved to XML (automatic saving of all fields, IIUC implemented by XStream2), but in most cases it's not computed before saving. See Also fixing the freeze method will cause a failure of the test |
Is it possible, that this feature will be merged? :) I would like to use this feature as well :) |
I'd love to see this feature available. What is lacking for a release? |
reviewing if #106 (comment) needs fixing and then resolving conflicts and testing it end 2 end. Basically needs someone (anyone) to pick it up and get it over the finish line. |
I'll be happy to revive this and push it if there's demand :) |
Nice! There is demand :-) How could you have waited for so long !?!?12 ;-) I would interested in the All Tests the least. |
@nirgilboa, please resolve the conflicts. Thanks! |
@nirgilboa Any news on this one? |
Still here :) Sorry switched into a new role at work Promise promise promise to complete it soon |
In a large test suite, it is useful to easily see a list of all skipped tests, as well as their age, i.e. for how many builds they've been skipped.
Previously it was only possible to view all tests in a given class, then sort by result to view the Skipped tests in it.
Note that I've left the "Duration" column, as tests may sometimes be skipped during execution, but it might be better to remove it to reduce clutter - I could use some feedback on that.