Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add DualStack tests to psm_interop_kokoro_lib.sh #111

Merged
merged 6 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .kokoro/psm_interop_kokoro_lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,50 @@ psm::security::run_test() {
psm::tools::run_verbose python -m "tests.${test_name}" "${PSM_TEST_FLAGS[@]}"
}

# --- DualStack TESTS ------------------

#######################################
# DualStack Test Suite setup.
# Outputs:
# Prints activated cluster names.
#######################################
psm::dualstack::setup() {
activate_gke_cluster GKE_CLUSTER_DUALSTACK
}

#######################################
# Prepares the list of tests in DualStack test suite.
# Globals:
# TESTS: Populated with tests in PSM DualStack test suite.
#######################################
psm::dualstack::get_tests() {
TESTS=(
"test_dualstack"
)
}

#######################################
# Executes DualStack test case
# Globals:
# PSM_TEST_FLAGS: The array with flags for the test
# GRPC_LANGUAGE: The name of gRPC languages under test
# Arguments:
# Test case name
# Outputs:
# Writes the output of test execution to stdout, stderr
# Test xUnit report to ${TEST_XML_OUTPUT_DIR}/${test_name}/sponge_log.xml
#######################################
psm::dualstack::run_test() {
local test_name="${1:?${FUNCNAME[0]} missing the test name argument}"

PSM_TEST_FLAGS+=(
"--flagfile=config/common-dualstack.cfg"
)

sergiitk marked this conversation as resolved.
Show resolved Hide resolved
psm::run::finalize_test_flags "${test_name}"
psm::tools::run_verbose python -m "tests.${test_name}" "${PSM_TEST_FLAGS[@]}"
}

# --- URL Map TESTS ------------------

#######################################
Expand Down Expand Up @@ -694,6 +738,10 @@ activate_gke_cluster() {
GKE_CLUSTER_NAME="interop-test-psm-basic"
GKE_CLUSTER_ZONE="us-central1-c"
;;
GKE_CLUSTER_DUALSTACK)
GKE_CLUSTER_NAME="psm-interop-dualstack"
GKE_CLUSTER_ZONE="us-central1-a"
;;
*)
psm::tools::log "Unknown GKE cluster: ${1}"
exit 1
Expand Down
4 changes: 4 additions & 0 deletions config/common-dualstack.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Common config file for PSM DualStack tests.
--resource_prefix=psm-ds
--enable_dualstack
--noenable_workload_identity
Loading