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

build.yml: Fix 'Print failure info' to not error #4340

Merged
merged 1 commit into from
Mar 5, 2021

Conversation

jepler
Copy link
Member

@jepler jepler commented Mar 5, 2021

Print Failure Info is for printing differences detected by 'Test all'. When some other step fails, then "*.exp" doesn't match any files at all, and this step fails too.

We will assume that the shell is bash and use the easy "shopt" way of fixing the problem, so that ".exp" expands to nothing (instead of ".exp") if there are no matches.

This is an alternative to #4334, which would remove the step entirely. It is undesirable to do that, as we wouldn't be able to see the information about the failures that occurred anymore.

.github/workflows/build.yml Outdated Show resolved Hide resolved
@jepler
Copy link
Member Author

jepler commented Mar 5, 2021

I was unable to determine whether the CI is guaranteed to run with the bash as the shell. The snippet above is intended to work with any sh. If it's guaranteed to be bash, then nullglob is a better solution.

Copy link
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

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

I tested this by hand, and it works, but it's pretty obscure. Could you add a comment about what it's doing?

Print Failure Info is for printing differences detected by 'Test all'.  When some other step fails, then "*.exp" doesn't match any files at all, and _this_ step fails too.

We will assume that Github Actions always runs with bash as the shell (as it does today). In this case, we can set the  "nullglob" shell option, so that a non-existent glob expands to nothing, instead of to itself.
@jepler
Copy link
Member Author

jepler commented Mar 5, 2021

The shell is bash now, and can't be changed lightly without breaking workflows, so let's assume it. I've changed the code to set the nullglob shell option instead of using the complicated and portable way.

@jepler jepler requested a review from dhalbert March 5, 2021 18:52
Copy link
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

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

Okee dokee, thanks!

@dhalbert
Copy link
Collaborator

dhalbert commented Mar 5, 2021

Build failure is a network glitch.

@dhalbert dhalbert merged commit dfcc9c6 into adafruit:main Mar 5, 2021
This was referenced Mar 5, 2021
@jepler jepler deleted the fix-ci-failure-info branch November 3, 2021 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants