From ddb44095756b27483140d3cfa62dea917fd0c450 Mon Sep 17 00:00:00 2001 From: Daniel Sanche Date: Fri, 14 Aug 2026 13:17:32 -0700 Subject: [PATCH 01/10] improved log output --- ci/run_conditional_tests.sh | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/ci/run_conditional_tests.sh b/ci/run_conditional_tests.sh index 241de51a4f88..df832f5e3c27 100755 --- a/ci/run_conditional_tests.sh +++ b/ci/run_conditional_tests.sh @@ -74,21 +74,34 @@ run_test_in_dir() { local log_file="/tmp/test_log_${PY_VERSION}_${pkg_name_clean}.log" export COVERAGE_FILE="${PROJECT_ROOT}/.coverage.${PY_VERSION}.${pkg_name_clean}" + echo "============================================================" + echo "Starting tests in ${d}" + echo "============================================================" + pushd ${d} > /dev/null set +e - ${test_script} > "${log_file}" 2>&1 - local ret=$? + if [ "${PARALLEL_WORKERS}" -eq 1 ]; then + # When running with a single worker, stream output in real-time while capturing to log file + ${test_script} 2>&1 | tee "${log_file}" + local ret=${PIPESTATUS[0]} + else + # When running multiple workers in parallel, buffer output to prevent interleaved log lines + ${test_script} > "${log_file}" 2>&1 + local ret=$? + echo "============================================================" + echo "Finished tests in ${d} (exit code: ${ret})" + echo "============================================================" + cat "${log_file}" + fi set -e popd > /dev/null - - echo "============================================================" - echo "Running tests in ${d}" - echo "============================================================" - cat "${log_file}" rm -f "${log_file}" if [ ${ret} -ne 0 ]; then + echo "❌ Tests failed in ${d} with exit code ${ret}" exit ${ret} + else + echo "✅ Tests passed in ${d}" fi } export -f run_test_in_dir From d92ef0957431f233628852dfb9664205897a0ae3 Mon Sep 17 00:00:00 2001 From: Daniel Sanche Date: Fri, 14 Aug 2026 13:18:05 -0700 Subject: [PATCH 02/10] mock metrics in unit tests --- .../google-cloud-bigtable/tests/unit/conftest.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/google-cloud-bigtable/tests/unit/conftest.py b/packages/google-cloud-bigtable/tests/unit/conftest.py index 59ff118aa71f..55b24cf6980b 100644 --- a/packages/google-cloud-bigtable/tests/unit/conftest.py +++ b/packages/google-cloud-bigtable/tests/unit/conftest.py @@ -13,6 +13,7 @@ # limitations under the License. import asyncio +import mock import pytest @@ -35,3 +36,14 @@ def provide_loop_to_sync_grpc_tests(): asyncio.set_event_loop(None) else: yield + + +@pytest.fixture(autouse=True) +def mock_bigtable_metrics_service_client(): + """ + Globally mock MetricServiceClient across all unit tests to avoid starting + real gRPC transports, resolving credentials, or sending telemetry to GCP. + """ + with mock.patch("google.cloud.monitoring_v3.MetricServiceClient") as mock_client: + yield mock_client + From 1b0095eb969ef4c6109aa35c02f00f8603636c07 Mon Sep 17 00:00:00 2001 From: Daniel Sanche Date: Fri, 14 Aug 2026 13:18:21 -0700 Subject: [PATCH 03/10] close handler after init test --- .../_metrics/test_gcp_exporter_handler.py | 30 +++++++++++-------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/packages/google-cloud-bigtable/tests/unit/data/_metrics/test_gcp_exporter_handler.py b/packages/google-cloud-bigtable/tests/unit/data/_metrics/test_gcp_exporter_handler.py index 6aa608ab3314..2c81e5f6173b 100644 --- a/packages/google-cloud-bigtable/tests/unit/data/_metrics/test_gcp_exporter_handler.py +++ b/packages/google-cloud-bigtable/tests/unit/data/_metrics/test_gcp_exporter_handler.py @@ -53,12 +53,15 @@ def test_ctor_defaults(self, mock_auth): GoogleCloudMetricsHandler, "_generate_client_uid" ) as uid_mock: handler = self._make_one(expected_exporter) - assert isinstance(handler.meter_provider, MeterProvider) - assert isinstance(handler.otel, _OpenTelemetryInstruments) - assert ( - handler.shared_labels["client_name"] == f"python-bigtable/{CLIENT_VERSION}" - ) - assert handler.shared_labels["client_uid"] == uid_mock() + try: + assert isinstance(handler.meter_provider, MeterProvider) + assert isinstance(handler.otel, _OpenTelemetryInstruments) + assert ( + handler.shared_labels["client_name"] == f"python-bigtable/{CLIENT_VERSION}" + ) + assert handler.shared_labels["client_uid"] == uid_mock() + finally: + handler.close() @mock.patch("google.auth.default", return_value=(mock.Mock(), "project")) def test_ctor_explicit(self, mock_auth): @@ -70,12 +73,15 @@ def test_ctor_explicit(self, mock_auth): client_uid=expected_uid, client_version=expected_version, ) - assert handler.otel == _OpenTelemetryInstruments() or handler.otel is not None - assert ( - handler.shared_labels["client_name"] - == f"python-bigtable/{expected_version}" - ) - assert handler.shared_labels["client_uid"] == expected_uid + try: + assert handler.otel == _OpenTelemetryInstruments() or handler.otel is not None + assert ( + handler.shared_labels["client_name"] + == f"python-bigtable/{expected_version}" + ) + assert handler.shared_labels["client_uid"] == expected_uid + finally: + handler.close() @mock.patch( "google.cloud.bigtable.data._metrics.handlers.gcp_exporter.PeriodicExportingMetricReader" From 8be6d714b568de492f16564c91eb07ad2d50423b Mon Sep 17 00:00:00 2001 From: Daniel Sanche Date: Fri, 14 Aug 2026 13:30:57 -0700 Subject: [PATCH 04/10] close handlers instead of global mock --- .../tests/unit/conftest.py | 12 -------- .../tests/unit/data/_async/test_client.py | 29 ++++++++++++------- .../unit/data/_sync_autogen/test_client.py | 2 +- 3 files changed, 19 insertions(+), 24 deletions(-) diff --git a/packages/google-cloud-bigtable/tests/unit/conftest.py b/packages/google-cloud-bigtable/tests/unit/conftest.py index 55b24cf6980b..59ff118aa71f 100644 --- a/packages/google-cloud-bigtable/tests/unit/conftest.py +++ b/packages/google-cloud-bigtable/tests/unit/conftest.py @@ -13,7 +13,6 @@ # limitations under the License. import asyncio -import mock import pytest @@ -36,14 +35,3 @@ def provide_loop_to_sync_grpc_tests(): asyncio.set_event_loop(None) else: yield - - -@pytest.fixture(autouse=True) -def mock_bigtable_metrics_service_client(): - """ - Globally mock MetricServiceClient across all unit tests to avoid starting - real gRPC transports, resolving credentials, or sending telemetry to GCP. - """ - with mock.patch("google.cloud.monitoring_v3.MetricServiceClient") as mock_client: - yield mock_client - diff --git a/packages/google-cloud-bigtable/tests/unit/data/_async/test_client.py b/packages/google-cloud-bigtable/tests/unit/data/_async/test_client.py index 86ae5f9b78ab..addb1f56b042 100644 --- a/packages/google-cloud-bigtable/tests/unit/data/_async/test_client.py +++ b/packages/google-cloud-bigtable/tests/unit/data/_async/test_client.py @@ -93,7 +93,7 @@ def set_event_loop(): asyncio.set_event_loop(None) -@pytest.fixture(autouse=True) +@pytest.fixture(autouse=True, scope="module") def mock_metrics_batch_write(): """mock out the metrics batch write to avoid sending metrics to GCP during tests.""" with mock.patch( @@ -102,6 +102,7 @@ def mock_metrics_batch_write(): yield + @CrossSync.convert_class( sync_name="TestBigtableDataClient", add_mapping_for_name="TestBigtableDataClient", @@ -302,8 +303,11 @@ async def test_veneer_grpc_headers(self, exporter_mock, exporter_mock_sync): def test__start_background_channel_refresh_sync(self): # should raise RuntimeError if called in a sync context client = self._make_client(project="project-id", use_emulator=False) - with pytest.raises(RuntimeError): - client._start_background_channel_refresh() + try: + with pytest.raises(RuntimeError): + client._start_background_channel_refresh() + finally: + client._metrics.close() @CrossSync.pytest async def test__start_background_channel_refresh_task_exists(self): @@ -1143,14 +1147,17 @@ def test_client_ctor_sync(self): with pytest.warns(RuntimeWarning) as warnings: client = self._make_client(project="project-id", use_emulator=False) - expected_warning = [w for w in warnings if "client.py" in w.filename] - assert len(expected_warning) == 1 - assert ( - "BigtableDataClientAsync should be started in an asyncio event loop." - in str(expected_warning[0].message) - ) - assert client.project == "project-id" - assert client._channel_refresh_task is None + try: + expected_warning = [w for w in warnings if "client.py" in w.filename] + assert len(expected_warning) == 1 + assert ( + "BigtableDataClientAsync should be started in an asyncio event loop." + in str(expected_warning[0].message) + ) + assert client.project == "project-id" + assert client._channel_refresh_task is None + finally: + client._metrics.close() @CrossSync.pytest @pytest.mark.parametrize( diff --git a/packages/google-cloud-bigtable/tests/unit/data/_sync_autogen/test_client.py b/packages/google-cloud-bigtable/tests/unit/data/_sync_autogen/test_client.py index 46bf247a1ac7..6f31936567a1 100644 --- a/packages/google-cloud-bigtable/tests/unit/data/_sync_autogen/test_client.py +++ b/packages/google-cloud-bigtable/tests/unit/data/_sync_autogen/test_client.py @@ -73,7 +73,7 @@ def set_event_loop(): asyncio.set_event_loop(None) -@pytest.fixture(autouse=True) +@pytest.fixture(autouse=True, scope="module") def mock_metrics_batch_write(): """mock out the metrics batch write to avoid sending metrics to GCP during tests.""" with mock.patch( From 1dfdcf1046ad1d57d291c79cce4e89ae943fad93 Mon Sep 17 00:00:00 2001 From: Daniel Sanche Date: Fri, 14 Aug 2026 13:33:15 -0700 Subject: [PATCH 05/10] Update ci/run_conditional_tests.sh Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- ci/run_conditional_tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/run_conditional_tests.sh b/ci/run_conditional_tests.sh index df832f5e3c27..0295dad6ce14 100755 --- a/ci/run_conditional_tests.sh +++ b/ci/run_conditional_tests.sh @@ -80,7 +80,7 @@ run_test_in_dir() { pushd ${d} > /dev/null set +e - if [ "${PARALLEL_WORKERS}" -eq 1 ]; then + if [ "${PARALLEL_WORKERS}" = "1" ]; then # When running with a single worker, stream output in real-time while capturing to log file ${test_script} 2>&1 | tee "${log_file}" local ret=${PIPESTATUS[0]} From 2f0dd5aca2565e8623b2226a3eb5600155378a0a Mon Sep 17 00:00:00 2001 From: Daniel Sanche Date: Fri, 14 Aug 2026 13:34:57 -0700 Subject: [PATCH 06/10] fixed lint --- .../tests/unit/data/_async/test_client.py | 1 - .../tests/unit/data/_metrics/test_gcp_exporter_handler.py | 7 +++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-bigtable/tests/unit/data/_async/test_client.py b/packages/google-cloud-bigtable/tests/unit/data/_async/test_client.py index addb1f56b042..757084c52466 100644 --- a/packages/google-cloud-bigtable/tests/unit/data/_async/test_client.py +++ b/packages/google-cloud-bigtable/tests/unit/data/_async/test_client.py @@ -102,7 +102,6 @@ def mock_metrics_batch_write(): yield - @CrossSync.convert_class( sync_name="TestBigtableDataClient", add_mapping_for_name="TestBigtableDataClient", diff --git a/packages/google-cloud-bigtable/tests/unit/data/_metrics/test_gcp_exporter_handler.py b/packages/google-cloud-bigtable/tests/unit/data/_metrics/test_gcp_exporter_handler.py index 2c81e5f6173b..85714c79c7ab 100644 --- a/packages/google-cloud-bigtable/tests/unit/data/_metrics/test_gcp_exporter_handler.py +++ b/packages/google-cloud-bigtable/tests/unit/data/_metrics/test_gcp_exporter_handler.py @@ -57,7 +57,8 @@ def test_ctor_defaults(self, mock_auth): assert isinstance(handler.meter_provider, MeterProvider) assert isinstance(handler.otel, _OpenTelemetryInstruments) assert ( - handler.shared_labels["client_name"] == f"python-bigtable/{CLIENT_VERSION}" + handler.shared_labels["client_name"] + == f"python-bigtable/{CLIENT_VERSION}" ) assert handler.shared_labels["client_uid"] == uid_mock() finally: @@ -74,7 +75,9 @@ def test_ctor_explicit(self, mock_auth): client_version=expected_version, ) try: - assert handler.otel == _OpenTelemetryInstruments() or handler.otel is not None + assert ( + handler.otel == _OpenTelemetryInstruments() or handler.otel is not None + ) assert ( handler.shared_labels["client_name"] == f"python-bigtable/{expected_version}" From 664fa6229d8c74dfa9f3bd5888497a24251e6a97 Mon Sep 17 00:00:00 2001 From: Daniel Sanche Date: Fri, 14 Aug 2026 13:38:10 -0700 Subject: [PATCH 07/10] stop nox runs on first error --- ci/run_single_test.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ci/run_single_test.sh b/ci/run_single_test.sh index 16826476f26b..1fb0bc92dc18 100755 --- a/ci/run_single_test.sh +++ b/ci/run_single_test.sh @@ -71,28 +71,28 @@ case ${TEST_TYPE} in unit) case ${PY_VERSION} in "3.10") - nox -s unit-3.10 + nox --stop-on-first-error -s unit-3.10 retval=$? ;; "3.11") - nox -s unit-3.11 + nox --stop-on-first-error -s unit-3.11 retval=$? ;; "3.12") - nox -s unit-3.12 + nox --stop-on-first-error -s unit-3.12 retval=$? ;; "3.13") - nox -s unit-3.13 + nox --stop-on-first-error -s unit-3.13 retval=$? ;; "3.14") - nox -s unit-3.14 + nox --stop-on-first-error -s unit-3.14 retval=$? ;; "3.15") # This is needed to speed up builds - nox --force-venv-backend uv -s unit-3.15 + nox --stop-on-first-error --force-venv-backend uv -s unit-3.15 retval=$? ;; *) @@ -208,7 +208,7 @@ case ${TEST_TYPE} in fi ;; *) - nox -s ${TEST_TYPE} + nox --stop-on-first-error -s ${TEST_TYPE} retval=$? ;; esac From 19bbf5b255956238fa46a9c0bc58a75939181e6f Mon Sep 17 00:00:00 2001 From: Daniel Sanche Date: Fri, 14 Aug 2026 13:52:08 -0700 Subject: [PATCH 08/10] fail-fast within shard --- ci/run_conditional_tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/run_conditional_tests.sh b/ci/run_conditional_tests.sh index 0295dad6ce14..cec02cb7fdbb 100755 --- a/ci/run_conditional_tests.sh +++ b/ci/run_conditional_tests.sh @@ -99,7 +99,7 @@ run_test_in_dir() { if [ ${ret} -ne 0 ]; then echo "❌ Tests failed in ${d} with exit code ${ret}" - exit ${ret} + exit 255 # Cancel xargs parallel jobs else echo "✅ Tests passed in ${d}" fi From 596074f0e92f2a6e6957cda702fbfeb15177cfeb Mon Sep 17 00:00:00 2001 From: Daniel Sanche Date: Fri, 14 Aug 2026 13:52:54 -0700 Subject: [PATCH 09/10] removed bigtable changes --- .../tests/unit/data/_async/test_client.py | 28 +++++++--------- .../_metrics/test_gcp_exporter_handler.py | 33 +++++++------------ .../unit/data/_sync_autogen/test_client.py | 2 +- 3 files changed, 24 insertions(+), 39 deletions(-) diff --git a/packages/google-cloud-bigtable/tests/unit/data/_async/test_client.py b/packages/google-cloud-bigtable/tests/unit/data/_async/test_client.py index 757084c52466..86ae5f9b78ab 100644 --- a/packages/google-cloud-bigtable/tests/unit/data/_async/test_client.py +++ b/packages/google-cloud-bigtable/tests/unit/data/_async/test_client.py @@ -93,7 +93,7 @@ def set_event_loop(): asyncio.set_event_loop(None) -@pytest.fixture(autouse=True, scope="module") +@pytest.fixture(autouse=True) def mock_metrics_batch_write(): """mock out the metrics batch write to avoid sending metrics to GCP during tests.""" with mock.patch( @@ -302,11 +302,8 @@ async def test_veneer_grpc_headers(self, exporter_mock, exporter_mock_sync): def test__start_background_channel_refresh_sync(self): # should raise RuntimeError if called in a sync context client = self._make_client(project="project-id", use_emulator=False) - try: - with pytest.raises(RuntimeError): - client._start_background_channel_refresh() - finally: - client._metrics.close() + with pytest.raises(RuntimeError): + client._start_background_channel_refresh() @CrossSync.pytest async def test__start_background_channel_refresh_task_exists(self): @@ -1146,17 +1143,14 @@ def test_client_ctor_sync(self): with pytest.warns(RuntimeWarning) as warnings: client = self._make_client(project="project-id", use_emulator=False) - try: - expected_warning = [w for w in warnings if "client.py" in w.filename] - assert len(expected_warning) == 1 - assert ( - "BigtableDataClientAsync should be started in an asyncio event loop." - in str(expected_warning[0].message) - ) - assert client.project == "project-id" - assert client._channel_refresh_task is None - finally: - client._metrics.close() + expected_warning = [w for w in warnings if "client.py" in w.filename] + assert len(expected_warning) == 1 + assert ( + "BigtableDataClientAsync should be started in an asyncio event loop." + in str(expected_warning[0].message) + ) + assert client.project == "project-id" + assert client._channel_refresh_task is None @CrossSync.pytest @pytest.mark.parametrize( diff --git a/packages/google-cloud-bigtable/tests/unit/data/_metrics/test_gcp_exporter_handler.py b/packages/google-cloud-bigtable/tests/unit/data/_metrics/test_gcp_exporter_handler.py index 85714c79c7ab..6aa608ab3314 100644 --- a/packages/google-cloud-bigtable/tests/unit/data/_metrics/test_gcp_exporter_handler.py +++ b/packages/google-cloud-bigtable/tests/unit/data/_metrics/test_gcp_exporter_handler.py @@ -53,16 +53,12 @@ def test_ctor_defaults(self, mock_auth): GoogleCloudMetricsHandler, "_generate_client_uid" ) as uid_mock: handler = self._make_one(expected_exporter) - try: - assert isinstance(handler.meter_provider, MeterProvider) - assert isinstance(handler.otel, _OpenTelemetryInstruments) - assert ( - handler.shared_labels["client_name"] - == f"python-bigtable/{CLIENT_VERSION}" - ) - assert handler.shared_labels["client_uid"] == uid_mock() - finally: - handler.close() + assert isinstance(handler.meter_provider, MeterProvider) + assert isinstance(handler.otel, _OpenTelemetryInstruments) + assert ( + handler.shared_labels["client_name"] == f"python-bigtable/{CLIENT_VERSION}" + ) + assert handler.shared_labels["client_uid"] == uid_mock() @mock.patch("google.auth.default", return_value=(mock.Mock(), "project")) def test_ctor_explicit(self, mock_auth): @@ -74,17 +70,12 @@ def test_ctor_explicit(self, mock_auth): client_uid=expected_uid, client_version=expected_version, ) - try: - assert ( - handler.otel == _OpenTelemetryInstruments() or handler.otel is not None - ) - assert ( - handler.shared_labels["client_name"] - == f"python-bigtable/{expected_version}" - ) - assert handler.shared_labels["client_uid"] == expected_uid - finally: - handler.close() + assert handler.otel == _OpenTelemetryInstruments() or handler.otel is not None + assert ( + handler.shared_labels["client_name"] + == f"python-bigtable/{expected_version}" + ) + assert handler.shared_labels["client_uid"] == expected_uid @mock.patch( "google.cloud.bigtable.data._metrics.handlers.gcp_exporter.PeriodicExportingMetricReader" diff --git a/packages/google-cloud-bigtable/tests/unit/data/_sync_autogen/test_client.py b/packages/google-cloud-bigtable/tests/unit/data/_sync_autogen/test_client.py index 6f31936567a1..46bf247a1ac7 100644 --- a/packages/google-cloud-bigtable/tests/unit/data/_sync_autogen/test_client.py +++ b/packages/google-cloud-bigtable/tests/unit/data/_sync_autogen/test_client.py @@ -73,7 +73,7 @@ def set_event_loop(): asyncio.set_event_loop(None) -@pytest.fixture(autouse=True, scope="module") +@pytest.fixture(autouse=True) def mock_metrics_batch_write(): """mock out the metrics batch write to avoid sending metrics to GCP during tests.""" with mock.patch( From c677a7832031b6ffe6d2911390eaa0fee8a5dcfa Mon Sep 17 00:00:00 2001 From: Daniel Sanche Date: Fri, 14 Aug 2026 16:18:21 -0700 Subject: [PATCH 10/10] avoid fetching and printing tags --- .github/workflows/import-profiler.yml | 2 +- .github/workflows/lint.yml | 2 +- .github/workflows/unittest.yml | 4 ++-- ci/run_conditional_tests.sh | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/import-profiler.yml b/.github/workflows/import-profiler.yml index f75ead5670e2..1fdfec435112 100644 --- a/.github/workflows/import-profiler.yml +++ b/.github/workflows/import-profiler.yml @@ -50,7 +50,7 @@ jobs: TOTAL_SHARDS: 8 run: | TARGET_BRANCH=${TARGET_BRANCH:-main} - git fetch origin "${TARGET_BRANCH}" --deepen=200 || true + git fetch --no-tags --quiet origin "${TARGET_BRANCH}" --deepen=200 || true # Get unique list of modified packages under packages/ modified_packages=$(git diff --name-only origin/"${TARGET_BRANCH}"... | grep '^packages/' | cut -d/ -f1,2 | sort -u) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 69402439d08a..6cd14ead2384 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -57,7 +57,7 @@ jobs: TEST_ALL_PACKAGES: ${{ steps.check-label.outputs.is_full_run }} run: | if [ -n "$TARGET_BRANCH" ]; then - git fetch origin "$TARGET_BRANCH" --depth=1 || true + git fetch --no-tags --quiet origin "$TARGET_BRANCH" --depth=1 || true fi python3 ci/get_package_shards.py diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml index 5e075a7c7015..0ec8916bde29 100644 --- a/.github/workflows/unittest.yml +++ b/.github/workflows/unittest.yml @@ -73,7 +73,7 @@ jobs: PACKAGE_WEIGHTS: ${{ env.PACKAGE_WEIGHTS }} run: | if [ -n "$TARGET_BRANCH" ]; then - git fetch origin "$TARGET_BRANCH" --depth=1 || true + git fetch --no-tags --quiet origin "$TARGET_BRANCH" --depth=1 || true fi python3 ci/get_package_shards.py @@ -199,7 +199,7 @@ jobs: echo "should_evaluate_coverage=true" >> "$GITHUB_OUTPUT" else TARGET_BRANCH="${TARGET_BRANCH:-main}" - git fetch origin "$TARGET_BRANCH" --depth=1 || true + git fetch --no-tags --quiet origin "$TARGET_BRANCH" --depth=1 || true num_files_changed=$(git diff --name-only "origin/${TARGET_BRANCH}" -- ${PACKAGE_DIRS} | wc -l | tr -d ' ') if [[ "${num_files_changed}" -gt 0 ]]; then echo "should_evaluate_coverage=true" >> "$GITHUB_OUTPUT" diff --git a/ci/run_conditional_tests.sh b/ci/run_conditional_tests.sh index cec02cb7fdbb..e4f825526f34 100755 --- a/ci/run_conditional_tests.sh +++ b/ci/run_conditional_tests.sh @@ -54,7 +54,7 @@ elif [[ ${BUILD_TYPE} == "presubmit" ]]; then # For presubmit build, we want to know the difference from the # common commit in the target branch. if [ -n "${TARGET_BRANCH}" ]; then - git fetch origin "${TARGET_BRANCH}" --depth=1 || true + git fetch --no-tags --quiet origin "${TARGET_BRANCH}" --depth=1 || true fi GIT_DIFF_ARG="origin/${TARGET_BRANCH}"