@@ -428,7 +428,7 @@ function integration::bazel_with_emulators() {
428428# integration::ctest_with_emulators "cmake-out"
429429#
430430function integration::ctest_with_emulators() {
431- readonly EMULATOR_SCRIPT=" run_integration_tests_emulator_cmake.sh"
431+ local -r EMULATOR_SCRIPT=" run_integration_tests_emulator_cmake.sh"
432432 if [[ $# == 0 ]]; then
433433 io::log_red " error: build output directory required"
434434 return 1
@@ -446,9 +446,11 @@ function integration::ctest_with_emulators() {
446446 " google/cloud/pubsub/ci/${EMULATOR_SCRIPT} " \
447447 " ${cmake_out} " " ${ctest_args[@]} " -L integration-test-emulator
448448
449- io::log_h2 " Running Storage integration tests (with emulator)"
450- " ${PROJECT_ROOT} /google/cloud/storage/ci/${EMULATOR_SCRIPT} " \
451- " ${cmake_out} " " ${ctest_args[@]} " -L integration-test-emulator
449+ if ! [[ " ${skip_args[*]} " =~ " storage" ]]; then
450+ io::log_h2 " Running Storage integration tests (with emulator)"
451+ " ${PROJECT_ROOT} /google/cloud/storage/ci/${EMULATOR_SCRIPT} " \
452+ " ${cmake_out} " " ${ctest_args[@]} " -L integration-test-emulator
453+ fi
452454
453455 if ! [[ " ${skip_args[*]} " =~ " spanner" ]]; then
454456 io::log_h2 " Running Spanner integration tests (with emulator)"
@@ -464,3 +466,24 @@ function integration::ctest_with_emulators() {
464466 " google/cloud/internal/ci/${EMULATOR_SCRIPT} " \
465467 " ${cmake_out} " " ${ctest_args[@]} " -L integration-test-emulator
466468}
469+
470+ # Runs Storage integration tests with CTest using emulators.
471+ function integration::ctest_storage_with_emulators() {
472+ local -r EMULATOR_SCRIPT=" run_integration_tests_emulator_cmake.sh"
473+ if [[ $# == 0 ]]; then
474+ io::log_red " error: build output directory required"
475+ return 1
476+ fi
477+
478+ local cmake_out=" $1 "
479+
480+ local -a ctest_args
481+ mapfile -t ctest_args < <( ctest::common_args)
482+ # Integration tests are inherently flaky. Make up to three attempts to get the
483+ # test passing.
484+ ctest_args+=(--repeat until-pass:3)
485+
486+ io::log_h2 " Running Storage integration tests (with emulator)"
487+ " ${PROJECT_ROOT} /google/cloud/storage/ci/${EMULATOR_SCRIPT} " \
488+ " ${cmake_out} " " ${ctest_args[@]} " -L integration-test-emulator
489+ }
0 commit comments