Skip to content

Commit

Permalink
Merge pull request #4025 from mathesar-foundation/api_scenario_tests
Browse files Browse the repository at this point in the history
Add scenario testing framework, initial test
  • Loading branch information
Anish9901 authored Nov 20, 2024
2 parents cbabca3 + 26e7c5d commit 2fec79b
Show file tree
Hide file tree
Showing 7 changed files with 483 additions and 7 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/test-and-lint-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,30 @@ jobs:
- name: Run tests with pg_prove
run: docker exec mathesar_dev_db /bin/bash /sql/run_tests.sh

api_tests:
name: Run API scenario tests
runs-on: ubuntu-latest
needs: [python_tests_required, all_be_tests_required]
if: needs.python_tests_required.outputs.tests_should_run == 'true' ||
needs.all_be_tests_required.outputs.tests_should_run
strategy:
matrix:
py-version: [3.9-bookworm, 3.10-bookworm, 3.11-bookworm, 3.12-bookworm, 3.13-bookworm]
pg-version: [13, 14, 15, 16, 17]
steps:
- uses: actions/checkout@v4
- name: Copy env file
run: cp .env.example .env
# The code is checked out under uid 1001 - reset this to 1000 for the
# container to run tests successfully
- name: Fix permissions
run: sudo chown -R 1000:1000 .
- name: Run tests
run: sh run_api_tests.sh
env:
PYTHON_VERSION: ${{ matrix.py-version }}
PG_VERSION: ${{ matrix.pg-version }}

python_lint:
name: Run Python linter
runs-on: ubuntu-latest
Expand Down
5 changes: 5 additions & 0 deletions api_tests/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ARG PYTHON_VERSION=3.9-bookworm
FROM python:$PYTHON_VERSION
WORKDIR /code/
COPY . .
RUN pip install -r requirements.txt
2 changes: 2 additions & 0 deletions api_tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
requests==2.32.3
pytest==8.3.3
Loading

0 comments on commit 2fec79b

Please sign in to comment.