Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.

Returning exit status for unit test invocation #757

Closed
ezbc opened this issue Apr 6, 2017 · 3 comments
Closed

Returning exit status for unit test invocation #757

ezbc opened this issue Apr 6, 2017 · 3 comments
Assignees
Milestone

Comments

@ezbc
Copy link
Contributor

ezbc commented Apr 6, 2017

Exit status always 0 for unit tests

Currently running unit tests from the terminal only prints the test results to the terminal source link. If there are any failing unit tests, the user needs to examine the printed xml for any errors. The exit status will always remain 0 (succeeded).

For example running

./ml local test

will only return an exit status of 0 despite whether a unit test failed or not.

Use case

Returning an exit status for the unit tests would be valuable to automated builds of a project so that a build will fail a unit test fails.

Potential solution

One potential way to return the exit status based on the success of unit tests would be to parse the XML output from the test script, /test/default.xqy, and check if the "errors" or "failures" attributes in the testsuite element is anything but 0.

I plan on writing a solution for my local project. Let me know if you would like me to submit a pull request.

@grtjn grtjn added the bug label Jun 1, 2017
@grtjn
Copy link
Contributor

grtjn commented Jun 1, 2017

We'd welcome a PR. There are instructions on how to Contribute to Roxy.

@grtjn grtjn modified the milestone: July 2017 Jun 1, 2017
@grtjn grtjn self-assigned this Jun 8, 2017
grtjn added a commit to grtjn/roxy that referenced this issue Jun 8, 2017
@ezbc
Copy link
Contributor Author

ezbc commented Jun 9, 2017

Thanks for supporting this @grtjn. Apologies for not providing a PR!

RobertSzkutak added a commit that referenced this issue Jul 28, 2017
Fixed #757: return http 409 if failed, and use for exit code
@RobertSzkutak
Copy link
Contributor

Fixed in dev

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants