Skip to content

Commit

Permalink
Add e2e tests to CI #11
Browse files Browse the repository at this point in the history
  • Loading branch information
joelvdavies committed Sep 25, 2024
1 parent 6a499d4 commit 5d6b1ed
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/.ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,35 @@ jobs:

- name: Run unit tests
run: pytest -c test/pytest.ini test/unit/ --cov

e2e-tests:
needs: [unit-tests]
name: End-to-End Tests
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Set up Python
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
with:
python-version: "3.12"
cache: "pip"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .[test]
python -m pip install -r requirements.txt
- name: Create logging configuration file
run: cp object_storage_api/logging.example.ini object_storage_api/logging.ini

# Sleep 10 seconds to give time for containers to start and for the buckets to be created
- name: Start MongoDB and MinIO
run: |
docker compose up -d mongo-db minio minio_create_buckets
sleep 10
- name: Run e2e tests
run: pytest -c test/pytest.ini test/e2e/ --cov
4 changes: 2 additions & 2 deletions test/mock_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

ATTACHMENT_POST_DATA_REQUIRED_VALUES_ONLY = {
"entity_id": str(ObjectId()),
"file_name": "report.pdf",
"file_name": "report.txt",
}

ATTACHMENT_POST_RESPONSE_DATA_REQUIRED_VALUES_ONLY = {
Expand All @@ -42,7 +42,7 @@

ATTACHMENT_POST_DATA_ALL_VALUES = {
"entity_id": str(ObjectId()),
"file_name": "report.pdf",
"file_name": "report.txt",
"title": "Report Title",
"description": "A damage report.",
}
Expand Down

0 comments on commit 5d6b1ed

Please sign in to comment.