mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 12:15:52 +00:00
Re-enable test-cmd.sh tests
This commit is contained in:
parent
90b5d4cbd8
commit
d47f898500
@ -21,8 +21,9 @@ set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
|
||||
source "${KUBE_ROOT}/hack/lib/init.sh"
|
||||
source "${KUBE_ROOT}/hack/lib/test.sh"
|
||||
# Expects the following has already been done by whatever sources this script
|
||||
# source "${KUBE_ROOT}/hack/lib/init.sh"
|
||||
# source "${KUBE_ROOT}/hack/lib/test.sh"
|
||||
|
||||
ETCD_HOST=${ETCD_HOST:-127.0.0.1}
|
||||
ETCD_PORT=${ETCD_PORT:-2379}
|
||||
@ -2409,9 +2410,9 @@ run_multi_resources_tests() {
|
||||
# Requires an env var SUPPORTED_RESOURCES which is a comma separated list of
|
||||
# resources for which tests should be run.
|
||||
runTests() {
|
||||
if [ -z "${SUPPORTED_RESOURCES}" ]; then
|
||||
echo "Need to set SUPPORTED_RESOURCES env var. It is a comma separated list of resources that are supported and hence should be tested. Set it to (*) to test all resources"
|
||||
return
|
||||
if [ -z "${SUPPORTED_RESOURCES:-}" ]; then
|
||||
echo "Need to set SUPPORTED_RESOURCES env var. It is a list of resources that are supported and hence should be tested. Set it to (*) to test all resources"
|
||||
exit 1
|
||||
fi
|
||||
kube::log::status "Checking kubectl version"
|
||||
kubectl version
|
||||
|
@ -22,6 +22,8 @@ set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
|
||||
source "${KUBE_ROOT}/hack/lib/init.sh"
|
||||
source "${KUBE_ROOT}/hack/lib/test.sh"
|
||||
source "${KUBE_ROOT}/hack/make-rules/test-cmd-util.sh"
|
||||
|
||||
function run_kube_apiserver() {
|
||||
@ -135,10 +137,8 @@ run_kube_controller_manager
|
||||
run_kubelet
|
||||
create_node
|
||||
SUPPORTED_RESOURCES=("*")
|
||||
output_message=$(runTests "SUPPORTED_RESOURCES=${SUPPORTED_RESOURCES[@]}")
|
||||
# Ensure that tests were run. We cannot check all resources here. We check a few
|
||||
# to catch bugs due to which no tests run.
|
||||
kube::test::if_has_string "${output_message}" "Testing kubectl(v1:pods)"
|
||||
kube::test::if_has_string "${output_message}" "Testing kubectl(v1:services)"
|
||||
# WARNING: Do not wrap this call in a subshell to capture output, e.g. output=$(runTests)
|
||||
# Doing so will suppress errexit behavior inside runTests
|
||||
runTests
|
||||
|
||||
kube::log::status "TESTS PASSED"
|
||||
|
@ -22,6 +22,8 @@ set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
|
||||
source "${KUBE_ROOT}/hack/lib/init.sh"
|
||||
source "${KUBE_ROOT}/hack/lib/test.sh"
|
||||
source "${KUBE_ROOT}/hack/make-rules/test-cmd-util.sh"
|
||||
|
||||
function run_federation_apiserver() {
|
||||
@ -75,10 +77,8 @@ run_federation_apiserver
|
||||
run_federation_controller_manager
|
||||
# TODO: Fix for replicasets and deployments.
|
||||
SUPPORTED_RESOURCES=("configmaps" "daemonsets" "events" "ingress" "namespaces" "secrets" "services")
|
||||
output_message=$(runTests "SUPPORTED_RESOURCES=${SUPPORTED_RESOURCES[@]}")
|
||||
# Ensure that tests were run. We cannot check all resources here. We check a few
|
||||
# to catch bugs due to which no tests run.
|
||||
kube::test::if_has_string "${output_message}" "Testing kubectl(v1:namespaces)"
|
||||
kube::test::if_has_string "${output_message}" "Testing kubectl(v1:services)"
|
||||
# WARNING: Do not wrap this call in a subshell to capture output, e.g. output=$(runTests)
|
||||
# Doing so will suppress errexit behavior inside runTests
|
||||
runTests
|
||||
|
||||
kube::log::status "TESTS PASSED"
|
||||
|
Loading…
Reference in New Issue
Block a user