From 2c903de2429a42f2d682cbc8eab658e27324684b Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Thu, 28 May 2026 21:02:35 +0000 Subject: [PATCH 1/6] tests: remove hardcoded packages in system.sh --- .kokoro/system.sh | 37 +++++++++---------------------------- 1 file changed, 9 insertions(+), 28 deletions(-) diff --git a/.kokoro/system.sh b/.kokoro/system.sh index 25892de44843..2235c4693ec7 100755 --- a/.kokoro/system.sh +++ b/.kokoro/system.sh @@ -90,35 +90,9 @@ run_package_test() { return $res } -packages_with_system_tests=( - "bigframes" - "google-auth" - "google-cloud-bigquery-storage" - "google-cloud-bigtable" - "google-cloud-compute" - "google-cloud-compute-v1beta" - "google-cloud-datastore" - "google-cloud-dns" - "google-cloud-error-reporting" - "google-cloud-firestore" - "google-cloud-logging" - "google-cloud-ndb" - "google-cloud-pubsub" - "google-cloud-spanner" - "google-cloud-storage" - "google-cloud-testutils" - "pandas-gbq" - "sqlalchemy-bigquery" - "sqlalchemy-spanner" -) - # A file for running system tests system_test_script="${PROJECT_ROOT}/.kokoro/system-single.sh" -# Join array elements with | for the pattern match -packages_with_system_tests_pattern=$(printf "|*%s*" "${packages_with_system_tests[@]}") -packages_with_system_tests_pattern="${packages_with_system_tests_pattern:1}" # Remove the leading pipe - # Run system tests for each package with directory packages/*/tests/system for path in `find 'packages' \ \( -type d -wholename 'packages/*/tests/system' \) -o \ @@ -142,8 +116,15 @@ for path in `find 'packages' \ "${package_path}/**/version.py" ) - # If the package is in our "always run full system tests" list, check the whole directory - if [[ $package_name == @($packages_with_system_tests_pattern) ]]; then + # Hand-written (non-GAPIC_AUTO) packages or google-cloud-compute should check + # the whole directory for changes. + metadata="${package_path}/.repo-metadata.json" + library_type="UNKNOWN" + if [ -f "$metadata" ]; then + library_type=$(grep -oP '"library_type":\s*"\K[^"]+' "$metadata" || echo "UNKNOWN") + fi + + if [[ "${library_type}" != "GAPIC_AUTO" || "${package_name}" == "google-cloud-compute"* ]]; then files_to_check=("${package_path}") fi From 7325cded21c1ae0f36b65f28b8f6ae702b9fd3e2 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Thu, 28 May 2026 17:05:58 -0400 Subject: [PATCH 2/6] for testing purposes --- packages/google-cloud-bigquery/mypy.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/google-cloud-bigquery/mypy.ini b/packages/google-cloud-bigquery/mypy.ini index a3cb5c292172..52667821e17b 100644 --- a/packages/google-cloud-bigquery/mypy.ini +++ b/packages/google-cloud-bigquery/mypy.ini @@ -1,3 +1,4 @@ [mypy] python_version = 3.14 namespace_packages = True + From a510e632cb682535b4546d051492282fa385dcf7 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Thu, 28 May 2026 17:09:27 -0400 Subject: [PATCH 3/6] Apply suggestions from code review Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- .kokoro/system.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.kokoro/system.sh b/.kokoro/system.sh index 2235c4693ec7..d32ec55dd689 100755 --- a/.kokoro/system.sh +++ b/.kokoro/system.sh @@ -121,7 +121,8 @@ for path in `find 'packages' \ metadata="${package_path}/.repo-metadata.json" library_type="UNKNOWN" if [ -f "$metadata" ]; then - library_type=$(grep -oP '"library_type":\s*"\K[^"]+' "$metadata" || echo "UNKNOWN") + library_type=$(sed -n 's/.*"library_type":[[:space:]]*"\([^"]*\)".*/\1/p' "$metadata") + library_type="${library_type:-UNKNOWN}" fi if [[ "${library_type}" != "GAPIC_AUTO" || "${package_name}" == "google-cloud-compute"* ]]; then From 203f5113be9457ca1c70382daaab9d8638a9cd71 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Thu, 28 May 2026 17:13:02 -0400 Subject: [PATCH 4/6] add comment --- .kokoro/system.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.kokoro/system.sh b/.kokoro/system.sh index d32ec55dd689..0611dfbe4b12 100755 --- a/.kokoro/system.sh +++ b/.kokoro/system.sh @@ -125,6 +125,9 @@ for path in `find 'packages' \ library_type="${library_type:-UNKNOWN}" fi + # Automated GAPIC libraries bypass system tests in PRs because their generation is deterministic. + # However, google-cloud-compute is included because its Discovery-based nature requires additional + # verification. if [[ "${library_type}" != "GAPIC_AUTO" || "${package_name}" == "google-cloud-compute"* ]]; then files_to_check=("${package_path}") fi From 8f67dbd189a99e0ddabb9c68d6330f9ee78bc7ed Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Thu, 28 May 2026 17:14:16 -0400 Subject: [PATCH 5/6] add comment --- .kokoro/system.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.kokoro/system.sh b/.kokoro/system.sh index 0611dfbe4b12..469d0e81c7fa 100755 --- a/.kokoro/system.sh +++ b/.kokoro/system.sh @@ -125,7 +125,8 @@ for path in `find 'packages' \ library_type="${library_type:-UNKNOWN}" fi - # Automated GAPIC libraries bypass system tests in PRs because their generation is deterministic. + # System tests always run in release PRs, regardless of library type. + # Automated GAPIC libraries bypass system tests in non-release PRs because their generation is deterministic. # However, google-cloud-compute is included because its Discovery-based nature requires additional # verification. if [[ "${library_type}" != "GAPIC_AUTO" || "${package_name}" == "google-cloud-compute"* ]]; then From 41c6eee242ab2ad8ecc1329a37f635c16b868956 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Thu, 28 May 2026 17:16:16 -0400 Subject: [PATCH 6/6] revert --- packages/google-cloud-bigquery/mypy.ini | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/google-cloud-bigquery/mypy.ini b/packages/google-cloud-bigquery/mypy.ini index 52667821e17b..a3cb5c292172 100644 --- a/packages/google-cloud-bigquery/mypy.ini +++ b/packages/google-cloud-bigquery/mypy.ini @@ -1,4 +1,3 @@ [mypy] python_version = 3.14 namespace_packages = True -