-
Notifications
You must be signed in to change notification settings - Fork 155
Improve the test script and CI pipeline #405
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
Changes from all commits
62d5169
b072a5f
0457722
3913a08
a5718f7
ca9988d
27df863
ed51323
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
#!/bin/sh -ex | ||
|
||
set -e | ||
|
||
FEATURES="compiler use-serde rand" | ||
|
||
# Use toolchain if explicitly specified | ||
|
@@ -8,41 +10,50 @@ then | |
alias cargo="cargo +$TOOLCHAIN" | ||
fi | ||
|
||
cargo --version | ||
rustc --version | ||
|
||
# Format if told to | ||
if [ "$DO_FMT" = true ] | ||
then | ||
( | ||
rustup component add rustfmt | ||
cargo fmt --all -- --check | ||
) | ||
rustup component add rustfmt | ||
cargo fmt --all -- --check | ||
fi | ||
|
||
# Fuzz if told to | ||
if [ "$DO_FUZZ" = true ] | ||
then | ||
( | ||
cd fuzz | ||
cargo test --verbose | ||
./travis-fuzz.sh | ||
# Exit out of the fuzzer, | ||
# run stable tests in other CI vms | ||
exit 0 | ||
) | ||
cd fuzz | ||
cargo test --verbose | ||
./travis-fuzz.sh | ||
|
||
# Exit out of the fuzzer, do not run other tests. | ||
exit 0 | ||
fi | ||
|
||
# Test without any features first | ||
cargo test --verbose | ||
# Defaults / sanity checks | ||
cargo test | ||
|
||
# Test each feature | ||
for feature in ${FEATURES} | ||
do | ||
cargo test --verbose --features="$feature" | ||
done | ||
if [ "$DO_FEATURE_MATRIX" = true ] | ||
then | ||
# All features | ||
cargo test --features="$FEATURES" | ||
|
||
# Single features | ||
for feature in ${FEATURES} | ||
do | ||
cargo test --features="$feature" | ||
done | ||
|
||
# Also build and run each example to catch regressions | ||
cargo build --examples | ||
# run all examples | ||
run-parts ./target/debug/examples | ||
# Run all the examples | ||
cargo build --examples | ||
cargo run --example htlc --features=compiler | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: There is a white space at the end of this line. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ooo, means I did not read the diff before pushing, bad Tobin. Thanks man, I'll fix it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I read the diff and I missed this too, oops! Thanks Sanket. |
||
cargo run --example parse | ||
cargo run --example sign_multisig | ||
cargo run --example verify_tx > /dev/null | ||
cargo run --example psbt | ||
cargo run --example xpub_descriptors | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why manually list examples instead of run-parts? Is it because of the extra args to each example? We need to remember to add examples here every time. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Its so the script can be run locally, but yes as you say there is a maintenance cost. Is it worth it, I don't know? I configure |
||
fi | ||
|
||
# Bench if told to (this only works with the nightly toolchain) | ||
if [ "$DO_BENCH" = true ] | ||
|
@@ -67,3 +78,5 @@ if [ -n "$BITCOINVERSION" ]; then | |
rm -rf bitcoin-$BITCOINVERSION | ||
exit 0 | ||
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.
This is a big bug! I wonder how it ever worked till now
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.
I guess we were getting some false positives in the CI runs.
rust-bitcoin/contrib/test.sh
doesn't have this either :)