@@ -16,7 +16,7 @@ if ! [ -z "${GCP_ZONE:-}" ]; then
1616fi
1717
1818sync_file_to_vm () {
19- gcloud compute scp $@ $windows_node :" C:\\ Users \\ ${current_account} "
19+ gcloud compute scp $@ $windows_node :" C:\\ "
2020}
2121
2222compile_csi_proxy_integration_tests () {
@@ -25,6 +25,10 @@ compile_csi_proxy_integration_tests() {
2525}
2626
2727sync_csi_proxy_integration_tests () {
28+ # delete the pod that is potentially using the old file
29+ # if there is a pod accessing the existing file, this command would hang
30+ kubectl delete -f $pkgdir /scripts/integration-test.yaml --ignore-not-found=true
31+
2832 echo " Sync the integrationtests.exe binary"
2933 local integration_bin_path=" $pkgdir /bin/integrationtests.test.exe"
3034 sync_file_to_vm $integration_bin_path
@@ -33,12 +37,13 @@ sync_csi_proxy_integration_tests() {
3337run_csi_proxy_integration_tests () {
3438 echo " Run integration tests"
3539 local ps1=$( cat << 'EOF '
36- "& {
37- $ErrorActionPreference = \"Stop\";
38- .\integrationtests.test.exe --test.v
39- }"
40+ $ErrorActionPreference = "Stop";
41+ .$Env:CONTAINER_SANDBOX_MOUNT_POINT\integration-test\integrationtests.test.exe --test.v
4042EOF
4143) ;
42-
43- gcloud compute ssh $windows_node --command=" powershell -c $( echo $ps1 | tr ' \n' ' ' ) "
44+ kubectl delete -f $pkgdir /scripts/integration-test.yaml --ignore-not-found=true
45+ sed " s/windows_node/$windows_node /g" < <( cat $pkgdir /scripts/integration-test.yaml) | kubectl create -f -
46+ kubectl wait --for=condition=ready pod -l app=integration-test --timeout=600s
47+ kubectl exec pods/integration-test -- powershell -c $( echo $ps1 | tr ' \n' ' ' )
4448}
49+
0 commit comments