-
Notifications
You must be signed in to change notification settings - Fork 96
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
prerelease: catkin_test_results return codes get suppressed #367
Comments
If a user invokes a build together with the tests it needs to be distinguishable if the build failed, or if only some tests failed, or if everything passed. Currently this means when you invoke the tests and they have been run successfully (which doesn't imply that all tests have passed) the return code is 0. If you then want to distinguish if the any tests have failed you can use If the invocation would return an error code the user (as well as any automated tool) couldn't distinguish if the build failed for some other reason or if only some tests failed. |
The automated test does not care what part failed. So in order to get a proper exit codes, the user (or the CI systems) needs to call
This is not really user-friendly and in total |
I am open to any suggestions if you could describe an approach which works for the existing Jenkins jobs as well as for the user / automated scripts running a prerelease. It might also be good to consider how other tools running tests behave. Users might expect a similar behavior from our tools. |
I guess the Jenkin jobs should continue to ignore test failures?
Somethings involving an environment variable to make the script fail on test errors?
|
You mentioned "failing tests should stop devel and prerelease tests" before and I probably don't understand what exactly that means. It might be good if you could describe for each case (devel job, devel script, prerelease script underlay / overlay) how you imagine it to change behavior in detail. If possible expressing the desired change in a PR might help to understand since it might be difficult to describe clearly. |
To separate the two cases, user and Jenkins:
|
How do you detect a failure in test execution in this case (not a failing test but something failing to run the tests as requested by the command)? |
Are these two cases being distinguished currently? |
Yes, if the |
IMHO the split between
If the exit code of |
Currently |
Ah, interesting. Who is currently taking advantage of that distinction? Is it just for users, or does something like Jenkins rely on it? |
Anyone automating the process will likely use the return value. E.g. when running a build and test cycle via Travis. |
Yes, but this exit code 1 gets dropped in devel jobs and the prerelease test scripts. |
Indeed it does. For a devel job the rational is the following: The Jenkins build should not fail. Instead the test results are being interpreted and if any of them failed the build is marked as "unstable". For a prerelease script the reason is very similar. If a test in the underlay fails it should continue building and testing the overlay. |
Thanks, I think that I have enough context to proceed; I'll move my thoughts into a proposed enhancement for ament. |
From my point of view the test job should fail after the underlay test. Unit testing should detect code breakage, so there is no reason to go on with overlay tests and waste time if the underlay is broken. |
@ipa-mdl That might very well be the case for your applications. But others might want to use it differently and we shouldn't close the door and that. E.g. if the underlay reports a linter error the user might still be interested how the tests results look like for the overlay. Please see ament/ament_tools#140 for a proposed command line option to choose the desired return code behavior to make both uses cases easily possible. |
I think the current implementation in catkin is fine, all cases can be handled properly this way. Something like
(without set +-e) So we could call it with |
I created PR #399 with a similar feature. You can set Another alternative as of #396 is to check the return code after the script invocation. Therefore you need to Please try the patch and let me know if that addresses your use case. |
Why does
catkin_test_results
gets called withset +e
?(https://github.com/ros-infrastructure/ros_buildfarm/blob/master/ros_buildfarm/templates/devel/devel_script_test_results.sh.em)
IMHO failing tests should stop devel and prerelease tests.
The current behavior forces the prerelease test user to call
catkin_test_results
again with the correct workspace paths.The text was updated successfully, but these errors were encountered: