Skip to content

Commit

Permalink
Pipeline should fail if a test fails
Browse files Browse the repository at this point in the history
  • Loading branch information
Wulf committed Nov 2, 2023
1 parent b215e3e commit 2981d16
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion test/simple_table/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"

cd $SCRIPT_DIR

cargo run -- -i schema.rs -o models -g id -g created_at -g updated_at -c "diesel::r2d2::PooledConnection<diesel::r2d2::ConnectionManager<diesel::PgConnection>>"
cargo run -- -i schema.rs -o models -g id -g created_at -g updated_at -c "diesel::r2d2::PooledConnection<diesel::r2d2::ConnectionManager<diesel::PgConnection>>"
13 changes: 12 additions & 1 deletion test/test_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,19 @@ cd $SCRIPT_DIR
for D in *; do
if [ -d "${D}" ]; then
echo "Testing $D"
${D}/test.sh

# check if next script returns an error
if ! ./$D/test.sh; then
echo "Test '$D' failed"

ERROR=1
fi

# output separator
echo ""
fi
done

if [ "$ERROR" == "1" ]; then
exit 1
fi

0 comments on commit 2981d16

Please sign in to comment.