diff options
author | Adin Scannell <ascannell@google.com> | 2019-06-04 14:42:25 -0700 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2019-06-04 14:43:24 -0700 |
commit | 6f92038ce0d2062c3dfd84fe65141ee09deeabfc (patch) | |
tree | e15e97cb778178ff67b44c8196b426fe8e3a1da4 /tools/run_tests.sh | |
parent | 0c292cdaab5c226bcf90c3376a0f3942cb266eed (diff) |
Use github directory if it exists.
Unfortunately, kokoro names the top-level directory per the SCM type. This
means there's no way to make the job names match; we simply need to probe for
the existence of the correct directory.
PiperOrigin-RevId: 251519409
Diffstat (limited to 'tools/run_tests.sh')
-rwxr-xr-x | tools/run_tests.sh | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/tools/run_tests.sh b/tools/run_tests.sh index c6e97dc95..dc282c142 100755 --- a/tools/run_tests.sh +++ b/tools/run_tests.sh @@ -21,8 +21,10 @@ set -eux # GLOBAL ENV VARS # ################### -if [[ -v KOKORO_GIT_COMMIT ]]; then +if [[ -v KOKORO_GIT_COMMIT ]] && [[ -d git/repo ]]; then readonly WORKSPACE_DIR="${PWD}/git/repo" +elif [[ -v KOKORO_GIT_COMMIT ]] && [[ -d github/repo ]]; then + readonly WORKSPACE_DIR="${PWD}/github/repo" else readonly WORKSPACE_DIR="${PWD}" fi @@ -46,11 +48,6 @@ readonly TEST_PACKAGES=("//pkg/..." "//runsc/..." "//tools/...") (which use_bazel.sh && use_bazel.sh latest) || which bazel bazel version -# Checkout the appropriate commit. -if [[ -v KOKORO_GIT_COMMIT ]]; then - (cd "${WORKSPACE_DIR}" && git checkout "${KOKORO_GIT_COMMIT}") -fi - # Load the kvm module. sudo -n -E modprobe kvm |