Add Kokoro scripts for k8s insecure tests#26883
Conversation
|
Also: naming is hard. Not sure "Insecure" is the right way to describe it. |
Just grpc_xds_k8s_lb tests then? Wanted to differentiate from sec tests somehow. |
|
@ericgribkoff |
| run_test change_backend_service_test | ||
| run_test failover_test | ||
| run_test remove_neg_test | ||
| run_test round_robin_test |
There was a problem hiding this comment.
Keep in mind this will exit after first test failure, and the rest of the tests won't run.
It's easy to make it continue, but then the exit code of this script won't be reported should any of the tests fail:
set +e
run_test change_backend_service_test
run_test failover_test
run_test remove_neg_test
run_test round_robin_testIf we want to report the code, we need to do something like
#!/usr/bin/env bash
set -eo pipefail
run_test() {
echo $1
if [[ $1 == "good_test" ]]; then
python -c 'import sys; print("success"); sys.exit(0)'
else
python -c 'import sys; sys.exit("fail")'
fi
}
main() {
errors=0
for test in good_test bad_test good_test bad_test
do
local exit_code=0
run_test $test || (( errors++ ))
done
echo "Failed test suites: ${errors}"
if (( errors > 0 )); then
exit 1
fi
}
main "$@"But in this case python must be the last call in run_test, so set command on line 110 must be deleted.
There was a problem hiding this comment.
Hah, I didn't actually see the edit here and went off the original email notification only. After some (way too much...) time spent on bash, I came up with (I believe) more or less the same thing, sans the for-loop. But the error message in your snippet here is clearer, so will update to what you provided :)
* Add Kokoro scripts for k8s insecure tests * change cluster and job names * update name in cfg * do not exit immediately if test case fails * better error message, loop * fix arr
* Add Kokoro scripts for k8s insecure tests * change cluster and job names * update name in cfg * do not exit immediately if test case fails * better error message, loop * fix arr
* Add Kokoro scripts for k8s insecure tests * change cluster and job names * update name in cfg * do not exit immediately if test case fails * better error message, loop * fix arr
No description provided.