Skip to content

Commit 89309cd

Browse files
authored
build: only run unit tests during Kokoro builds (#929)
1 parent e75267a commit 89309cd

File tree

10 files changed

+9
-35
lines changed

10 files changed

+9
-35
lines changed

.kokoro/build.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR}/service-account.json
2121
export PROJECT_ID=$(cat "${KOKORO_GFILE_DIR}/project-id.json")
2222
export GOOGLE_CLOUD_PROJECT=$(cat "${KOKORO_GFILE_DIR}/project-id.json")
2323

24-
export RUNNING_SPANNER_BACKEND_TESTS=1
24+
export RUNNING_SPANNER_BACKEND_TESTS=0
2525

2626
if [[ $KOKORO_JOB_NAME == *"docs"* ]]
2727
then
@@ -33,7 +33,7 @@ then
3333
python3 -m pip install --upgrade --quiet nox
3434
# Generate docs.
3535
python3 -m nox -s docs docfx
36-
else
36+
elif [[ $RUNNING_SPANNER_BACKEND_TESTS == 1 ]]; then
3737
pip3 install .
3838
export DJANGO_TESTS_DIR="django_tests_dir"
3939
mkdir -p $DJANGO_TESTS_DIR && git clone --depth 1 --single-branch --branch "django/stable/2.2.x" https://github.com/googleapis/python-spanner-django.git $DJANGO_TESTS_DIR/django
@@ -57,4 +57,7 @@ else
5757
fi
5858

5959
python3 ./run_testing_worker.py
60+
else
61+
echo "Running unit tests"
62+
nox -s unit
6063
fi

.kokoro/presubmit/worker_0.cfg

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

.kokoro/presubmit/worker_1.cfg

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

.kokoro/presubmit/worker_2.cfg

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

.kokoro/presubmit/worker_3.cfg

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

.kokoro/presubmit/worker_4.cfg

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

.kokoro/presubmit/worker_5.cfg

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

.kokoro/presubmit/worker_6.cfg

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

.kokoro/presubmit/worker_7.cfg

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

django_spanner/features.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ class DatabaseFeatures(BaseDatabaseFeatures):
437437
# Spanner does not support SELECTing an arbitrary expression that also
438438
# appears in the GROUP BY clause.
439439
"annotations.tests.NonAggregateAnnotationTestCase.test_grouping_by_q_expression_annotation",
440-
# Tests that expect it to be empty untill saved in db.
440+
# Tests that expect it to be empty until saved in db.
441441
"test_utils.test_testcase.TestDataTests.test_class_attribute_identity",
442442
"model_fields.test_jsonfield.TestSerialization.test_dumping",
443443
"model_fields.test_jsonfield.TestSerialization.test_dumping",
@@ -558,6 +558,9 @@ class DatabaseFeatures(BaseDatabaseFeatures):
558558
"backends.base.test_base.DatabaseWrapperLoggingTests.test_commit_debug_log",
559559
"backends.base.test_base.DatabaseWrapperLoggingTests.test_rollback_debug_log",
560560
"backends.base.test_base.MultiDatabaseTests.test_multi_database_init_connection_state_called_once",
561+
# Spanner does not support automatic coercion from float64 to int64
562+
"lookup.tests.LookupQueryingTests.test_annotate_greater_than_or_equal_float",
563+
"lookup.tests.LookupQueryingTests.test_annotate_less_than_float",
561564
)
562565

563566
if os.environ.get("SPANNER_EMULATOR_HOST", None):

0 commit comments

Comments
 (0)