Skip to content

Commit

Permalink
WIP: Run tests against Postgres on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
vrigal committed Oct 18, 2024
1 parent fe2cd09 commit 6cd281a
Showing 1 changed file with 33 additions and 4 deletions.
37 changes: 33 additions & 4 deletions .taskcluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ tasks:
owner: [email protected]
source: https://github.com/mozilla/code-review

- taskId: { $eval: as_slugid("backend_check_tests") }
- taskId: { $eval: as_slugid("backend_check_tests_sqlite") }
provisionerId: "${provisionerId}"
workerType: "${workerType}"
created: { $fromNow: "" }
Expand All @@ -204,8 +204,36 @@ tasks:
cd /src/backend && ${pip_install} . && ${pip_install} -r requirements-dev.txt &&
./manage.py test"
metadata:
name: "Code Review Backend checks: unit tests"
description: Check python code with Django tests
name: "Code Review Backend checks: unit tests (SQLite)"
description: Check python code with Django tests (SQLite)
owner: [email protected]
source: https://github.com/mozilla/code-review

- taskId: { $eval: as_slugid("backend_check_tests_postgres") }
provisionerId: "${provisionerId}"
workerType: "${workerType}"
created: { $fromNow: "" }
deadline: { $fromNow: "1 hour" }
payload:
maxRunTime: 3600
image: "postgres:16-alpine"
env:
POSTGRES_USER: devuser
POSTGRES_PASSWORD: devdata
POSTGRES_DB: code_review_dev
command:
- sh
- -lxce
- "apk add --no-cache python3~${python_version} py3-pip &&
apk add --no-cache git &&
apk add --no-cache rust cargo &&
git clone --quiet ${repository} /src && cd /src && git checkout ${head_rev} -b checks &&
cd /src/tools && ${pip_install} . &&
cd /src/backend && ${pip_install} . && pip install --disable-pip-version-check --quiet -r requirements-dev.txt &&
DATABASE_URL=psql://devuser:devdata@localhost/code_review_dev ./manage.py test"
metadata:
name: "Code Review Backend checks: unit tests (PostgreSQL)"
description: Check python code with Django tests (PostgreSQL)
owner: [email protected]
source: https://github.com/mozilla/code-review

Expand Down Expand Up @@ -274,7 +302,8 @@ tasks:
workerType: "${workerType}"
dependencies:
- { $eval: as_slugid("check_lint") }
- { $eval: as_slugid("backend_check_tests") }
- { $eval: as_slugid("backend_check_tests_sqlite") }
- { $eval: as_slugid("backend_check_tests_postgres") }
payload:
capabilities:
privileged: true
Expand Down

0 comments on commit 6cd281a

Please sign in to comment.