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

Handle tests suites exiting with an exception #54

Merged
merged 3 commits into from Dec 17, 2014

Conversation

dbkr
Copy link

@dbkr dbkr commented Dec 15, 2014

I think ideally the parser should notice whenever it's got to the end of the output and mark and outstanding tests as failed, which would catch this situation in the more general case. Unfortunately there's no clean way for the parser to know when it's reached the end (close() is specifically blocked although it's not clear why).

However for the specific case of exiting with an exception, this patch makes the output 'unstable' rather than succeeding or failing outright (depending on whether the 'allow failing build results' is enabled).

@jenkinsadmin
Copy link
Member

Thank you for a pull request! Please check this document for how the Jenkins project handles pull requests

@dbkr
Copy link
Author

dbkr commented Dec 17, 2014

You're right, this should be an 'error'. I've added support for 'error' elements to the JUnit outputter and made it output them. I'm not sure about parsing the time: the rest of the the time parsers just grab the time the test took, whereas we only have the wallclock time of the box, so we could probably work it out but since test crashed anyway, I think it's unlikely to ever be that useful.

@lacostej
Copy link

Are we missing the updated XCodeBuildOutputParser in your latest commit/push ?

@lacostej
Copy link

As for the time, I agree that it's not critical. I am not even sure this schema is official and I suspect parsers have learned to be more resistant :) Jenkins doesn't seem to complain without it today.

Note: make sure that the TestSuite is probably updated to count the errors. Ideally they would 'bubble up' all the way to the 'All tests' one I suspect.

@dbkr
Copy link
Author

dbkr commented Dec 17, 2014

Oops, yes, sorry: I forgot to git add -u. I added addError() to the TestSuite to match addFailure() and called it when it detects an exception so hopefully this should be okay.

lacostej added a commit that referenced this pull request Dec 17, 2014
XCTest output parsing: handle tests suites exiting with an error
@lacostej lacostej merged commit df01540 into jenkinsci:master Dec 17, 2014
@lacostej
Copy link

Thanks for the Pull Request. Merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants