-
Notifications
You must be signed in to change notification settings - Fork 297
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
test-admin-deploy-var: Don't rely on OSTREE_FEATURES #3184
Conversation
Skipping CI for Draft Pull Request. |
(testing this next, will undraft when tested) |
24ea77e
to
f6f378f
Compare
This was more involved than I had expected! |
Signed-off-by: Simon McVittie <[email protected]>
This avoids false negatives from `ostree --version | grep -q ...` exiting with failure under `set -o pipefail` because `grep -q` can exit as soon as it sees the desired string, leaving `ostree --version` to be terminated by `SIGPIPE` next time it writes to stdout. Signed-off-by: Simon McVittie <[email protected]>
This is set during build-time testing, but unset during "as-installed" tests. Resolves: ostreedev#3183 Signed-off-by: Simon McVittie <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice, thanks!
# avoid ostree --version being killed with SIGPIPE and exiting with a | ||
# nonzero status under `set -o pipefail`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh man...wow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I said, more involved than I expected. This PR brought to you by the dept. of Unix arcana.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even though it's eminently useful, I stopped using pipefail
years ago after being burned by the same issue in tar
. It might be nice to install a SIGPIPE
handler in the version printing code since this is likely to affect other ostree
consumers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thing I've said many times with coworkers in live video chats, but rarely externally is that a nontrivial component of why I still (20+ years later) wake up and log into my computer for this job is that I just really enjoy collaborating with lots of smart people across the internet. Also there's the continual "surprise" factor in computers as in "what did someone figure out how to make them do this year" (and right now it's AI).
Anyways this little bit combines those two - I just want to say thanks @smcv as one of those smart people on the Internet for everything you do 🙏 - and this little bit of pipefail is one of those surprises 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #3203.
Signed-off-by: Simon McVittie <[email protected]> Forwarded: ostreedev/ostree#3184 Gbp-Pq: Name tests-Generalize-has_gpgme-has_sign_ed25519-into-has_ostr.patch
This avoids false negatives from `ostree --version | grep -q ...` exiting with failure under `set -o pipefail` because `grep -q` can exit as soon as it sees the desired string, leaving `ostree --version` to be terminated by `SIGPIPE` next time it writes to stdout. Signed-off-by: Simon McVittie <[email protected]> Forwarded: ostreedev/ostree#3184 Gbp-Pq: Name tests-Use-skip_without_ostree_feature-to-detect-libarchiv.patch
This is set during build-time testing, but unset during "as-installed" tests. Bug: ostreedev/ostree#3183 Signed-off-by: Simon McVittie <[email protected]> Forwarded: ostreedev/ostree#3184 Gbp-Pq: Name test-admin-deploy-var-Don-t-rely-on-OSTREE_FEATURES.patch
tests: Generalize has_gpgme, has_sign_ed25519 into has_ostree_feature
tests: Use skip_without_ostree_feature to detect libarchive, composefs
This avoids false negatives from
ostree --version | grep -q ...
exiting with failure underset -o pipefail
becausegrep -q
can exit as soon as it sees the desired string, leavingostree --version
to be terminated bySIGPIPE
next time it writes to stdout.test-admin-deploy-var: Don't rely on OSTREE_FEATURES
This is set during build-time testing, but unset during "as-installed" tests.
Resolves: installed-tests fail with 2024.3: test-admin-deploy-var.sh: line 24: OSTREE_FEATURES: unbound variable #3183