Skip to content

Commit

Permalink
report passing and failing projects at end
Browse files Browse the repository at this point in the history
  • Loading branch information
sean1588 committed Dec 13, 2024
1 parent 05335c4 commit 865a60b
Showing 1 changed file with 30 additions and 3 deletions.
33 changes: 30 additions & 3 deletions scripts/programs/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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.
Expand All @@ -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

0 comments on commit 865a60b

Please sign in to comment.