forked from mozilla/code-review
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: Run tests against Postgres on CI
- Loading branch information
Showing
1 changed file
with
33 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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: "" } | ||
|
@@ -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 | ||
|
||
|
@@ -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 | ||
|