Skip to content
This repository was archived by the owner on Mar 20, 2026. It is now read-only.

Commit 3cb51a6

Browse files
author
Ilya Gurov
authored
test: use parallel workflows to run Django tests (#569)
Move emulator and non-emulator tests into separate workflows, split emulator tests across multiple github workflows, disable several tests that are incompatible with the Cloud Spanner API.
1 parent d8453c7 commit 3cb51a6

27 files changed

Lines changed: 807 additions & 191 deletions
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
on:
2+
push:
3+
branches:
4+
- master
5+
pull_request:
6+
name: django-tests0
7+
jobs:
8+
system-tests:
9+
runs-on: ubuntu-latest
10+
11+
services:
12+
emulator-0:
13+
image: gcr.io/cloud-spanner-emulator/emulator:latest
14+
ports:
15+
- 9010:9010
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v2
20+
- name: Setup Python
21+
uses: actions/setup-python@v2
22+
with:
23+
python-version: 3.8
24+
- name: Run Django tests
25+
run: sh django_test_suite.sh
26+
env:
27+
SPANNER_EMULATOR_HOST: localhost:9010
28+
GOOGLE_CLOUD_PROJECT: emulator-test-project
29+
GOOGLE_CLOUD_TESTS_CREATE_SPANNER_INSTANCE: true
30+
RUNNING_SPANNER_BACKEND_TESTS: 1
31+
SPANNER_TEST_INSTANCE: google-cloud-django-backend-tests
32+
DJANGO_TEST_APPS: model_fields model_forms
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
on:
2+
push:
3+
branches:
4+
- master
5+
pull_request:
6+
name: django-tests1
7+
jobs:
8+
system-tests:
9+
runs-on: ubuntu-latest
10+
11+
services:
12+
emulator-0:
13+
image: gcr.io/cloud-spanner-emulator/emulator:latest
14+
ports:
15+
- 9010:9010
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v2
20+
- name: Setup Python
21+
uses: actions/setup-python@v2
22+
with:
23+
python-version: 3.8
24+
- name: Run Django tests
25+
run: sh django_test_suite.sh
26+
env:
27+
SPANNER_EMULATOR_HOST: localhost:9010
28+
GOOGLE_CLOUD_PROJECT: emulator-test-project
29+
GOOGLE_CLOUD_TESTS_CREATE_SPANNER_INSTANCE: true
30+
RUNNING_SPANNER_BACKEND_TESTS: 1
31+
SPANNER_TEST_INSTANCE: google-cloud-django-backend-tests
32+
DJANGO_TEST_APPS: mutually_referential nested_foreign_keys null_fk null_fk_ordering null_queries one_to_one ordering order_with_respect_to or_lookups
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
on:
2+
push:
3+
branches:
4+
- master
5+
pull_request:
6+
name: django-tests10
7+
jobs:
8+
system-tests:
9+
runs-on: ubuntu-latest
10+
11+
services:
12+
emulator-0:
13+
image: gcr.io/cloud-spanner-emulator/emulator:latest
14+
ports:
15+
- 9010:9010
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v2
20+
- name: Setup Python
21+
uses: actions/setup-python@v2
22+
with:
23+
python-version: 3.8
24+
- name: Run Django tests
25+
run: sh django_test_suite.sh
26+
env:
27+
SPANNER_EMULATOR_HOST: localhost:9010
28+
GOOGLE_CLOUD_PROJECT: emulator-test-project
29+
GOOGLE_CLOUD_TESTS_CREATE_SPANNER_INSTANCE: true
30+
RUNNING_SPANNER_BACKEND_TESTS: 1
31+
SPANNER_TEST_INSTANCE: google-cloud-django-backend-tests
32+
DJANGO_TEST_APPS: select_related select_related_onetoone select_related_regress queryset_pickle
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
on:
2+
push:
3+
branches:
4+
- master
5+
pull_request:
6+
name: django-tests11
7+
jobs:
8+
system-tests:
9+
runs-on: ubuntu-latest
10+
11+
services:
12+
emulator-0:
13+
image: gcr.io/cloud-spanner-emulator/emulator:latest
14+
ports:
15+
- 9010:9010
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v2
20+
- name: Setup Python
21+
uses: actions/setup-python@v2
22+
with:
23+
python-version: 3.8
24+
- name: Run Django tests
25+
run: sh django_test_suite.sh
26+
env:
27+
SPANNER_EMULATOR_HOST: localhost:9010
28+
GOOGLE_CLOUD_PROJECT: emulator-test-project
29+
GOOGLE_CLOUD_TESTS_CREATE_SPANNER_INSTANCE: true
30+
RUNNING_SPANNER_BACKEND_TESTS: 1
31+
SPANNER_TEST_INSTANCE: google-cloud-django-backend-tests
32+
DJANGO_TEST_APPS: transaction_hooks transactions unmanaged_models update update_only_fields validation admin_changelist admin_docs view_tests many_to_many many_to_one many_to_one_null
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
on:
2+
push:
3+
branches:
4+
- master
5+
pull_request:
6+
name: django-tests12
7+
jobs:
8+
system-tests:
9+
runs-on: ubuntu-latest
10+
11+
services:
12+
emulator-0:
13+
image: gcr.io/cloud-spanner-emulator/emulator:latest
14+
ports:
15+
- 9010:9010
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v2
20+
- name: Setup Python
21+
uses: actions/setup-python@v2
22+
with:
23+
python-version: 3.8
24+
- name: Run Django tests
25+
run: sh django_test_suite.sh
26+
env:
27+
SPANNER_EMULATOR_HOST: localhost:9010
28+
GOOGLE_CLOUD_PROJECT: emulator-test-project
29+
GOOGLE_CLOUD_TESTS_CREATE_SPANNER_INSTANCE: true
30+
RUNNING_SPANNER_BACKEND_TESTS: 1
31+
SPANNER_TEST_INSTANCE: google-cloud-django-backend-tests
32+
DJANGO_TEST_APPS: aggregation_regress annotations auth_tests backends basic bulk_create cache choices constraints
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
on:
2+
push:
3+
branches:
4+
- master
5+
pull_request:
6+
name: django-tests13
7+
jobs:
8+
system-tests:
9+
runs-on: ubuntu-latest
10+
11+
services:
12+
emulator-0:
13+
image: gcr.io/cloud-spanner-emulator/emulator:latest
14+
ports:
15+
- 9010:9010
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v2
20+
- name: Setup Python
21+
uses: actions/setup-python@v2
22+
with:
23+
python-version: 3.8
24+
- name: Run Django tests
25+
run: sh django_test_suite.sh
26+
env:
27+
SPANNER_EMULATOR_HOST: localhost:9010
28+
GOOGLE_CLOUD_PROJECT: emulator-test-project
29+
GOOGLE_CLOUD_TESTS_CREATE_SPANNER_INSTANCE: true
30+
RUNNING_SPANNER_BACKEND_TESTS: 1
31+
SPANNER_TEST_INSTANCE: google-cloud-django-backend-tests
32+
DJANGO_TEST_APPS: delete delete_regress distinct_on_fields empty expressions expressions_window field_defaults file_storage file_uploads filtered_relation
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
on:
2+
push:
3+
branches:
4+
- master
5+
pull_request:
6+
name: django-tests14
7+
jobs:
8+
system-tests:
9+
runs-on: ubuntu-latest
10+
11+
services:
12+
emulator-0:
13+
image: gcr.io/cloud-spanner-emulator/emulator:latest
14+
ports:
15+
- 9010:9010
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v2
20+
- name: Setup Python
21+
uses: actions/setup-python@v2
22+
with:
23+
python-version: 3.8
24+
- name: Run Django tests
25+
run: sh django_test_suite.sh
26+
env:
27+
SPANNER_EMULATOR_HOST: localhost:9010
28+
GOOGLE_CLOUD_PROJECT: emulator-test-project
29+
GOOGLE_CLOUD_TESTS_CREATE_SPANNER_INSTANCE: true
30+
RUNNING_SPANNER_BACKEND_TESTS: 1
31+
SPANNER_TEST_INSTANCE: google-cloud-django-backend-tests
32+
DJANGO_TEST_APPS: foreign_object forms_tests from_db_value generic_inline_admin generic_relations generic_relations_regress
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
on:
2+
push:
3+
branches:
4+
- master
5+
pull_request:
6+
name: django-tests15
7+
jobs:
8+
system-tests:
9+
runs-on: ubuntu-latest
10+
11+
services:
12+
emulator-0:
13+
image: gcr.io/cloud-spanner-emulator/emulator:latest
14+
ports:
15+
- 9010:9010
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v2
20+
- name: Setup Python
21+
uses: actions/setup-python@v2
22+
with:
23+
python-version: 3.8
24+
- name: Run Django tests
25+
run: sh django_test_suite.sh
26+
env:
27+
SPANNER_EMULATOR_HOST: localhost:9010
28+
GOOGLE_CLOUD_PROJECT: emulator-test-project
29+
GOOGLE_CLOUD_TESTS_CREATE_SPANNER_INSTANCE: true
30+
RUNNING_SPANNER_BACKEND_TESTS: 1
31+
SPANNER_TEST_INSTANCE: google-cloud-django-backend-tests
32+
DJANGO_TEST_APPS: known_related_objects lookup m2m_and_m2o m2m_intermediary m2m_multiple m2m_recursive m2m_regress m2m_signals m2m_through m2m_through_regress m2o_recursive managers_regress
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
on:
2+
push:
3+
branches:
4+
- master
5+
pull_request:
6+
name: django-tests16
7+
jobs:
8+
system-tests:
9+
runs-on: ubuntu-latest
10+
11+
services:
12+
emulator-0:
13+
image: gcr.io/cloud-spanner-emulator/emulator:latest
14+
ports:
15+
- 9010:9010
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v2
20+
- name: Setup Python
21+
uses: actions/setup-python@v2
22+
with:
23+
python-version: 3.8
24+
- name: Run Django tests
25+
run: sh django_test_suite.sh
26+
env:
27+
SPANNER_EMULATOR_HOST: localhost:9010
28+
GOOGLE_CLOUD_PROJECT: emulator-test-project
29+
GOOGLE_CLOUD_TESTS_CREATE_SPANNER_INSTANCE: true
30+
RUNNING_SPANNER_BACKEND_TESTS: 1
31+
SPANNER_TEST_INSTANCE: google-cloud-django-backend-tests
32+
DJANGO_TEST_APPS: model_formsets model_formsets_regress model_indexes
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
on:
2+
push:
3+
branches:
4+
- master
5+
pull_request:
6+
name: django-tests17
7+
jobs:
8+
system-tests:
9+
runs-on: ubuntu-latest
10+
11+
services:
12+
emulator-0:
13+
image: gcr.io/cloud-spanner-emulator/emulator:latest
14+
ports:
15+
- 9010:9010
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v2
20+
- name: Setup Python
21+
uses: actions/setup-python@v2
22+
with:
23+
python-version: 3.8
24+
- name: Run Django tests
25+
run: sh django_test_suite.sh
26+
env:
27+
SPANNER_EMULATOR_HOST: localhost:9010
28+
GOOGLE_CLOUD_PROJECT: emulator-test-project
29+
GOOGLE_CLOUD_TESTS_CREATE_SPANNER_INSTANCE: true
30+
RUNNING_SPANNER_BACKEND_TESTS: 1
31+
SPANNER_TEST_INSTANCE: google-cloud-django-backend-tests
32+
DJANGO_TEST_APPS: servers sessions_tests signals

0 commit comments

Comments
 (0)