From 0dcfec050ed42aa860fbf5ed6af69d94654549db Mon Sep 17 00:00:00 2001 From: Tony Li Date: Tue, 6 Sep 2022 09:26:59 +1200 Subject: [PATCH] Expand test group log when tests failed --- .buildkite/commands/run-ui-tests.sh | 6 ++++++ .buildkite/commands/run-unit-tests.sh | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/.buildkite/commands/run-ui-tests.sh b/.buildkite/commands/run-ui-tests.sh index 2e8b3c69963..4f7876fb6aa 100755 --- a/.buildkite/commands/run-ui-tests.sh +++ b/.buildkite/commands/run-ui-tests.sh @@ -40,6 +40,12 @@ bundle exec fastlane test_without_building name:"$TEST_NAME" device:"$DEVICE" io TESTS_EXIT_STATUS=$? set -e +if [[ "$TESTS_EXIT_STATUS" -ne 0 ]]; then + # Keep the (otherwise collapsed) current "Testing" section open in Buildkite logs on error. See https://buildkite.com/docs/pipelines/managing-log-output#collapsing-output + echo "^^^ +++" + echo "UI Tests failed!" +fi + echo "--- 📦 Zipping test results" cd fastlane/test_output/ && zip -rq WooCommerce.xcresult.zip WooCommerce.xcresult && cd - diff --git a/.buildkite/commands/run-unit-tests.sh b/.buildkite/commands/run-unit-tests.sh index 14ec6c763b8..2331bb4383d 100755 --- a/.buildkite/commands/run-unit-tests.sh +++ b/.buildkite/commands/run-unit-tests.sh @@ -21,6 +21,12 @@ bundle exec fastlane test_without_building name:UnitTests TESTS_EXIT_STATUS=$? set -e +if [[ "$TESTS_EXIT_STATUS" -ne 0 ]]; then + # Keep the (otherwise collapsed) current "Testing" section open in Buildkite logs on error. See https://buildkite.com/docs/pipelines/managing-log-output#collapsing-output + echo "^^^ +++" + echo "Unit Tests failed!" +fi + echo "--- 📦 Zipping test results" cd fastlane/test_output/ && zip -rq WooCommerce.xcresult.zip WooCommerce.xcresult && cd -