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

Commit 4a23973

Browse files
author
IlyaFaer
committed
re-run
1 parent 1dbc429 commit 4a23973

3 files changed

Lines changed: 17 additions & 24 deletions

File tree

.github/workflows/django_tests_against_emulator.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ jobs:
2828
SPANNER_EMULATOR_HOST: localhost:9010
2929
GOOGLE_CLOUD_PROJECT: emulator-test-project
3030
GOOGLE_CLOUD_TESTS_CREATE_SPANNER_INSTANCE: true
31+
RUNNING_SPANNER_BACKEND_TESTS: 1
3132
DJANGO_WORKER_INDEX: 0
3233
DJANGO_WORKER_COUNT: 1
3334
SPANNER_TEST_INSTANCE: google-cloud-django-backend-tests

django_spanner/features.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -326,17 +326,13 @@ class DatabaseFeatures(BaseDatabaseFeatures):
326326
"model_formsets.tests.ModelFormsetTest.test_prevent_change_outer_model_and_create_invalid_data",
327327
"model_formsets_regress.tests.FormfieldShouldDeleteFormTests.test_no_delete",
328328
"model_formsets_regress.tests.FormsetTests.test_extraneous_query_is_not_run",
329+
# os.chmod() doesn't work on Kokoro?
330+
"file_uploads.tests.DirectoryCreationTests.test_readonly_root",
331+
# Tests that sometimes fail on Kokoro for unknown reasons.
332+
"contenttypes_tests.test_models.ContentTypesTests.test_cache_not_shared_between_managers",
333+
"migration_test_data_persistence.tests.MigrationDataNormalPersistenceTestCase.test_persistence",
334+
"servers.test_liveserverthread.LiveServerThreadTest.test_closes_connections",
329335
)
330-
# Kokoro-specific skips.
331-
if os.environ.get("KOKORO_JOB_NAME"):
332-
skip_tests += (
333-
# os.chmod() doesn't work on Kokoro?
334-
"file_uploads.tests.DirectoryCreationTests.test_readonly_root",
335-
# Tests that sometimes fail on Kokoro for unknown reasons.
336-
"contenttypes_tests.test_models.ContentTypesTests.test_cache_not_shared_between_managers",
337-
"migration_test_data_persistence.tests.MigrationDataNormalPersistenceTestCase.test_persistence",
338-
"servers.test_liveserverthread.LiveServerThreadTest.test_closes_connections",
339-
)
340336

341337
if os.environ.get("SPANNER_EMULATOR_HOST", None):
342338
# Some code isn't yet supported by the Spanner emulator.

django_test_suite.sh

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,22 @@ set -x pipefail
99
# Disable buffering, so that the logs stream through.
1010
export PYTHONUNBUFFERED=1
1111

12-
# Export essential environment variables for Django tests.
13-
export RUNNING_SPANNER_BACKEND_TESTS=1
12+
sudo apt-get update -y
13+
sudo apt-get install -y libmemcached-dev
1414

1515
pip3 install .
1616
pip3 uninstall -y google-cloud-spanner
17+
pip3 uninstall -y django-google-spanner
1718
pip3 install -e 'git+https://github.com/q-logic/python-spanner.git@autocommit_change#egg=google-cloud-spanner'
19+
pip3 install -e 'git+https://github.com/q-logic/python-spanner-django.git@dj_tests_against_emulator#egg=django-google-spanner'
1820

19-
# Create a unique DJANGO_TESTS_DIR per worker to avoid
20-
# any clashes with configured tests by other workers.
21-
export DJANGO_TESTS_DIR="django_tests_$DJANGO_WORKER_INDEX"
21+
export DJANGO_TESTS_DIR="django_tests_dir"
2222
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
2323

2424
# Install dependencies for Django tests.
2525
sudo apt-get update
26-
apt-get install -y libffi-dev libjpeg-dev zlib1g-dev libmemcached-dev
26+
sudo apt-get install -y libffi-dev libjpeg-dev zlib1g-devel
27+
2728
cd $DJANGO_TESTS_DIR/django && pip3 install -e . && pip3 install -r tests/requirements/py3.txt; cd ../../
2829

2930
python3 create_test_instance.py
@@ -65,11 +66,6 @@ PASSWORD_HASHERS = [
6566
!
6667
}
6768

68-
run_django_tests() {
69-
cd $TESTS_DIR/django/tests
70-
create_settings
71-
echo -e "\033[32mRunning Django tests: $TEST_APPS\033[00m"
72-
python3 runtests.py $TEST_APPS --verbosity=2 --noinput --settings $SETTINGS_FILE
73-
}
74-
75-
run_django_tests
69+
cd $TESTS_DIR/django/tests
70+
create_settings
71+
python3 runtests.py admin_changelist admin_docs admin_filters admin_inlines admin_ordering admin_utils admin_views aggregation aggregation_regress annotations auth_tests backends basic bulk_create cache choices constraints contenttypes_tests custom_columns custom_lookups custom_managers custom_methods custom_pk datatypes dates datetimes db_functions defer defer_regress delete delete_regress distinct_on_fields empty expressions expressions_case expressions_window extra_regress field_defaults file_storage file_uploads filtered_relation fixtures fixtures_model_package fixtures_regress flatpages_tests force_insert_update foreign_object forms_tests from_db_value generic_inline_admin generic_relations generic_relations_regress generic_views get_earliest_or_latest get_object_or_404 get_or_create i18n indexes inline_formsets inspectdb introspection invalid_models_tests 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 many_to_many many_to_one many_to_one_null max_lengths migrate_signals migrations migration_test_data_persistence modeladmin model_fields model_forms model_formsets model_formsets_regress model_indexes model_inheritance model_inheritance_regress model_options model_package model_regress multiple_database mutually_referential nested_foreign_keys null_fk null_fk_ordering null_queries one_to_one ordering order_with_respect_to or_lookups prefetch_related proxy_model_inheritance proxy_models queries queryset_pickle raw_query redirects_tests reserved_names reverse_lookup save_delete_hooks schema select_for_update select_related select_related_onetoone select_related_regress serializers servers sessions_tests signals sitemaps_tests sites_framework sites_tests string_lookup syndication_tests test_client test_client_regress test_runner test_utils timezones transaction_hooks transactions unmanaged_models update update_only_fields validation view_tests --verbosity=3 --noinput --settings $SETTINGS_FILE

0 commit comments

Comments
 (0)