File tree 3 files changed +13
-11
lines changed
3 files changed +13
-11
lines changed Original file line number Diff line number Diff line change 15
15
# limitations under the License.
16
16
17
17
set -xe
18
+ set -o pipefail
18
19
19
20
# K8s Namespace that all resources deployed to
20
21
NAMESPACE=kubeflow
@@ -64,13 +65,13 @@ cd "${BASE_DIR}/${TEST_DIR}"
64
65
export GO111MODULE=on
65
66
66
67
echo " Run integration test..."
67
- TEST_RESULT=` go test -v ./... -namespace ${NAMESPACE} -args -runIntegrationTests=true 2>&1 `
68
- TEST_EXIT_CODE=$?
68
+ LOG_FILE=$( mktemp)
69
+ # Note, "set -o pipefail" at top of file is required to catch exit code of the pipe.
70
+ TEST_EXIT_CODE=0 # reference for how to save exit code: https://stackoverflow.com/a/18622662
71
+ go test -v ./... -namespace ${NAMESPACE} -args -runIntegrationTests=true | & tee $LOG_FILE || TEST_EXIT_CODE=$?
69
72
70
- # Log the test result
71
- printf ' %s\n' " $TEST_RESULT "
72
73
# Convert test result to junit.xml
73
- printf ' %s\n ' " $TEST_RESULT " | go-junit-report > ${JUNIT_TEST_RESULT}
74
+ < " $LOG_FILE " go-junit-report > " ${JUNIT_TEST_RESULT} "
74
75
75
76
echo " Copy test result to GCS ${RESULTS_GCS_DIR} /${JUNIT_TEST_RESULT} "
76
77
gsutil cp ${JUNIT_TEST_RESULT} ${RESULTS_GCS_DIR} /${JUNIT_TEST_RESULT}
Original file line number Diff line number Diff line change 15
15
# limitations under the License.
16
16
17
17
set -xe
18
+ set -o pipefail
18
19
19
20
# K8s Namespace that all resources deployed to
20
21
NAMESPACE=kubeflow
@@ -64,13 +65,13 @@ cd "${BASE_DIR}/${TEST_DIR}"
64
65
export GO111MODULE=on
65
66
66
67
echo " Run Initialization test..."
67
- TEST_RESULT=` go test -v ./... -namespace ${NAMESPACE} -args -runIntegrationTests=true 2>&1 `
68
- TEST_EXIT_CODE=$?
68
+ LOG_FILE=$( mktemp)
69
+ # Note, "set -o pipefail" at top of file is required to catch exit code of the pipe.
70
+ TEST_EXIT_CODE=0 # reference for how to save exit code: https://stackoverflow.com/a/18622662
71
+ go test -v ./... -namespace ${NAMESPACE} -args -runIntegrationTests=true | & tee $LOG_FILE || TEST_EXIT_CODE=$?
69
72
70
- # Log the test result
71
- printf ' %s\n' " $TEST_RESULT "
72
73
# Convert test result to junit.xml
73
- printf ' %s\n ' " $TEST_RESULT " | go-junit-report > ${JUNIT_TEST_RESULT}
74
+ < " $LOG_FILE " go-junit-report > " ${JUNIT_TEST_RESULT} "
74
75
75
76
echo " Copy test result to GCS ${RESULTS_GCS_DIR} /${JUNIT_TEST_RESULT} "
76
77
gsutil cp ${JUNIT_TEST_RESULT} ${RESULTS_GCS_DIR} /${JUNIT_TEST_RESULT}
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ usage()
31
31
PLATFORM=gcp
32
32
PROJECT=ml-pipeline-test
33
33
TEST_RESULT_BUCKET=ml-pipeline-test
34
- TIMEOUT_SECONDS=1800
34
+ TIMEOUT_SECONDS=1800 # 30 minutes
35
35
NAMESPACE=kubeflow
36
36
ENABLE_WORKLOAD_IDENTITY=true
37
37
You can’t perform that action at this time.
0 commit comments