Skip to content

Commit d4d444a

Browse files
committed
Merge branch 'main' into improve_stuck_system_tests
2 parents 3e74b19 + 5ecfe0a commit d4d444a

7,328 files changed

Lines changed: 591873 additions & 1502846 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/django-spanner-django5.2_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
3232
with:
3333
persist-credentials: false
34-
- uses: dorny/paths-filter@d1c1ffe0248fe513906c8e24db8ea791d46f8590 # v3
34+
- uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
3535
id: filter
3636
with:
3737
filters: |
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
permissions:
2+
contents: read
3+
4+
on:
5+
pull_request:
6+
paths:
7+
- 'packages/django-google-spanner/**'
8+
- '.github/workflows/django-spanner-django6.0_tests.yml'
9+
push:
10+
branches:
11+
- main
12+
paths:
13+
- 'packages/django-google-spanner/**'
14+
- '.github/workflows/django-spanner-django6.0_tests.yml'
15+
16+
defaults:
17+
run:
18+
working-directory: packages/django-google-spanner
19+
20+
name: django-spanner-django6.0-tests
21+
jobs:
22+
check_changes:
23+
runs-on: ubuntu-latest
24+
outputs:
25+
run_django_spanner: ${{ steps.filter.outputs.django_spanner }}
26+
steps:
27+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
28+
with:
29+
persist-credentials: false
30+
- uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
31+
id: filter
32+
with:
33+
filters: |
34+
django_spanner:
35+
- 'packages/django-google-spanner/**'
36+
- '.github/workflows/django-spanner-django6.0_tests.yml'
37+
38+
system-tests:
39+
needs: check_changes
40+
if: ${{ needs.check_changes.outputs.run_django_spanner == 'true' }}
41+
runs-on: ubuntu-latest
42+
strategy:
43+
fail-fast: false
44+
matrix:
45+
chunk: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
46+
include:
47+
- chunk: 0
48+
apps: admin_changelist admin_ordering distinct_on_fields expressions_window fixtures_model_package datetimes custom_methods generic_inline_admin field_defaults datatypes empty m2o_recursive many_to_one_null migrate_signals model_forms.test_uuid view_tests update select_related_onetoone sessions_tests
49+
- chunk: 1
50+
apps: db_functions save_delete_hooks get_object_or_404 model_indexes custom_pk indexes transaction_hooks constraints schema custom_columns i18n from_db_value sites_tests mutually_referential model_package defer_regress update_only_fields backends redirects_tests expressions get_or_create foreign_object generic_relations_regress many_to_many select_related generic_relations queryset_pickle model_inheritance
51+
- chunk: 2
52+
apps: model_options known_related_objects m2m_signals delete_regress fixtures generic_views model_inheritance_regress nested_foreign_keys lookup delete model_formsets
53+
- chunk: 3
54+
apps: signals or_lookups m2m_through_regress filtered_relation servers m2m_through fixtures_regress timezones model_forms.tests
55+
- chunk: 4
56+
apps: introspection multiple_database null_fk_ordering ordering m2m_intermediary null_fk max_lengths dates force_insert_update test_client m2m_multiple test_client_regress sitemaps_tests admin_inlines transactions null_queries test_runner m2m_and_m2o prefetch_related m2m_regress file_uploads sites_framework auth_tests forms_tests inline_formsets order_with_respect_to contenttypes_tests defer
57+
- chunk: 5
58+
apps: file_storage m2m_recursive reverse_lookup managers_regress basic annotations unmanaged_models string_lookup aggregation_regress reserved_names select_for_update many_to_one cache select_related_regress flatpages_tests model_formsets_regress
59+
- chunk: 6
60+
apps: model_fields queries.test_bulk_update queries.test_explain
61+
- chunk: 7
62+
apps: queries.test_iterator queries.test_q queries.test_query queries.test_qs_combinators
63+
- chunk: 8
64+
apps: inspectdb custom_managers migrations validation get_earliest_or_latest proxy_model_inheritance one_to_one raw_query bulk_create
65+
- chunk: 9
66+
apps: queries.tests
67+
68+
services:
69+
emulator:
70+
image: gcr.io/cloud-spanner-emulator/emulator:latest # zizmor: ignore[unpinned-images]
71+
ports:
72+
- 9010:9010
73+
74+
steps:
75+
- name: Checkout code
76+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
77+
with:
78+
persist-credentials: false
79+
- name: Setup Python
80+
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
81+
with:
82+
python-version: "3.12"
83+
- name: Run Django tests
84+
run: sh django_test_suite_6.0.sh
85+
env:
86+
SPANNER_EMULATOR_HOST: localhost:9010
87+
GOOGLE_CLOUD_PROJECT: emulator-test-project
88+
GOOGLE_CLOUD_TESTS_CREATE_SPANNER_INSTANCE: true
89+
RUNNING_SPANNER_BACKEND_TESTS: 1
90+
SPANNER_TEST_INSTANCE: google-cloud-django-backend-tests
91+
DJANGO_TEST_APPS: ${{ matrix.apps }}

.github/workflows/django-spanner-foreign_keys.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ jobs:
3939
needs: check_changes
4040
if: ${{ needs.check_changes.outputs.run_django_spanner == 'true' }}
4141
runs-on: ubuntu-latest
42+
strategy:
43+
fail-fast: false
44+
matrix:
45+
python-version: ["3.10", "3.12"]
4246

4347
services:
4448
emulator-0:
@@ -54,7 +58,7 @@ jobs:
5458
- name: Setup Python
5559
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
5660
with:
57-
python-version: "3.10"
61+
python-version: ${{ matrix.python-version }}
5862
- name: Run Django foreign key test
5963
run: sh foreign_key_test.sh
6064
env:

.github/workflows/django-spanner-integration-tests-against-emulator-3.10.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ jobs:
3939
needs: check_changes
4040
if: ${{ needs.check_changes.outputs.run_django_spanner == 'true' }}
4141
runs-on: ubuntu-latest
42+
strategy:
43+
fail-fast: false
44+
matrix:
45+
python-version: ["3.10", "3.12"]
4246

4347
services:
4448
emulator:
@@ -52,14 +56,14 @@ jobs:
5256
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
5357
with:
5458
persist-credentials: false
55-
- name: Set up Python 3.10
59+
- name: Set up Python ${{ matrix.python-version }}
5660
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
5761
with:
58-
python-version: "3.10"
62+
python-version: ${{ matrix.python-version }}
5963
- name: Install nox
6064
run: python -m pip install nox
6165
- name: Run nox
62-
run: nox -s unit-3.10
66+
run: nox -s "unit-${{ matrix.python-version }}"
6367
env:
6468
SPANNER_EMULATOR_HOST: localhost:9010
6569
GOOGLE_CLOUD_PROJECT: emulator-test-project

.github/workflows/unittest.yml

Lines changed: 73 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,33 @@ jobs:
4040
# Each weight is roughly 1 minute of expected execution time
4141
# Default for unset packages is 1
4242
PACKAGE_WEIGHTS: |
43-
google-ai-generativelanguage: 4
44-
google-auth: 5
43+
django-google-spanner: 2
44+
gapic-generator: 3
45+
google-ai-generativelanguage: 3
46+
google-api-core: 2
47+
google-auth: 2
48+
google-cloud-bigquery: 4
49+
google-cloud-bigquery-storage: 2
50+
google-cloud-bigtable: 4
4551
google-cloud-compute: 12
4652
google-cloud-compute-v1beta: 12
47-
google-cloud-dialogflow: 6
48-
google-cloud-dialogflow-cx: 6
49-
google-cloud-discoveryengine: 8
50-
google-cloud-retail: 5
51-
google-shopping-merchant-accounts: 4
53+
google-cloud-datastore: 3
54+
google-cloud-dialogflow: 4
55+
google-cloud-dialogflow-cx: 4
56+
google-cloud-discoveryengine: 4
57+
google-cloud-firestore: 3
58+
google-cloud-logging: 3
59+
google-cloud-monitoring: 3
60+
google-cloud-ndb: 2
61+
google-cloud-pubsub: 2
62+
google-cloud-retail: 3
63+
google-cloud-spanner: 4
64+
google-cloud-storage: 4
65+
google-shopping-merchant-accounts: 3
66+
pandas-gbq: 2
67+
proto-plus: 1
68+
sqlalchemy-bigquery: 2
69+
sqlalchemy-spanner: 2
5270
steps:
5371
- name: Checkout
5472
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
@@ -156,12 +174,52 @@ jobs:
156174
path: .coverage.${{ matrix.python }}.*
157175
include-hidden-files: true
158176

177+
core-deps:
178+
needs: initialize
179+
if: needs.initialize.outputs.matrix != '[]' && needs.initialize.outputs.matrix != ''
180+
runs-on: ubuntu-22.04
181+
strategy:
182+
fail-fast: true
183+
matrix:
184+
python: ["3.14"]
185+
package_shard: ${{ fromJson(needs.initialize.outputs.matrix) }}
186+
name: ${{ matrix.package_shard.is_sharded && format('core-deps handwritten ({0}, {1})', matrix.python, matrix.package_shard.name) || format('core-deps handwritten ({0})', matrix.python) }}
187+
steps:
188+
- name: Checkout
189+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
190+
# Use a fetch-depth of 2 to avoid error `fatal: origin/main...HEAD: no merge base`
191+
# See https://github.com/googleapis/google-cloud-python/issues/12013
192+
# and https://github.com/actions/checkout#checkout-head.
193+
with:
194+
fetch-depth: 2
195+
persist-credentials: false
196+
- name: Setup Python
197+
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
198+
with:
199+
python-version: ${{ matrix.python }}
200+
cache: 'pip'
201+
allow-prereleases: true
202+
- name: Install nox
203+
run: |
204+
pip install nox
205+
- name: Run core_deps_from_source for ${{ matrix.package_shard.description }}
206+
env:
207+
BUILD_TYPE: presubmit
208+
TARGET_BRANCH: ${{ github.base_ref || github.event.merge_group.base_ref }}
209+
TEST_TYPE: core_deps_from_source
210+
PY_VERSION: ${{ matrix.python }}
211+
PACKAGE_LIST: ${{ matrix.package_shard.packages }}
212+
NOX_DEFAULT_VENV_BACKEND: "virtualenv"
213+
NOXFORCEPYTHON: ${{ matrix.python }}
214+
run: |
215+
ci/run_conditional_tests.sh
216+
159217
all-tests:
160-
needs: [initialize, unit]
218+
needs: [initialize, unit, core-deps]
161219
if: always()
162220
runs-on: ubuntu-latest
163221
steps:
164-
- name: Check unit test results
222+
- name: Check test results
165223
run: |
166224
# 1. Check initialize job
167225
if [[ "${{ needs.initialize.result }}" != "success" ]]; then
@@ -173,7 +231,12 @@ jobs:
173231
echo "Unit tests failed"
174232
exit 1
175233
fi
176-
echo "All unit tests passed or were skipped"
234+
# 3. Check core dependencies test shards
235+
if [[ "${{ needs.core-deps.result }}" != "success" && "${{ needs.core-deps.result }}" != "skipped" ]]; then
236+
echo "Core dependencies tests failed"
237+
exit 1
238+
fi
239+
echo "All unit and core dependencies tests passed or were skipped"
177240
178241
cover:
179242
if: always() && !cancelled() && needs.all-tests.result == 'success'
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Format: //devtools/kokoro/config/proto/build.proto
2+
3+
# Only run compliance nox session.
4+
env_vars: {
5+
key: "NOX_SESSION"
6+
value: "compliance"
7+
}

.kokoro/presubmit/system.cfg

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,9 @@ env_vars: {
55
key: "NOX_SESSION"
66
value: "system-3.12"
77
}
8+
9+
# Skip compliance tests in system job since they run in dedicated compliance job
10+
env_vars: {
11+
key: "RUN_COMPLIANCE_TESTS"
12+
value: "false"
13+
}

.kokoro/system.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,12 @@ for path in `find 'packages' \
286286
files_to_check=("${package_path}")
287287
fi
288288

289+
# When running compliance tests, only test packages that have compliance suites
290+
if [[ "${NOX_SESSION:-}" == "compliance"* && "${package_name:-}" != "sqlalchemy-"* ]]; then
291+
printf "SKIP %-20s %-40s %s\n" "[not_applicable]" "${package_name}" "${commit_hash:-HEAD}"
292+
continue
293+
fi
294+
289295
set +e
290296
# Passing the array expanded as arguments to git diff.
291297
package_modified=$(git diff "${KOKORO_GITHUB_PULL_REQUEST_TARGET_BRANCH}...${KOKORO_GITHUB_PULL_REQUEST_COMMIT}" -- "${files_to_check[@]}" | wc -l)

.librarian/generator-input/client-post-processing/add-dependency-google-cloud-common.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ replacements:
1919
]
2020
before: |
2121
dependencies = \[
22-
"google-api-core\[grpc\] >= 2.25.0, <3.0.0",
22+
"google-api-core\[grpc\] >= 2.28.0, <3.0.0",
2323
# Exclude incompatible versions of `google-auth`
2424
# See https://github.com/googleapis/google-cloud-python/issues/12364
2525
"google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0",
2626
"grpcio >= 1.59.0, < 2.0.0",
2727
after: |
2828
dependencies = [
29-
"google-api-core[grpc] >= 2.25.0, <3.0.0",
29+
"google-api-core[grpc] >= 2.28.0, <3.0.0",
3030
# Exclude incompatible versions of `google-auth`
3131
# See https://github.com/googleapis/google-cloud-python/issues/12364
3232
"google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0",

0 commit comments

Comments
 (0)