From 7363da84df11f254409690947f7ad783a4d51dd2 Mon Sep 17 00:00:00 2001
From: Vlad Grigorescu <vlad@es.net>
Date: Mon, 25 Nov 2024 18:31:18 -0600
Subject: [PATCH] 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 0000000..1b03139
--- /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 58e1803..b524067 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: