Skip to content

Commit d798d86

Browse files
committed
cleanup CI integration scripts
- stop setting ARTIFACTS from WORKSPACE, CI handles setting ARTIFACTS and WORKSPACE isn't used anymore (bazel?) - stop cd-ing GOPATH, CI sets the working dir already and local users won't necessarily have GOPATH - sop clobbering PATH with hardcoded assumptions, source install-etcd.sh instead (which updates PATH) - don't redundantly set KUBE_COVER to the default - pass logging env inline so the command can be pasted locally - set -x so the command is visible - add TODO about needing a wrapper script just to call install-etcd
1 parent 9e42056 commit d798d86

File tree

3 files changed

+14
-57
lines changed

3 files changed

+14
-57
lines changed

hack/jenkins/test-cmd-dockerized.sh

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,11 @@ set -o nounset
1919
set -o pipefail
2020
set -o xtrace
2121

22-
# Runs test-cmd,
23-
# producing JUnit-style XML test
24-
# reports in ${WORKSPACE}/artifacts. This script is intended to be run from
25-
# kubekins-test container with a kubernetes repo mapped in. See
26-
# k8s.io/test-infra/scenarios/kubernetes_verify.py
22+
# Runs test-cmd, intended to be run in prow.k8s.io
23+
set -x;
2724

28-
export PATH=${GOPATH}/bin:${PWD}/third_party/etcd:/usr/local/go/bin:${PATH}
29-
30-
# Set artifacts directory
31-
export ARTIFACTS=${ARTIFACTS:-"${WORKSPACE}/artifacts"}
32-
33-
cd "${GOPATH}/src/k8s.io/kubernetes"
34-
35-
./hack/install-etcd.sh
25+
# TODO: make test-cmd should handle this automatically
26+
source ./hack/install-etcd.sh
3627

3728
make test-cmd
3829

hack/jenkins/test-dockerized.sh

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,32 +19,14 @@ set -o nounset
1919
set -o pipefail
2020
set -o xtrace
2121

22-
# Runs test-cmd and test-integration,
23-
# producing JUnit-style XML test
24-
# reports in ${WORKSPACE}/artifacts. This script is intended to be run from
25-
# kubekins-test container with a kubernetes repo mapped in. See
26-
# k8s.io/test-infra/scenarios/kubernetes_verify.py
22+
# Runs test-cmd and test-integration, intended to be run in prow.k8s.io
23+
set -x;
2724

28-
export PATH=${GOPATH}/bin:${PWD}/third_party/etcd:/usr/local/go/bin:${PATH}
25+
# TODO: make test-integration should handle this automatically
26+
source ./hack/install-etcd.sh
2927

30-
# Install tools we need
31-
hack_tools_gotoolchain="${GOTOOLCHAIN:-}"
32-
if [ -n "${KUBE_HACK_TOOLS_GOTOOLCHAIN:-}" ]; then
33-
hack_tools_gotoolchain="${KUBE_HACK_TOOLS_GOTOOLCHAIN}";
34-
fi
35-
GOTOOLCHAIN="${hack_tools_gotoolchain}" go -C "./hack/tools" install gotest.tools/gotestsum
36-
37-
# Disable coverage report
38-
export KUBE_COVER="n"
39-
# Set artifacts directory
40-
export ARTIFACTS=${ARTIFACTS:-"${WORKSPACE}/artifacts"}
4128
# Save the verbose stdout as well.
4229
export KUBE_KEEP_VERBOSE_TEST_OUTPUT=y
4330
export LOG_LEVEL=4
44-
45-
cd "${GOPATH}/src/k8s.io/kubernetes"
46-
47-
./hack/install-etcd.sh
48-
4931
make test-cmd
5032
make test-integration

hack/jenkins/test-integration-dockerized.sh

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,27 +19,11 @@ set -o nounset
1919
set -o pipefail
2020
set -o xtrace
2121

22-
# Runs test-integration,
23-
# producing JUnit-style XML test
24-
# reports in ${WORKSPACE}/artifacts. This script is intended to be run from
25-
# kubekins-test container with a kubernetes repo mapped in. See
26-
# k8s.io/test-infra/scenarios/kubernetes_verify.py
22+
# Runs test-integration
23+
# This script is intended to be run from prow.k8s.io
24+
set -x;
2725

28-
export PATH=${GOPATH}/bin:${PWD}/third_party/etcd:/usr/local/go/bin:${PATH}
26+
# TODO: make test-integration should handle this automatically
27+
source ./hack/install-etcd.sh
2928

30-
# Install tools we need
31-
go -C "./hack/tools" install gotest.tools/gotestsum
32-
33-
# Disable coverage report
34-
export KUBE_COVER="n"
35-
# Set artifacts directory
36-
export ARTIFACTS=${ARTIFACTS:-"${WORKSPACE}/artifacts"}
37-
# Save the verbose stdout as well.
38-
export KUBE_KEEP_VERBOSE_TEST_OUTPUT=y
39-
export LOG_LEVEL=4
40-
41-
cd "${GOPATH}/src/k8s.io/kubernetes"
42-
43-
./hack/install-etcd.sh
44-
45-
make test-integration
29+
make test-integration KUBE_KEEP_VERBOSE_TEST_OUTPUT=y LOG_LEVEL=4

0 commit comments

Comments
 (0)