From e2456166b44796f62d27eb8238031a83f0b6cc85 Mon Sep 17 00:00:00 2001 From: hasslesstech Date: Fri, 27 Mar 2026 16:34:12 +0200 Subject: [PATCH] [P] Integrate additional store testing into CI pipeline --- .gitea/workflows/tests.yaml | 9 +++++++++ store/Dockerfile-test | 1 + store/test-entry.sh | 1 + 3 files changed, 11 insertions(+) diff --git a/.gitea/workflows/tests.yaml b/.gitea/workflows/tests.yaml index a6536df..57701ca 100644 --- a/.gitea/workflows/tests.yaml +++ b/.gitea/workflows/tests.yaml @@ -28,6 +28,10 @@ jobs: - name: Clone repository run: git clone --revision ${{ gitea.sha }} --depth 1 ${{ gitea.server_url }}/${{ gitea.repository }} + - name: Start postgres_db container for testing + working-directory: IoT-Systems + run: docker-compose up -d postgres_db + - name: Build Store testing container working-directory: IoT-Systems run: docker build -t local/store/${{gitea.sha}} -f store/Dockerfile-test . @@ -40,6 +44,11 @@ jobs: if: ${{always()}} run: docker image rm local/store/${{gitea.sha}} + - name: Clean up docker-compose + if: ${{always()}} + working-directory: IoT-Systems + run: docker-compose down -v --remove-orphans + integration-smoke-test: name: Integration smoke testing runs-on: host-arch-x86_64 diff --git a/store/Dockerfile-test b/store/Dockerfile-test index 3435d40..4728200 100644 --- a/store/Dockerfile-test +++ b/store/Dockerfile-test @@ -6,6 +6,7 @@ WORKDIR /app COPY store/requirements.txt . RUN pip install --no-cache-dir -r requirements.txt +RUN pip install --root-user-action ignore --no-cache-dir pytest httpx # Copy the entire application into the container COPY store/. . # Run the main.py script inside the container when it starts diff --git a/store/test-entry.sh b/store/test-entry.sh index 433e709..76c5ef3 100755 --- a/store/test-entry.sh +++ b/store/test-entry.sh @@ -1,3 +1,4 @@ #!/bin/sh PYTHONPATH=$PWD python3 test/main_test.py +PYTHONPATH=$PWD python3 -m pytest test_db.py