-
Notifications
You must be signed in to change notification settings - Fork 31
test: run Django tests against Spanner emulator #559
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
a031f35
test: move Django tests to emulator (#27)
dc8eeb0
cleanup
b9f35de
rename checks
1e2f9f4
install from git
0cd1022
re-run
ca44c22
re-run
53d151f
re-run
c569293
delete compiler
6150e1c
re-run
1d85f80
don't change delete compiler
cfbcd34
re-run
6e408ef
revert debug changes
1dbc429
re-run
4a23973
re-run
45fd22f
900
9dc1c13
re-run
3b5cef2
try splitting tests
70e2e77
more splits
00f42f0
parallel
9dee14b
use several emulator
c1ac815
create instance in every thread
e7a3aac
use 8 threads
4c9daf2
skip tests, which are using unsupported types
93eb7fa
re-run
e7e89fd
fix typo
993ea34
Merge branch 'master' into dj_tests_against_emulator
c24t eaf5374
Fix typos in test runner script
c24t 1c35b27
use unique instance names
f0c9808
Merge branch 'dj_tests_against_emulator' of https://github.com/q-logi…
8989939
revert
3c4c468
separate instances
82855cb
re-run
548a532
revert
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,61 @@ | ||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
name: django-tests | ||
jobs: | ||
system-tests: | ||
runs-on: ubuntu-latest | ||
|
||
services: | ||
emulator-0: | ||
image: gcr.io/cloud-spanner-emulator/emulator:latest | ||
ports: | ||
- 9010:9010 | ||
emulator-1: | ||
image: gcr.io/cloud-spanner-emulator/emulator:latest | ||
ports: | ||
- 9011:9010 | ||
emulator-2: | ||
image: gcr.io/cloud-spanner-emulator/emulator:latest | ||
ports: | ||
- 9012:9010 | ||
emulator-3: | ||
image: gcr.io/cloud-spanner-emulator/emulator:latest | ||
ports: | ||
- 9013:9010 | ||
emulator-4: | ||
image: gcr.io/cloud-spanner-emulator/emulator:latest | ||
ports: | ||
- 9014:9010 | ||
emulator-5: | ||
image: gcr.io/cloud-spanner-emulator/emulator:latest | ||
ports: | ||
- 9015:9010 | ||
emulator-6: | ||
image: gcr.io/cloud-spanner-emulator/emulator:latest | ||
ports: | ||
- 9016:9010 | ||
emulator-7: | ||
image: gcr.io/cloud-spanner-emulator/emulator:latest | ||
ports: | ||
- 9017:9010 | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Setup Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
- name: Run Django tests | ||
run: sh django_test_suite.sh | ||
IlyaFaer marked this conversation as resolved.
Show resolved
Hide resolved
|
||
env: | ||
SPANNER_EMULATOR_HOST: localhost:9010 | ||
GOOGLE_CLOUD_PROJECT: emulator-test-project | ||
GOOGLE_CLOUD_TESTS_CREATE_SPANNER_INSTANCE: true | ||
RUNNING_SPANNER_BACKEND_TESTS: 1 | ||
DJANGO_WORKER_INDEX: 0 | ||
DJANGO_WORKER_COUNT: 1 | ||
IlyaFaer marked this conversation as resolved.
Show resolved
Hide resolved
|
||
SPANNER_TEST_INSTANCE: google-cloud-django-backend-tests |
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Copyright 2016 Google LLC All rights reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
import os | ||
|
||
from google.cloud.spanner_v1 import Client | ||
|
||
|
||
client = Client( | ||
project=os.getenv("GOOGLE_CLOUD_PROJECT", "emulator-test-project") | ||
) | ||
|
||
instance = client.instance("google-cloud-django-backend-tests") | ||
created_op = instance.create() | ||
created_op.result(30) # block until completion | ||
IlyaFaer marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.