Skip to content

Commit

Permalink
[testing] Fix e2e tests timed out, but there's empty test log (kubefl…
Browse files Browse the repository at this point in the history
…ow#2810)

* Wait longer for e2e tests

* Let api integration test stream log output while testing

* Also fix initialization test

* Fix exit code on error

* Update test/initialization-test/run_test.sh

Co-Authored-By: Alexey Volkov <[email protected]>

* Update according to CR

Co-authored-by: Alexey Volkov <[email protected]>
  • Loading branch information
2 people authored and rui5i committed Jan 16, 2020
1 parent cb135df commit b384b33
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
11 changes: 6 additions & 5 deletions test/api-integration-test/run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# limitations under the License.

set -xe
set -o pipefail

# K8s Namespace that all resources deployed to
NAMESPACE=kubeflow
Expand Down Expand Up @@ -64,13 +65,13 @@ cd "${BASE_DIR}/${TEST_DIR}"
export GO111MODULE=on

echo "Run integration test..."
TEST_RESULT=`go test -v ./... -namespace ${NAMESPACE} -args -runIntegrationTests=true 2>&1`
TEST_EXIT_CODE=$?
LOG_FILE=$(mktemp)
# Note, "set -o pipefail" at top of file is required to catch exit code of the pipe.
TEST_EXIT_CODE=0 # reference for how to save exit code: https://stackoverflow.com/a/18622662
go test -v ./... -namespace ${NAMESPACE} -args -runIntegrationTests=true |& tee $LOG_FILE || TEST_EXIT_CODE=$?

# Log the test result
printf '%s\n' "$TEST_RESULT"
# Convert test result to junit.xml
printf '%s\n' "$TEST_RESULT" | go-junit-report > ${JUNIT_TEST_RESULT}
< "$LOG_FILE" go-junit-report > "${JUNIT_TEST_RESULT}"

echo "Copy test result to GCS ${RESULTS_GCS_DIR}/${JUNIT_TEST_RESULT}"
gsutil cp ${JUNIT_TEST_RESULT} ${RESULTS_GCS_DIR}/${JUNIT_TEST_RESULT}
Expand Down
11 changes: 6 additions & 5 deletions test/initialization-test/run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# limitations under the License.

set -xe
set -o pipefail

# K8s Namespace that all resources deployed to
NAMESPACE=kubeflow
Expand Down Expand Up @@ -64,13 +65,13 @@ cd "${BASE_DIR}/${TEST_DIR}"
export GO111MODULE=on

echo "Run Initialization test..."
TEST_RESULT=`go test -v ./... -namespace ${NAMESPACE} -args -runIntegrationTests=true 2>&1`
TEST_EXIT_CODE=$?
LOG_FILE=$(mktemp)
# Note, "set -o pipefail" at top of file is required to catch exit code of the pipe.
TEST_EXIT_CODE=0 # reference for how to save exit code: https://stackoverflow.com/a/18622662
go test -v ./... -namespace ${NAMESPACE} -args -runIntegrationTests=true |& tee $LOG_FILE || TEST_EXIT_CODE=$?

# Log the test result
printf '%s\n' "$TEST_RESULT"
# Convert test result to junit.xml
printf '%s\n' "$TEST_RESULT" | go-junit-report > ${JUNIT_TEST_RESULT}
< "$LOG_FILE" go-junit-report > "${JUNIT_TEST_RESULT}"

echo "Copy test result to GCS ${RESULTS_GCS_DIR}/${JUNIT_TEST_RESULT}"
gsutil cp ${JUNIT_TEST_RESULT} ${RESULTS_GCS_DIR}/${JUNIT_TEST_RESULT}
Expand Down
2 changes: 1 addition & 1 deletion test/presubmit-tests-with-pipeline-deployment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ usage()
PLATFORM=gcp
PROJECT=ml-pipeline-test
TEST_RESULT_BUCKET=ml-pipeline-test
TIMEOUT_SECONDS=1800
TIMEOUT_SECONDS=1800 # 30 minutes
NAMESPACE=kubeflow
ENABLE_WORKLOAD_IDENTITY=true

Expand Down

0 comments on commit b384b33

Please sign in to comment.