From eb479782e70cf4a8e8f50c69709adb2e10328a07 Mon Sep 17 00:00:00 2001 From: Vlad Grigorescu Date: Mon, 25 Nov 2024 06:59:17 -0600 Subject: [PATCH 01/22] Create staticfiles directory --- compose/local/django/start | 1 + 1 file changed, 1 insertion(+) diff --git a/compose/local/django/start b/compose/local/django/start index 2d910375..621d3649 100644 --- a/compose/local/django/start +++ b/compose/local/django/start @@ -4,5 +4,6 @@ set -o errexit set -o pipefail set -o nounset +mkdir /app/staticfiles python manage.py migrate uvicorn config.asgi:application --host 0.0.0.0 --reload From ba2c6aa58e06e3cd0ee4351ae309b27fedddf638 Mon Sep 17 00:00:00 2001 From: Vlad Grigorescu Date: Mon, 25 Nov 2024 11:26:01 -0600 Subject: [PATCH 02/22] Dump docker logs on failure --- .github/workflows/behave.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/behave.yml b/.github/workflows/behave.yml index ec12d633..9144e946 100644 --- a/.github/workflows/behave.yml +++ b/.github/workflows/behave.yml @@ -60,6 +60,10 @@ jobs: POSTGRES_DB: test_scram run: make coverage.xml + - name: Dump docker logs on failure + if: failure() + uses: jwalton/gh-docker-logs@v2 + - name: Upload Coverage to Coveralls uses: coverallsapp/github-action@v2 From 0f1a19edd87adbb9b7a7da6655a8ad5bce517405 Mon Sep 17 00:00:00 2001 From: Vlad Grigorescu Date: Mon, 25 Nov 2024 12:07:13 -0600 Subject: [PATCH 03/22] Add some additional debugging --- .github/workflows/behave.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/behave.yml b/.github/workflows/behave.yml index 9144e946..30d08b27 100644 --- a/.github/workflows/behave.yml +++ b/.github/workflows/behave.yml @@ -45,6 +45,9 @@ jobs: sudo apt-get update sudo apt-get install -y docker-compose make + - name: Check Docker state (pre-build) + run: docker ps + - name: Build Docker images run: make build @@ -54,6 +57,9 @@ jobs: - name: Run Application run: make run + - name: Check Docker state (pre-test) + run: docker ps + - name: Run pytest + behave with Coverage env: POSTGRES_USER: scram @@ -78,6 +84,11 @@ jobs: with: minimum_coverage: '50' + + - name: Check Docker state (post-test) + if: always() + run: docker ps + - name: Stop Services if: always() run: make stop From 1b43fa4f8db20e5e19dc4ba7d8896727c5666dc0 Mon Sep 17 00:00:00 2001 From: Vlad Grigorescu Date: Mon, 25 Nov 2024 13:07:56 -0600 Subject: [PATCH 04/22] Django container was failing to make the directory --- compose/local/django/start | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compose/local/django/start b/compose/local/django/start index 621d3649..95f91dff 100644 --- a/compose/local/django/start +++ b/compose/local/django/start @@ -4,6 +4,6 @@ set -o errexit set -o pipefail set -o nounset -mkdir /app/staticfiles +mkdir -p /app/staticfiles python manage.py migrate uvicorn config.asgi:application --host 0.0.0.0 --reload From aacb68556a88e007f38b2b05de0b116b8cf2e8b5 Mon Sep 17 00:00:00 2001 From: Vlad Grigorescu Date: Mon, 25 Nov 2024 15:38:15 -0600 Subject: [PATCH 05/22] Try running on Python 3.11 as well; expecting a failure. --- .github/workflows/pytest.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 45feca20..ddcba272 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -20,7 +20,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: ['3.12'] + python-version: ['3.11', '3.12'] services: postgres: @@ -28,7 +28,7 @@ jobs: env: POSTGRES_USER: scram POSTGRES_PASSWORD: '' - POSTGRES_DB: test_scram + POSTGRES_DB: test_scram_${{ matrix.python-version }} POSTGRES_HOST_AUTH_METHOD: trust ports: - 5432:5432 @@ -81,6 +81,6 @@ jobs: - name: Run Pytest env: - DATABASE_URL: "postgres://scram:@localhost:5432/test_scram" + DATABASE_URL: "postgres://scram:@localhost:5432/test_scram_${{ matrix.python-version }}" REDIS_HOST: "localhost" run: pytest From 3bd52b62aa85d79827ced53ba8f66cb56315570d Mon Sep 17 00:00:00 2001 From: Vlad Grigorescu Date: Mon, 25 Nov 2024 15:42:16 -0600 Subject: [PATCH 06/22] Add per-version DB to migrations as well --- .github/workflows/pytest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index ddcba272..3815c066 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -59,7 +59,7 @@ jobs: - name: Apply unapplied migrations env: - DATABASE_URL: "postgres://scram:@localhost:5432/test_scram" + DATABASE_URL: "postgres://scram:@localhost:5432/test_scram_${{ matrix.python-version }}" run: | python manage.py makemigrations --noinput || true UNAPPLIED_MIGRATIONS=$(python manage.py showmigrations --plan | grep '\[ \]' | awk '{print $2}') From 60c09fa1ee053026d02f4c11ff8ebad3a933170f Mon Sep 17 00:00:00 2001 From: Vlad Grigorescu Date: Mon, 25 Nov 2024 15:48:12 -0600 Subject: [PATCH 07/22] Provide default value for USE_DOCKER --- config/settings/local.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/settings/local.py b/config/settings/local.py index de20d800..796db182 100644 --- a/config/settings/local.py +++ b/config/settings/local.py @@ -51,7 +51,7 @@ } # https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#internal-ips INTERNAL_IPS = ["127.0.0.1", "10.0.2.2"] -if env("USE_DOCKER") == "yes": +if env("USE_DOCKER", "no") == "yes": import socket hostname, _, ips = socket.gethostbyname_ex(socket.gethostname()) From 1ab1fe117e354661a08c76e13838bd9ed8120bb4 Mon Sep 17 00:00:00 2001 From: Vlad Grigorescu Date: Mon, 25 Nov 2024 15:48:24 -0600 Subject: [PATCH 08/22] Fail if we can't apply migrations --- .github/workflows/pytest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 3815c066..85ce4113 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -61,7 +61,7 @@ jobs: env: DATABASE_URL: "postgres://scram:@localhost:5432/test_scram_${{ matrix.python-version }}" run: | - python manage.py makemigrations --noinput || true + python manage.py makemigrations --noinput UNAPPLIED_MIGRATIONS=$(python manage.py showmigrations --plan | grep '\[ \]' | awk '{print $2}') if [ -n "$UNAPPLIED_MIGRATIONS" ]; then for migration in $UNAPPLIED_MIGRATIONS; do From 735d90f3f52fa6f928495a516966fa1094295e25 Mon Sep 17 00:00:00 2001 From: Vlad Grigorescu Date: Mon, 25 Nov 2024 15:56:38 -0600 Subject: [PATCH 09/22] Fix syntax of env --- config/settings/local.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/settings/local.py b/config/settings/local.py index 796db182..56029930 100644 --- a/config/settings/local.py +++ b/config/settings/local.py @@ -51,7 +51,7 @@ } # https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#internal-ips INTERNAL_IPS = ["127.0.0.1", "10.0.2.2"] -if env("USE_DOCKER", "no") == "yes": +if env("USE_DOCKER", default="no") == "yes": import socket hostname, _, ips = socket.gethostbyname_ex(socket.gethostname()) From a4961fb58b5359be9e97cfc0dadc60033dd90dce Mon Sep 17 00:00:00 2001 From: Vlad Grigorescu Date: Mon, 25 Nov 2024 16:03:58 -0600 Subject: [PATCH 10/22] Simplify migration logic --- .github/workflows/pytest.yml | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 85ce4113..c8dabaf8 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -57,26 +57,19 @@ jobs: pip install -r requirements/local.txt pip install pytest-github-actions-annotate-failures - - name: Apply unapplied migrations + - name: Apply migrations env: DATABASE_URL: "postgres://scram:@localhost:5432/test_scram_${{ matrix.python-version }}" run: | python manage.py makemigrations --noinput - UNAPPLIED_MIGRATIONS=$(python manage.py showmigrations --plan | grep '\[ \]' | awk '{print $2}') - if [ -n "$UNAPPLIED_MIGRATIONS" ]; then - for migration in $UNAPPLIED_MIGRATIONS; do - python manage.py migrate $migration --fake-initial --noinput - done - else - echo "No unapplied migrations." - fi + python manage.py migrate --noinput - name: Check for duplicate migrations run: | if python manage.py makemigrations --dry-run | grep "No changes detected"; then echo "No duplicate migrations detected." else - echo "Warning: Potential duplicate migrations detected. Please review." + echo "::warning:: Potential duplicate migrations detected. Please review." fi - name: Run Pytest From bbb9e2e726b3d468a77361252985d68f978be578 Mon Sep 17 00:00:00 2001 From: Vlad Grigorescu Date: Mon, 25 Nov 2024 16:07:31 -0600 Subject: [PATCH 11/22] Fix duplicate migration check --- .github/workflows/pytest.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index c8dabaf8..6da5db4e 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -65,6 +65,8 @@ jobs: python manage.py migrate --noinput - name: Check for duplicate migrations + env: + DATABASE_URL: "postgres://scram:@localhost:5432/test_scram_${{ matrix.python-version }}" run: | if python manage.py makemigrations --dry-run | grep "No changes detected"; then echo "No duplicate migrations detected." From e976033e514bc3af7a7624fa3a9a79a9fcaa58c9 Mon Sep 17 00:00:00 2001 From: Vlad Grigorescu Date: Mon, 25 Nov 2024 16:08:04 -0600 Subject: [PATCH 12/22] Turn Python/Postgres versions into variables --- compose/local/django/Dockerfile | 2 +- compose/local/docs/Dockerfile | 2 +- compose/production/django/Dockerfile | 3 +-- compose/production/postgres/Dockerfile | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/compose/local/django/Dockerfile b/compose/local/django/Dockerfile index 12ea411b..295a1869 100644 --- a/compose/local/django/Dockerfile +++ b/compose/local/django/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.12-slim-bookworm +FROM python:${PYTHON_IMAGE_VER:-3.12}-slim-bookworm ENV PIP_ROOT_USER_ACTION ignore ENV PYTHONUNBUFFERED 1 diff --git a/compose/local/docs/Dockerfile b/compose/local/docs/Dockerfile index 274d4829..15dd903f 100644 --- a/compose/local/docs/Dockerfile +++ b/compose/local/docs/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.12-slim-bookworm +FROM python:${PYTHON_IMAGE_VER:-3.12}-slim-bookworm ENV PIP_ROOT_USER_ACTION ignore ENV PYTHONUNBUFFERED 1 diff --git a/compose/production/django/Dockerfile b/compose/production/django/Dockerfile index cbb5aeb5..2a4680dc 100644 --- a/compose/production/django/Dockerfile +++ b/compose/production/django/Dockerfile @@ -1,5 +1,4 @@ - -FROM python:3.12-slim-bookwork +FROM python:${PYTHON_IMAGE_VER:-3.12}-slim-bookworm ENV PYTHONUNBUFFERED 1 diff --git a/compose/production/postgres/Dockerfile b/compose/production/postgres/Dockerfile index c4160f1e..d5a6ed39 100644 --- a/compose/production/postgres/Dockerfile +++ b/compose/production/postgres/Dockerfile @@ -1,4 +1,4 @@ -FROM postgres:12.3 +FROM postgres:${POSTGRES_IMAGE_VER:-12.3} COPY ./compose/production/postgres/maintenance /usr/local/bin/maintenance RUN chmod +x /usr/local/bin/maintenance/* From b477f18150f2274af250d5f8a1e2a72f2aabe593 Mon Sep 17 00:00:00 2001 From: Vlad Grigorescu Date: Mon, 25 Nov 2024 16:12:23 -0600 Subject: [PATCH 13/22] Try passing a Python version to behave --- .github/workflows/behave.yml | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/.github/workflows/behave.yml b/.github/workflows/behave.yml index 30d08b27..a2c4fde3 100644 --- a/.github/workflows/behave.yml +++ b/.github/workflows/behave.yml @@ -17,22 +17,10 @@ jobs: behave: name: Run Behave runs-on: ubuntu-latest - - services: - postgres: - image: postgres:latest - env: - POSTGRES_USER: scram - POSTGRES_PASSWORD: '' - POSTGRES_DB: test_scram - POSTGRES_HOST_AUTH_METHOD: trust - ports: - - 5432:5432 - options: >- - --health-cmd "pg_isready -U scram" - --health-interval 10s - --health-timeout 5s - --health-retries 5 + strategy: + max-parallel: 4 + matrix: + python-version: ['3.11'] steps: - name: Check out the code @@ -40,6 +28,7 @@ jobs: - name: Set up Docker uses: docker/setup-buildx-action@v3 + - name: Install Docker Compose run: | sudo apt-get update @@ -50,6 +39,8 @@ jobs: - name: Build Docker images run: make build + env: + PYTHON_IMAGE_VER: "${{ matrix.python-version }}" - name: Migrate Database run: make migrate @@ -84,7 +75,6 @@ jobs: with: minimum_coverage: '50' - - name: Check Docker state (post-test) if: always() run: docker ps From 66675730d4c3432bd16a043dc1e639b2e9582a98 Mon Sep 17 00:00:00 2001 From: Vlad Grigorescu Date: Mon, 25 Nov 2024 16:20:45 -0600 Subject: [PATCH 14/22] Now try 2 Python versions to behave --- .github/workflows/behave.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/behave.yml b/.github/workflows/behave.yml index a2c4fde3..1754b80a 100644 --- a/.github/workflows/behave.yml +++ b/.github/workflows/behave.yml @@ -20,7 +20,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: ['3.11'] + python-version: ['3.11', '3.12'] steps: - name: Check out the code From 425d03179146ac36637f425feefe5d7a1bc1a6ea Mon Sep 17 00:00:00 2001 From: Vlad Grigorescu Date: Mon, 25 Nov 2024 16:33:24 -0600 Subject: [PATCH 15/22] Only upload coverage for the latest version --- .github/workflows/behave.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/behave.yml b/.github/workflows/behave.yml index 1754b80a..dbf733f1 100644 --- a/.github/workflows/behave.yml +++ b/.github/workflows/behave.yml @@ -62,15 +62,18 @@ jobs: uses: jwalton/gh-docker-logs@v2 - name: Upload Coverage to Coveralls + if: matrix.python-version == '3.12' uses: coverallsapp/github-action@v2 - name: Upload Coverage to GitHub + if: matrix.python-version == '3.12' uses: actions/upload-artifact@v4 with: name: coverage-report path: coverage.xml - name: Display Coverage Metrics + if: matrix.python-version == '3.12' uses: 5monkeys/cobertura-action@v14 with: minimum_coverage: '50' From f270babdfaf4354a91f7b22efcf7095a9ac44a87 Mon Sep 17 00:00:00 2001 From: Vlad Grigorescu Date: Mon, 25 Nov 2024 16:54:36 -0600 Subject: [PATCH 16/22] Pass vars through to the build command --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8c3fac1f..036aac5d 100644 --- a/Makefile +++ b/Makefile @@ -37,7 +37,8 @@ behave-translator: compose.override.yml ## build: rebuilds all your containers or a single one if CONTAINER is specified .Phony: build build: compose.override.yml - @docker compose up -d --no-deps --build $(CONTAINER) + @docker compose build --build-arg PYTHON_IMAGE_VER=${PYTHON_IMAGE_VER} --build-arg POSTGRES_IMAGE_VER=${POSTGRES_IMAGE_VER} $(CONTAINER) + @docker compose up -d --no-deps $(CONTAINER) @docker compose restart $(CONTAINER) ## coverage.xml: generate coverage from test runs From f0b0c43eef3c42d9e19b9aded74a68cd81cdb695 Mon Sep 17 00:00:00 2001 From: Vlad Grigorescu Date: Mon, 25 Nov 2024 17:08:09 -0600 Subject: [PATCH 17/22] Fix Dockerfile args --- compose/local/django/Dockerfile | 4 +++- compose/local/docs/Dockerfile | 4 +++- compose/production/django/Dockerfile | 4 +++- compose/production/postgres/Dockerfile | 4 +++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/compose/local/django/Dockerfile b/compose/local/django/Dockerfile index 295a1869..aaba2ef9 100644 --- a/compose/local/django/Dockerfile +++ b/compose/local/django/Dockerfile @@ -1,4 +1,6 @@ -FROM python:${PYTHON_IMAGE_VER:-3.12}-slim-bookworm +ARG PYTHON_IMAGE_VER=3.12 + +FROM python:${PYTHON_IMAGE_VER}-slim-bookworm ENV PIP_ROOT_USER_ACTION ignore ENV PYTHONUNBUFFERED 1 diff --git a/compose/local/docs/Dockerfile b/compose/local/docs/Dockerfile index 15dd903f..49965c75 100644 --- a/compose/local/docs/Dockerfile +++ b/compose/local/docs/Dockerfile @@ -1,4 +1,6 @@ -FROM python:${PYTHON_IMAGE_VER:-3.12}-slim-bookworm +ARG PYTHON_IMAGE_VER=3.12 + +FROM python:${PYTHON_IMAGE_VER}-slim-bookworm ENV PIP_ROOT_USER_ACTION ignore ENV PYTHONUNBUFFERED 1 diff --git a/compose/production/django/Dockerfile b/compose/production/django/Dockerfile index 2a4680dc..84748126 100644 --- a/compose/production/django/Dockerfile +++ b/compose/production/django/Dockerfile @@ -1,4 +1,6 @@ -FROM python:${PYTHON_IMAGE_VER:-3.12}-slim-bookworm +ARG PYTHON_IMAGE_VER=3.12 + +FROM python:${PYTHON_IMAGE_VER}-slim-bookworm ENV PYTHONUNBUFFERED 1 diff --git a/compose/production/postgres/Dockerfile b/compose/production/postgres/Dockerfile index d5a6ed39..88f86a97 100644 --- a/compose/production/postgres/Dockerfile +++ b/compose/production/postgres/Dockerfile @@ -1,4 +1,6 @@ -FROM postgres:${POSTGRES_IMAGE_VER:-12.3} +ARG POSTGRES_IMAGE_VER=12.3 + +FROM postgres:${POSTGRES_IMAGE_VER} COPY ./compose/production/postgres/maintenance /usr/local/bin/maintenance RUN chmod +x /usr/local/bin/maintenance/* From 1f6021dd897e0f8dfed9d83c88838752d305031a Mon Sep 17 00:00:00 2001 From: Vlad Grigorescu Date: Mon, 25 Nov 2024 18:21:00 -0600 Subject: [PATCH 18/22] The variable was set in the Makefile, but set as an empty string --- Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 036aac5d..347eb58c 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,7 @@ +# It'd be nice to keep these in sync with the defaults of the Dockerfiles +PYTHON_IMAGE_VER ?= 3.12 +POSTGRES_IMAGE_VER ?= 12.3 + .DEFAULT_GOAL := help ## toggle-prod: configure make to use the production stack @@ -37,7 +41,7 @@ behave-translator: compose.override.yml ## build: rebuilds all your containers or a single one if CONTAINER is specified .Phony: build build: compose.override.yml - @docker compose build --build-arg PYTHON_IMAGE_VER=${PYTHON_IMAGE_VER} --build-arg POSTGRES_IMAGE_VER=${POSTGRES_IMAGE_VER} $(CONTAINER) + @docker compose build --build-arg PYTHON_IMAGE_VER=$(PYTHON_IMAGE_VER) --build-arg POSTGRES_IMAGE_VER=$(POSTGRES_IMAGE_VER) $(CONTAINER) @docker compose up -d --no-deps $(CONTAINER) @docker compose restart $(CONTAINER) From 7363da84df11f254409690947f7ad783a4d51dd2 Mon Sep 17 00:00:00 2001 From: Vlad Grigorescu Date: Mon, 25 Nov 2024 18:31:18 -0600 Subject: [PATCH 19/22] Add a behave test for the next version of Python (expected to fail) --- .github/workflows/behave_next_python.yml | 75 +++++++++++++++++++ ...ture_pytest.yml => pytest_next_python.yml} | 2 +- 2 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/behave_next_python.yml rename .github/workflows/{future_pytest.yml => pytest_next_python.yml} (99%) diff --git a/.github/workflows/behave_next_python.yml b/.github/workflows/behave_next_python.yml new file mode 100644 index 00000000..1b031392 --- /dev/null +++ b/.github/workflows/behave_next_python.yml @@ -0,0 +1,75 @@ +--- +name: Run behave + +on: + push: + branches: + - '**' + pull_request: + branches: + - main + - develop + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + behave_next_python: + name: Run Behave + runs-on: ubuntu-latest + strategy: + max-parallel: 4 + matrix: + python-version: ['3.13'] + + steps: + - name: Check out the code + uses: actions/checkout@v4 + + - name: Set up Docker + uses: docker/setup-buildx-action@v3 + + - name: Install Docker Compose + run: | + sudo apt-get update + sudo apt-get install -y docker-compose make + + - name: Check Docker state (pre-build) + run: docker ps + + - name: Build Docker images + run: make build + env: + PYTHON_IMAGE_VER: "${{ matrix.python-version }}" + + - name: Migrate Database + run: make migrate + + - name: Run Application + run: make run + + - name: Check Docker state (pre-test) + run: docker ps + + - name: Run pytest + behave with Coverage + env: + POSTGRES_USER: scram + POSTGRES_DB: test_scram + run: | + make coverage.xml || echo "::warning:: Failed on future Python version ${{ matrix.python-version }}." + + - name: Dump docker logs on failure + if: failure() + uses: jwalton/gh-docker-logs@v2 + + - name: Check Docker state (post-test) + if: always() + run: docker ps + + - name: Stop Services + if: always() + run: make stop + + - name: Clean Up + if: always() + run: make clean diff --git a/.github/workflows/future_pytest.yml b/.github/workflows/pytest_next_python.yml similarity index 99% rename from .github/workflows/future_pytest.yml rename to .github/workflows/pytest_next_python.yml index 58e1803b..b5240677 100644 --- a/.github/workflows/future_pytest.yml +++ b/.github/workflows/pytest_next_python.yml @@ -14,7 +14,7 @@ on: workflow_dispatch: jobs: - pytest: + pytest_next_python: name: Run Pytest runs-on: ubuntu-latest strategy: From 2ab3376164ca2c0de24903c46b66cc72e1a4f362 Mon Sep 17 00:00:00 2001 From: Vlad Grigorescu Date: Mon, 25 Nov 2024 19:03:58 -0600 Subject: [PATCH 20/22] Bump pyscopg2 to support Python 3.13 --- requirements/local.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/local.txt b/requirements/local.txt index 2712cf7e..134a2213 100644 --- a/requirements/local.txt +++ b/requirements/local.txt @@ -2,7 +2,7 @@ Werkzeug[watchdog]==2.0.3 # https://github.com/pallets/werkzeug ipdb==0.13.9 # https://github.com/gotcha/ipdb -psycopg2-binary==2.9.3 # https://github.com/psycopg/psycopg2 +psycopg2-binary==2.9.10 # https://github.com/psycopg/psycopg2 watchgod==0.8.2 # https://github.com/samuelcolvin/watchgod # Testing From c560d9051f58fdae88e523f4973bb946c309207c Mon Sep 17 00:00:00 2001 From: Vlad Grigorescu Date: Mon, 25 Nov 2024 19:29:16 -0600 Subject: [PATCH 21/22] Try to allow failing test to move forward --- .github/workflows/behave_next_python.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/behave_next_python.yml b/.github/workflows/behave_next_python.yml index 1b031392..03ba2daa 100644 --- a/.github/workflows/behave_next_python.yml +++ b/.github/workflows/behave_next_python.yml @@ -43,10 +43,12 @@ jobs: PYTHON_IMAGE_VER: "${{ matrix.python-version }}" - name: Migrate Database - run: make migrate + run: | + make migrate || echo "::warning:: migrate failed on future Python version ${{ matrix.python-version }}." - name: Run Application - run: make run + run: | + make run || echo "::warning:: run failed on future Python version ${{ matrix.python-version }}." - name: Check Docker state (pre-test) run: docker ps @@ -56,7 +58,7 @@ jobs: POSTGRES_USER: scram POSTGRES_DB: test_scram run: | - make coverage.xml || echo "::warning:: Failed on future Python version ${{ matrix.python-version }}." + make coverage.xml || echo "::warning:: pytest + behave failed on future Python version ${{ matrix.python-version }}." - name: Dump docker logs on failure if: failure() From 8d3ec24f849adc6a7a98d22e6c7ec8cbdcda7dc4 Mon Sep 17 00:00:00 2001 From: Vlad Grigorescu Date: Tue, 26 Nov 2024 08:44:13 -0600 Subject: [PATCH 22/22] Provide better name for behave --- .github/workflows/behave_next_python.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/behave_next_python.yml b/.github/workflows/behave_next_python.yml index 03ba2daa..1c4b1a3c 100644 --- a/.github/workflows/behave_next_python.yml +++ b/.github/workflows/behave_next_python.yml @@ -1,5 +1,5 @@ --- -name: Run behave +name: Run behave with unsupported Python versions on: push: