Skip to content

Commit

Permalink
Allow smoke tests to opt out of docker
Browse files Browse the repository at this point in the history
Depending on setup, `docker logs` output is not always that useful. E.g.
on CI or when running a server outside of docker for faster turnaround.
  • Loading branch information
kim committed Aug 8, 2023
1 parent ceb1f43 commit 55b6c4c
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions test/run-smoke-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,17 @@ fi

cargo run build "$RESET_PROJECT_PATH" -s -d

if [ "$(docker ps | grep "node" -c)" != 1 ] ; then
echo "Docker container not found, is SpacetimeDB running?"
exit 1
fi

export SPACETIME_SKIP_CLIPPY=1
CONTAINER_NAME=$(docker ps | grep "node" | awk '{print $NF}')
docker logs "$CONTAINER_NAME"

if [ -z "${NO_DOCKER:-}" ] ; then
if [ "$(docker ps | grep "node" -c)" != 1 ] ; then
echo "Docker container not found, is SpacetimeDB running?"
exit 1
fi

CONTAINER_NAME=$(docker ps | grep "node" | awk '{print $NF}')
docker logs "$CONTAINER_NAME"
fi

execute_procedural_test() {
if [ $# != 1 ] ; then
Expand Down Expand Up @@ -155,7 +158,7 @@ process_test_result() {
# Cleanup the test execution only if the test passed
rm -rf "$PROJECT_PATH" "$out_file_path" "$config_file_path"
else
docker logs "$CONTAINER_NAME"
[ -z "${NO_DOCKER:-}" ] && docker logs "$CONTAINER_NAME"
cat "$out_file_path"
echo "Config file:"
cat "$config_file_path"
Expand Down

0 comments on commit 55b6c4c

Please sign in to comment.