The rehearsal tore down a stack it did not start and left the one it did running

The console stage starts the stack through the host daemon with whatever
COMPOSE_PROJECT_NAME the caller passed, so the CI-named project is what is
running. Its cleanup container passed no such name, so it removed the stack
named after this directory - nothing - and printed PASS while two containers
held the CI port. Re-running the stage with the CI console job's own
environment is what showed it: 53 assertions, 0 failed, and 2 containers still
up. With the name passed through, the same stage leaves 0.
This commit is contained in:
Pavlo Ratushnyi
2026-10-02 07:35:26 +02:00
parent ea68b550e2
commit 7e081da6fe
+5
View File
@@ -211,8 +211,13 @@ if [ "$STAGE" = all ] || [ "$STAGE" = console ]; then
' || console_status=$?
fi
# The teardown has to name the same project the seeding container named.
# Without COMPOSE_PROJECT_NAME this removes the stack named after this
# directory and leaves the CI-named one — and its port — running behind a
# summary line that says PASS.
docker run --rm -v "$PWD:$PWD" -w "$PWD" \
-v "$DOCKER_SOCKET:/var/run/docker.sock" \
-e COMPOSE_PROJECT_NAME -e EDGE_PORT \
"$COMPOSE_IMAGE" sh -c 'docker compose down >/dev/null 2>&1 || true'
fi
fi