Fuehre Alembic und pytest im CI ohne verschachtelte Shell aus.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
e59997e208
commit
b0779859ab
|
|
@ -21,8 +21,10 @@ jobs:
|
||||||
echo "pytest uses Dev Postgres (${APP_DIR}); event=${{ github.event_name }}"
|
echo "pytest uses Dev Postgres (${APP_DIR}); event=${{ github.event_name }}"
|
||||||
cd "$APP_DIR"
|
cd "$APP_DIR"
|
||||||
for i in $(seq 1 60); do
|
for i in $(seq 1 60); do
|
||||||
if [ -f "$APP_DIR/pyproject.toml" ] && docker compose -f "$COMPOSE_FILE" exec -T api true 2>/dev/null; then
|
if [ -f "$APP_DIR/pyproject.toml" ] \
|
||||||
echo "api and pyproject.toml ready (attempt $i)"
|
&& grep -q "api-test:" "$COMPOSE_FILE" \
|
||||||
|
&& docker compose -f "$COMPOSE_FILE" exec -T api true 2>/dev/null; then
|
||||||
|
echo "api and test profile ready (attempt $i)"
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
if [ "$i" -eq 60 ]; then
|
if [ "$i" -eq 60 ]; then
|
||||||
|
|
@ -45,15 +47,11 @@ jobs:
|
||||||
psql -U "$PGUSER" -d postgres -v ON_ERROR_STOP=1 \
|
psql -U "$PGUSER" -d postgres -v ON_ERROR_STOP=1 \
|
||||||
-c "CREATE DATABASE buyingagent_test OWNER ${PGUSER};"
|
-c "CREATE DATABASE buyingagent_test OWNER ${PGUSER};"
|
||||||
docker compose -f "$COMPOSE_FILE" --profile test build --pull=false api-test
|
docker compose -f "$COMPOSE_FILE" --profile test build --pull=false api-test
|
||||||
docker compose -f "$COMPOSE_FILE" --profile test run --rm --no-deps \
|
RUN_OPTS="--rm --no-deps -v ${APP_DIR}:/src:ro -w /src -e PYTHONPATH=/src -e DB_NAME=buyingagent_test -e ENVIRONMENT=test -e ENGINE_BUILD=test"
|
||||||
-v "${APP_DIR}:/src:ro" \
|
docker compose -f "$COMPOSE_FILE" --profile test run $RUN_OPTS \
|
||||||
-w /src \
|
api-test /app/.venv/bin/alembic upgrade head
|
||||||
-e PYTHONPATH=/src \
|
docker compose -f "$COMPOSE_FILE" --profile test run $RUN_OPTS \
|
||||||
-e DB_NAME=buyingagent_test \
|
api-test /app/.venv/bin/pytest tests -ra --tb=short --cache-dir=/tmp/pytest-cache
|
||||||
-e ENVIRONMENT=test \
|
|
||||||
-e ENGINE_BUILD=test \
|
|
||||||
api-test \
|
|
||||||
/bin/sh -c '/app/.venv/bin/alembic upgrade head && /app/.venv/bin/pytest tests -m "not slow" -ra --tb=short --cache-dir=/tmp/pytest-cache'
|
|
||||||
|
|
||||||
smoke-dev:
|
smoke-dev:
|
||||||
if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }}
|
if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user