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

Use trap to handle errors in test scripts #370

Merged
merged 3 commits into from
Feb 13, 2023

Conversation

AjayThorve
Copy link
Member

This PR adds a less verbose trap method, for error handling to help ensure that we capture all potential error codes in our test scripts, and works as follows:

  • setting an environment variable, EXITCODE, with a default value of 0
  • setting a trap statement triggered by ERR signals which will set EXITCODE=1 when any commands return a non-zero exit code

cc @ajschmidt8

@AjayThorve AjayThorve requested a review from a team as a code owner February 10, 2023 18:56
@ajschmidt8 ajschmidt8 added improvement Improves an existing functionality non-breaking Introduces a non-breaking change labels Feb 10, 2023
ci/test_cpp.sh Outdated Show resolved Hide resolved
Co-authored-by: AJ Schmidt <ajschmidt8@users.noreply.github.com>
Copy link
Contributor

@robertmaynard robertmaynard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am confused.

The PR title is Reduce error handling verbosity in CI tests scripts but the scripts are now longer. What verbosity is this intending to reduce?

@ajschmidt8
Copy link
Member

I am confused.

The PR title is Reduce error handling verbosity in CI tests scripts but the scripts are now longer. What verbosity is this intending to reduce?

Good point. This change doesn't have much effect on rapids-cmake since it's test scripts are pretty succinct.

In other repositories, these changes were meant to replace the many conditional code blocks that existed previously for capturing error codes (like this file for cudf).

@robertmaynard, if you want us to close this PR since rapids-cmake has a small test script that's fine. I initially just created a list of all the GHAs repositories that should be checked which is why this PR was opened.

@AjayThorve
Copy link
Member Author

I am confused.

The PR title is Reduce error handling verbosity in CI tests scripts but the scripts are now longer. What verbosity is this intending to reduce?

Hey @robertmaynard, you are right. This PR was part of a larger effort across all repos, and the title applied to all the repos except rapids-cmake. Infact in this case, as you mentioned it's adding more lines. Apologies for the confusion, but the aim of the change is to use the trap method to catch ERR, and while in most repositories across rapidsai, it significantly reduced the verbosity, in the case of rapids-cmake, we can may be use trap to keep error handling consistent across projects?

@robertmaynard
Copy link
Contributor

Absolutely fine moving over to using trap. Let's just update the pr title

@AjayThorve AjayThorve changed the title Reduce error handling verbosity in CI tests scripts use trap to handle errors in test scripts Feb 10, 2023
@AjayThorve AjayThorve changed the title use trap to handle errors in test scripts Use trap to handle errors in test scripts Feb 10, 2023
ci/test_cpp.sh Show resolved Hide resolved
@ajschmidt8
Copy link
Member

/merge

@rapids-bot rapids-bot bot merged commit 674e8a7 into rapidsai:branch-23.04 Feb 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improves an existing functionality non-breaking Introduces a non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants