From ed90fbfe9f6669cb6b2e55f367d4524183cedea6 Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 12 Jan 2021 12:03:19 -0700 Subject: [PATCH] ci: Add timing info to test builds To help determine where time is being spent in tests, add a 'time' command to the test invocation script. In addition, split the test invocation into a separate build and run stage. This can be useful with another change to ptest that logs all test outputs instead of just failures. Signed-off-by: David Brown --- ci/sim_run.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ci/sim_run.sh b/ci/sim_run.sh index 6c0e3f27..59d65e10 100755 --- a/ci/sim_run.sh +++ b/ci/sim_run.sh @@ -25,14 +25,16 @@ EXIT_CODE=0 if [[ ! -z $SINGLE_FEATURES ]]; then if [[ $SINGLE_FEATURES =~ "none" ]]; then echo "Running cargo with no features" - cargo test + time cargo test --no-run + time cargo test rc=$? && [ $rc -ne 0 ] && EXIT_CODE=$rc fi for feature in $all_features; do if [[ $SINGLE_FEATURES =~ $feature ]]; then echo "Running cargo for feature=\"${feature}\"" - cargo test --features $feature + time cargo test --no-run --features $feature + time cargo test --features $feature rc=$? && [ $rc -ne 0 ] && EXIT_CODE=$rc fi done @@ -43,7 +45,8 @@ if [[ ! -z $MULTI_FEATURES ]]; then read -ra multi_features <<< "$MULTI_FEATURES" for features in "${multi_features[@]}"; do echo "Running cargo for features=\"${features}\"" - cargo test --features "$features" + time cargo test --no-run --features "$features" + time cargo test --features "$features" rc=$? && [ $rc -ne 0 ] && EXIT_CODE=$rc done fi