mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 04:33:26 +00:00
Fix shellcheck failures on test-e2e-node.sh and test-integration.sh
This commit is contained in:
parent
b359b6bfe7
commit
7a39c99297
@ -34,8 +34,6 @@
|
|||||||
./hack/make-rules/clean.sh
|
./hack/make-rules/clean.sh
|
||||||
./hack/make-rules/helpers/cache_go_dirs.sh
|
./hack/make-rules/helpers/cache_go_dirs.sh
|
||||||
./hack/make-rules/make-help.sh
|
./hack/make-rules/make-help.sh
|
||||||
./hack/make-rules/test-e2e-node.sh
|
|
||||||
./hack/make-rules/test-integration.sh
|
|
||||||
./hack/make-rules/test.sh
|
./hack/make-rules/test.sh
|
||||||
./hack/make-rules/update.sh
|
./hack/make-rules/update.sh
|
||||||
./hack/make-rules/verify.sh
|
./hack/make-rules/verify.sh
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
|
KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/../..
|
||||||
source "${KUBE_ROOT}/hack/lib/init.sh"
|
source "${KUBE_ROOT}/hack/lib/init.sh"
|
||||||
|
|
||||||
focus=${FOCUS:-""}
|
focus=${FOCUS:-""}
|
||||||
@ -26,7 +26,7 @@ skip=${SKIP-"\[Flaky\]|\[Slow\]|\[Serial\]"}
|
|||||||
# Currently, parallelism only affects when REMOTE=true. For local test,
|
# Currently, parallelism only affects when REMOTE=true. For local test,
|
||||||
# ginkgo default parallelism (cores - 1) is used.
|
# ginkgo default parallelism (cores - 1) is used.
|
||||||
parallelism=${PARALLELISM:-8}
|
parallelism=${PARALLELISM:-8}
|
||||||
artifacts=${ARTIFACTS:-"/tmp/_artifacts/`date +%y%m%dT%H%M%S`"}
|
artifacts="${ARTIFACTS:-"/tmp/_artifacts/$(date +%y%m%dT%H%M%S)"}"
|
||||||
remote=${REMOTE:-"false"}
|
remote=${REMOTE:-"false"}
|
||||||
runtime=${RUNTIME:-"docker"}
|
runtime=${RUNTIME:-"docker"}
|
||||||
container_runtime_endpoint=${CONTAINER_RUNTIME_ENDPOINT:-""}
|
container_runtime_endpoint=${CONTAINER_RUNTIME_ENDPOINT:-""}
|
||||||
@ -38,7 +38,7 @@ extra_envs=${EXTRA_ENVS:-}
|
|||||||
|
|
||||||
# Parse the flags to pass to ginkgo
|
# Parse the flags to pass to ginkgo
|
||||||
ginkgoflags=""
|
ginkgoflags=""
|
||||||
if [[ ${parallelism} > 1 ]]; then
|
if [[ ${parallelism} -gt 1 ]]; then
|
||||||
ginkgoflags="${ginkgoflags} -nodes=${parallelism} "
|
ginkgoflags="${ginkgoflags} -nodes=${parallelism} "
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -57,21 +57,21 @@ fi
|
|||||||
# Setup the directory to copy test artifacts (logs, junit.xml, etc) from remote host to local host
|
# Setup the directory to copy test artifacts (logs, junit.xml, etc) from remote host to local host
|
||||||
if [ ! -d "${artifacts}" ]; then
|
if [ ! -d "${artifacts}" ]; then
|
||||||
echo "Creating artifacts directory at ${artifacts}"
|
echo "Creating artifacts directory at ${artifacts}"
|
||||||
mkdir -p ${artifacts}
|
mkdir -p "${artifacts}"
|
||||||
fi
|
fi
|
||||||
echo "Test artifacts will be written to ${artifacts}"
|
echo "Test artifacts will be written to ${artifacts}"
|
||||||
|
|
||||||
if [[ ${runtime} == "remote" ]] ; then
|
if [[ ${runtime} == "remote" ]] ; then
|
||||||
if [[ ! -z ${container_runtime_endpoint} ]] ; then
|
if [[ -n ${container_runtime_endpoint} ]] ; then
|
||||||
test_args="--container-runtime-endpoint=${container_runtime_endpoint} ${test_args}"
|
test_args="--container-runtime-endpoint=${container_runtime_endpoint} ${test_args}"
|
||||||
fi
|
fi
|
||||||
if [[ ! -z ${image_service_endpoint} ]] ; then
|
if [[ -n ${image_service_endpoint} ]] ; then
|
||||||
test_args="--image-service-endpoint=${image_service_endpoint} ${test_args}"
|
test_args="--image-service-endpoint=${image_service_endpoint} ${test_args}"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [ ${remote} = true ] ; then
|
if [ "${remote}" = true ] ; then
|
||||||
# The following options are only valid in remote run.
|
# The following options are only valid in remote run.
|
||||||
images=${IMAGES:-""}
|
images=${IMAGES:-""}
|
||||||
hosts=${HOSTS:-""}
|
hosts=${HOSTS:-""}
|
||||||
@ -85,8 +85,8 @@ if [ ${remote} = true ] ; then
|
|||||||
gubernator=${GUBERNATOR:-"false"}
|
gubernator=${GUBERNATOR:-"false"}
|
||||||
image_config_file=${IMAGE_CONFIG_FILE:-""}
|
image_config_file=${IMAGE_CONFIG_FILE:-""}
|
||||||
if [[ ${hosts} == "" && ${images} == "" && ${image_config_file} == "" ]]; then
|
if [[ ${hosts} == "" && ${images} == "" && ${image_config_file} == "" ]]; then
|
||||||
image_project=${IMAGE_PROJECT:-"cos-cloud"}
|
image_project="${IMAGE_PROJECT:-"cos-cloud"}"
|
||||||
gci_image=$(gcloud compute images list --project ${image_project} \
|
gci_image=$(gcloud compute images list --project "${image_project}" \
|
||||||
--no-standard-images --filter="name ~ 'cos-beta.*'" --format="table[no-heading](name)")
|
--no-standard-images --filter="name ~ 'cos-beta.*'" --format="table[no-heading](name)")
|
||||||
images=${gci_image}
|
images=${gci_image}
|
||||||
metadata="user-data<${KUBE_ROOT}/test/e2e_node/jenkins/gci-init.yaml,gci-update-strategy=update_disabled"
|
metadata="user-data<${KUBE_ROOT}/test/e2e_node/jenkins/gci-init.yaml,gci-update-strategy=update_disabled"
|
||||||
@ -116,7 +116,7 @@ if [ ${remote} = true ] ; then
|
|||||||
IFS=',' read -ra IM <<< "${images}"
|
IFS=',' read -ra IM <<< "${images}"
|
||||||
images=""
|
images=""
|
||||||
for i in "${IM[@]}"; do
|
for i in "${IM[@]}"; do
|
||||||
if [[ $(gcloud compute instances list "${instance_prefix}-${i}" | grep ${i}) ]]; then
|
if gcloud compute instances list "${instance_prefix}-${i}" | grep "${i}"; then
|
||||||
if [[ "${hosts}" != "" ]]; then
|
if [[ "${hosts}" != "" ]]; then
|
||||||
hosts="${hosts},"
|
hosts="${hosts},"
|
||||||
fi
|
fi
|
||||||
|
@ -18,7 +18,7 @@ set -o errexit
|
|||||||
set -o nounset
|
set -o nounset
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
|
KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/../..
|
||||||
source "${KUBE_ROOT}/hack/lib/init.sh"
|
source "${KUBE_ROOT}/hack/lib/init.sh"
|
||||||
# Lists of API Versions of each groups that should be tested, groups are
|
# Lists of API Versions of each groups that should be tested, groups are
|
||||||
# separated by comma, lists are separated by semicolon. e.g.,
|
# separated by comma, lists are separated by semicolon. e.g.,
|
||||||
@ -40,7 +40,7 @@ KUBE_TEST_VMODULE=${KUBE_TEST_VMODULE:-"garbagecollector*=6,graph_builder*=6"}
|
|||||||
|
|
||||||
kube::test::find_integration_test_dirs() {
|
kube::test::find_integration_test_dirs() {
|
||||||
(
|
(
|
||||||
cd ${KUBE_ROOT}
|
cd "${KUBE_ROOT}"
|
||||||
find test/integration/ -name '*_test.go' -print0 \
|
find test/integration/ -name '*_test.go' -print0 \
|
||||||
| xargs -0n1 dirname | sed "s|^|${KUBE_GO_PACKAGE}/|" \
|
| xargs -0n1 dirname | sed "s|^|${KUBE_GO_PACKAGE}/|" \
|
||||||
| LC_ALL=C sort -u
|
| LC_ALL=C sort -u
|
||||||
@ -67,7 +67,10 @@ runTests() {
|
|||||||
kube::etcd::start
|
kube::etcd::start
|
||||||
kube::log::status "Running integration test cases"
|
kube::log::status "Running integration test cases"
|
||||||
|
|
||||||
KUBE_RACE="-race"
|
# export KUBE_RACE
|
||||||
|
#
|
||||||
|
# Enable the Go race detector.
|
||||||
|
export KUBE_RACE="-race"
|
||||||
make -C "${KUBE_ROOT}" test \
|
make -C "${KUBE_ROOT}" test \
|
||||||
WHAT="${WHAT:-$(kube::test::find_integration_test_dirs | paste -sd' ' -)}" \
|
WHAT="${WHAT:-$(kube::test::find_integration_test_dirs | paste -sd' ' -)}" \
|
||||||
GOFLAGS="${GOFLAGS:-}" \
|
GOFLAGS="${GOFLAGS:-}" \
|
||||||
@ -94,7 +97,7 @@ checkEtcdOnPath
|
|||||||
trap cleanup EXIT
|
trap cleanup EXIT
|
||||||
|
|
||||||
# Convert the CSV to an array of API versions to test
|
# Convert the CSV to an array of API versions to test
|
||||||
IFS=';' read -a apiVersions <<< "${KUBE_TEST_API_VERSIONS}"
|
IFS=';' read -ra apiVersions <<< "${KUBE_TEST_API_VERSIONS}"
|
||||||
for apiVersion in "${apiVersions[@]}"; do
|
for apiVersion in "${apiVersions[@]}"; do
|
||||||
runTests "${apiVersion}"
|
runTests "${apiVersion}"
|
||||||
done
|
done
|
||||||
|
Loading…
Reference in New Issue
Block a user