-
Notifications
You must be signed in to change notification settings - Fork 286
Fix test script silent failure #422
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
Conversation
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.
ACK e080754
Big improvement! Though maybe we shouldn't merge it while WASM is broken.
I noticed the
It shouldn't get through CI till then ;) |
utACK 51a79fb |
Remove single character of trailing whitespace.
Bringing to your attention @apoelstra that this PR removes the pipes instead of using the option you proposed someplace else to make any command in a pipe fail ( |
In line with the `Tests` job and for the fact that this job does stuff with the nightly toolchain other than bench. Re-name nightly CI job from `bench_nightly`to `Nightly`.
We use a matrix with a single element, this is unnecessary.
The address sanitizer job is silently failing at the moment because we do not install clang. Install clang so the address sanitizer job can run. Do not fix the silent failure, that will be done later on.
We have a separate CI job for things that require a nightly toolchain. Building the docs requires a nightly toolchain (because of `--cfg docsrc` flag). It makes more sense to run the docs build in the `Nightly` job instead of hidden in the `Tests` job. Do the docs build in the `Nightly` job instead of in the `Tests` job.
WASM is supported by Rust 1.30. We can therefore run the WASM tests on any all the toolchains except MSRV (1.29.0). This has benefit of catching nightly/beta issues before they get to stable. Done as a separate CI job since it is conceptually different to the `Tests` job. Run WASM for nightly, beta, and stable toolchains.
Yep, I am aware -- I suggested In any case, I think it's clearer to have |
bfd88db Move WASM const definitions to a source file (Tobin Harding) Pull request description: Total re-write ... again :) Currently we are defining the WASM integer size and alignments in the `stdio.h` header file, this is wrong because this file is included in the build by way of `build.rs` as well as by upstream `libsecp256k1`. Move WASM integer definitions to a `C` source file and build the file into the binary if target is WASM. Fixes the first part of #419 (#422 does the second part). ### Note to reviewers I'm not exactly sure why the directory `was-sysroot` is named as it is or if the name is significant to `cargo` , please review carefully the directory tree changes. ``` cd secp256k1-sys tree wasm wasm ├── wasm.c └── wasm-sysroot ├── stdio.h ├── stdlib.h └── string.h ``` ACKs for top commit: thomaseizinger: ACK bfd88db apoelstra: ACK bfd88db Tree-SHA512: ba822b764fb5f74dfd22cc797f7e3f70440dbaabfe34e0475c796e0e5d88f2086bedb00a1ec765cce91bde6bb45130b9abe5d9289317d6c20f692c6ed711969e
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.
@@ -94,3 +94,4 @@ if [ "$DO_BENCH" = true ]; then | |||
cargo bench --all --features="unstable" | |||
fi | |||
|
|||
exit 0 |
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.
What is the benefit of explicitly saying exit 0? Isn't that the default?
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.
The default exit status is the exit status of the last command, because we use set -e
to exit the script early if any command fails then it is going to be 0. I like to do it explicitly though.
51a79fb
to
1e229b3
Compare
Rebased on #420, might be able to merge without me rebasing again, let's see :) |
As per UNIX convention a Bash script should exit with status code 0 if it completes successfully.
Currently the `test.sh` script is silently failing because we do not exit if a command fails. We can achieve this by using the Bash builtin `set -e`. For some reason I cannot explain a chain of commands that fails does not fail the script. Instead of working out _why_ just remove the chain and run each command on its own. This is functionally the same and, I hazard a guess, is what the original author hoped to achieve with the chaining.
For the test that uses `clang-9` do the sanity call using `clang-9` instead of `clang`. For the test that uses `clang` add a sanity call to `clang --version`.
1e229b3
to
97dc0ea
Compare
58db1b6 Run WASM for multiple toolchains (Tobin Harding) 946ac3b Do docs build in Nightly job (Tobin Harding) f7bc7d3 Install clang to run adress sanitizer (Tobin Harding) 96685c5 Remove unnecessary matrix (Tobin Harding) a8a679e Re-name nightly CI job to Nightly (Tobin Harding) 9c9d622 Remove trailing whitespace (Tobin Harding) Pull request description: Improve the CI pipeline. Done while investigating #419. This PR now only includes the GitHub actions changes, I'm moving the `test.sh` changes to a #422 because they cannot be merged yet. (Please note, this PR has been heavily re-worked so discussion below may be confusing to reviewers new to the PR.) ACKs for top commit: apoelstra: ACK 58db1b6 thomaseizinger: ACK 58db1b6 Tree-SHA512: 5520cf7a7ea0ba701aeaf6b97150416192c0629df8b65545a20d8937a4d76bd323a0d7a875deccb7ce9adc4f3a423e6cd27b300682f206f79407f5ab4eaa5ddb
Looks like both GIthub and my local commit-labelling tool are smart enough to do the right thing, since #420 is merged. (Well, Github still shows "9 commits" and doesn't indicate that they're shared, but it doesn't demand a rebase, so all good.) |
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.
ACK 97dc0ea
Thank you for doing this!
Change the test script to exit with non-zero status code if any command fails.
The
test.sh
script is silently failing, that means changes causing failures are slipping through our CI pipeline and being merged.Resolves: #419
Note
Just the last 3 patches, the first 6 are from #420. re-base just shows it works on top of 420, it is going to have to be rebased again when 420 merges.