From 865a60be8feee626f7b1f539fa293d562c530f15 Mon Sep 17 00:00:00 2001 From: Sean Holung Date: Thu, 12 Dec 2024 16:13:16 -0800 Subject: [PATCH] report passing and failing projects at end --- scripts/programs/test.sh | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/scripts/programs/test.sh b/scripts/programs/test.sh index 1f4b4ecba193..557aae47ab09 100755 --- a/scripts/programs/test.sh +++ b/scripts/programs/test.sh @@ -24,6 +24,9 @@ else org="$(pulumi whoami -v --json | jq -r .user)" fi +failed_projects=() +passing_projects=() + pushd "$programs_dir" found_first_program=false @@ -69,7 +72,10 @@ pushd "$programs_dir" fqsn="${org}/${project}/${stack}" # Install dependencies. - pulumi -C "$project" install + if ! pulumi -C "$project" install; then + failed_projects+=("$project") + continue + fi # Skip programs we know don't successfully preview. @@ -117,9 +123,15 @@ pushd "$programs_dir" continue fi - pulumi -C "$project" up --yes + if ! pulumi -C "$project" up --yes; then + failed_projects+=("$project") + continue + fi else - pulumi -C "$project" preview + if ! pulumi -C "$project" preview; then + failed_projects+=("$project") + continue + fi fi # Destroy and remove. @@ -137,3 +149,18 @@ if [[ "$mode" == "preview" ]]; then unset PULUMI_CONFIG_PASSPHRASE pulumi logout --local fi + +# Report passing and failing projects. +if [ ${#failed_projects[@]} -ne 0 ]; then + echo "The following projects failed:" + for project in "${failed_projects[@]}"; do + echo "- $project" + done + echo "The following projects passed:" + for project in "${passing_projects[@]}"; do + echo "- $project" + done + exit 1 +else + echo "All projects completed successfully :)" +fi \ No newline at end of file