Skip to content

Commit

Permalink
Print failed extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
ianstanton committed Jul 25, 2023
1 parent 3a2e17b commit 5ac568a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/trunk-install-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ jobs:
sleep 5
curl https://registry.pgtrunk.io/extensions/all | jq -r ".[] | .name" > /tmp/extensions.txt
trunk-install.sh | tee /tmp/output.txt
results.sh
# results.sh
# grep -q ERROR /tmp/output.txt
# if [ $? -eq 1 ] ; then exit 1 ; else echo nope ; fi
19 changes: 12 additions & 7 deletions images/trunk-test/trunk-install.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
#!/bin/bash
failures=0
failure_count=0
failed_extensions=()
file='/tmp/extensions.txt'
lines=$(cat $file)
for line in $lines
do
trunk install $line
psql -c "create extension \"$line\" cascade;"
if [ $? -eq 0 ]; then
echo "Command succeeded"
else
echo "Command failed"
let "failures++"
if [ $? -ne 0 ]; then
echo "CREATE EXTENSION command failed"
let "failure_count++"
failed_extensions+=("$line")
fi
printf "\n\n"
done
echo "FAILURES: $failures"
echo "*** FAILURE COUNT ***: $failure_count"
printf "\n*** FAILED EXTENSIONS ***:\n"
for failed in "${failed_extensions[@]}"
do
echo $failed
done

0 comments on commit 5ac568a

Please sign in to comment.