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

Commit ad22f5f

Browse files
author
Ilya Gurov
authored
refactor: Erase excess code in build scripts (#591)
1 parent 03adf65 commit ad22f5f

3 files changed

Lines changed: 1 addition & 42 deletions

File tree

.kokoro/build.sh

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,8 @@ cd github/python-spanner-django
2020
# Disable buffering, so that the logs stream through.
2121
export PYTHONUNBUFFERED=1
2222

23-
# Debug: show build environment
24-
env | grep KOKORO
25-
2623
# Setup service account credentials.
2724
export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR}/service-account.json
28-
29-
# Setup project id.
3025
export PROJECT_ID=$(cat "${KOKORO_GFILE_DIR}/project-id.json")
3126
export GOOGLE_CLOUD_PROJECT=$(cat "${KOKORO_GFILE_DIR}/project-id.json")
3227

@@ -45,18 +40,9 @@ else
4540
python3.6 -m nox
4641
fi
4742

48-
# Export essential environment variables for Django tests.
4943
export RUNNING_SPANNER_BACKEND_TESTS=1
5044

51-
# The emulator is currently unusable for our tests because:
52-
# a) It doesn't support INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE
53-
# b) Cannot accept parameters whose types aren't known, so can't be used for
54-
# Python and other dynamic languages.
55-
export USE_SPANNER_EMULATOR=0
56-
5745
pip3 install .
58-
# Create a unique DJANGO_TESTS_DIR per worker to avoid
59-
# any clashes with configured tests by other workers.
6046
export DJANGO_TESTS_DIR="django_tests_dir"
6147
mkdir -p $DJANGO_TESTS_DIR && git clone --depth 1 --single-branch --branch spanner-2.2.x https://github.com/timgraham/django.git $DJANGO_TESTS_DIR/django
6248

@@ -65,7 +51,6 @@ sudo apt-get update
6551
apt-get install -y libffi-dev libjpeg-dev zlib1g-dev libmemcached-dev
6652
cd $DJANGO_TESTS_DIR/django && pip3 install -e . && pip3 install -r tests/requirements/py3.txt; cd ../../
6753

68-
# Not using the emulator!
6954
# Hardcode the max number of workers since Spanner has a very low
7055
# QPS for administrative RPCs of 5QPS (averaged every 100 seconds)
7156
if [[ $KOKORO_JOB_NAME == *"continuous"* ]]

.kokoro/ensure_instance_exists.py

Lines changed: 0 additions & 23 deletions
This file was deleted.

django_test_suite.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,8 @@ TEST_DBNAME=${SPANNER_TEST_DB:-$(python3 -c 'import os, time; print(chr(ord("a")
3737
TEST_DBNAME_OTHER="$TEST_DBNAME-ot"
3838
INSTANCE=${SPANNER_TEST_INSTANCE:-django-tests}
3939
PROJECT=${PROJECT_ID}
40-
SPANNER_EMULATOR_HOST=${SPANNER_EMULATOR_HOST}
41-
GOOGLE_CLOUD_PROJECT=${GOOGLE_CLOUD_PROJECT}
4240
SETTINGS_FILE="$TEST_DBNAME-settings"
4341
TESTS_DIR=${DJANGO_TESTS_DIR:-django_tests}
44-
TEST_APPS=${DJANGO_TEST_APPS}
4542

4643
create_settings() {
4744
cat << ! > "$SETTINGS_FILE.py"
@@ -69,4 +66,4 @@ PASSWORD_HASHERS = [
6966
cd $TESTS_DIR/django/tests
7067
create_settings
7168

72-
python3 runtests.py $TEST_APPS --verbosity=3 --noinput --settings $SETTINGS_FILE
69+
python3 runtests.py $DJANGO_TEST_APPS --verbosity=3 --noinput --settings $SETTINGS_FILE

0 commit comments

Comments
 (0)