From 6c2cd33fe761b24ff60fd12047991ee5826794c7 Mon Sep 17 00:00:00 2001 From: Scott Hart Date: Mon, 18 Nov 2024 15:25:42 -0500 Subject: [PATCH] ci: enable global and add non-us region to speech quickstart --- ci/cloudbuild/builds/lib/integration.sh | 1 + ci/etc/integration-tests-config.sh | 2 ++ google/cloud/speech/CMakeLists.txt | 29 +++++++++++++++---------- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/ci/cloudbuild/builds/lib/integration.sh b/ci/cloudbuild/builds/lib/integration.sh index 03cbc0b6dc40d..b9399634db520 100644 --- a/ci/cloudbuild/builds/lib/integration.sh +++ b/ci/cloudbuild/builds/lib/integration.sh @@ -57,6 +57,7 @@ function integration::bazel_args() { # Common settings "--test_env=GOOGLE_CLOUD_PROJECT=${GOOGLE_CLOUD_PROJECT}" "--test_env=GOOGLE_CLOUD_CPP_TEST_REGION=${GOOGLE_CLOUD_CPP_TEST_REGION}" + "--test_env=GOOGLE_CLOUD_CPP_NON_US_TEST_REGION=${GOOGLE_CLOUD_CPP_NON_US_TEST_REGION}" "--test_env=GOOGLE_CLOUD_CPP_TEST_ZONE=${GOOGLE_CLOUD_CPP_TEST_ZONE}" "--test_env=GOOGLE_CLOUD_CPP_TEST_ORGANIZATION=${GOOGLE_CLOUD_CPP_TEST_ORGANIZATION}" "--test_env=GOOGLE_CLOUD_CPP_TEST_SERVICE_ACCOUNT_KEYFILE=${GOOGLE_CLOUD_CPP_TEST_SERVICE_ACCOUNT_KEYFILE}" diff --git a/ci/etc/integration-tests-config.sh b/ci/etc/integration-tests-config.sh index a285d5e277645..e78b5a80f37d2 100644 --- a/ci/etc/integration-tests-config.sh +++ b/ci/etc/integration-tests-config.sh @@ -34,6 +34,8 @@ export GOOGLE_CLOUD_CPP_USER_PROJECT="${GOOGLE_CLOUD_PROJECT}" export GOOGLE_CLOUD_CPP_TEST_REGION="us-central1" # Some quickstart programs require a zone. export GOOGLE_CLOUD_CPP_TEST_ZONE="us-central1-a" +# Some tests and quickstarts benefit from a region outside the US. +export GOOGLE_CLOUD_CPP_NON_US_TEST_REGION="asia-southeast1" # Some tests and quickstarts need to specify a location as "global". export GOOGLE_CLOUD_CPP_TEST_GLOBAL="global" # Some quickstart programs require an organization. diff --git a/google/cloud/speech/CMakeLists.txt b/google/cloud/speech/CMakeLists.txt index 506906a11a2fc..91b886f41f8ad 100644 --- a/google/cloud/speech/CMakeLists.txt +++ b/google/cloud/speech/CMakeLists.txt @@ -25,21 +25,28 @@ if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) add_executable(speech_quickstart "quickstart/quickstart.cc") target_link_libraries(speech_quickstart PRIVATE google-cloud-cpp::speech) google_cloud_cpp_add_common_options(speech_quickstart) - # TODO(#14841): add this back when the test on CI is recovered. - - # add_test( NAME speech_quickstart_global COMMAND cmake -P - # "${PROJECT_SOURCE_DIR}/cmake/quickstart-runner.cmake" - # $ GOOGLE_CLOUD_PROJECT - # GOOGLE_CLOUD_CPP_TEST_GLOBAL) - # set_tests_properties(speech_quickstart_global PROPERTIES LABELS - # "integration-test;quickstart") add_test( - NAME speech_quickstart_regional + NAME speech_quickstart_global + COMMAND + cmake -P "${PROJECT_SOURCE_DIR}/cmake/quickstart-runner.cmake" + $ GOOGLE_CLOUD_PROJECT + GOOGLE_CLOUD_CPP_TEST_GLOBAL) + set_tests_properties(speech_quickstart_global + PROPERTIES LABELS "integration-test;quickstart") + add_test( + NAME speech_quickstart_us_regional COMMAND cmake -P "${PROJECT_SOURCE_DIR}/cmake/quickstart-runner.cmake" $ GOOGLE_CLOUD_PROJECT GOOGLE_CLOUD_CPP_TEST_REGION) - set_tests_properties(speech_quickstart_regional + set_tests_properties(speech_quickstart_us_regional + PROPERTIES LABELS "integration-test;quickstart") + add_test( + NAME speech_quickstart_non_us_regional + COMMAND + cmake -P "${PROJECT_SOURCE_DIR}/cmake/quickstart-runner.cmake" + $ GOOGLE_CLOUD_PROJECT + GOOGLE_CLOUD_CPP_NON_US_TEST_REGION) + set_tests_properties(speech_quickstart_non_us_regional PROPERTIES LABELS "integration-test;quickstart") - endif ()