diff --git a/go.mod b/go.mod index 9e727d4af..36e386449 100644 --- a/go.mod +++ b/go.mod @@ -50,7 +50,7 @@ require ( k8s.io/gengo v0.0.0-20220613173612-397b4ae3bce7 k8s.io/klog/v2 v2.70.2-0.20220707122935-0990e81f1a8f k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 - knative.dev/hack v0.0.0-20220908170219-36b2b3c7a245 + knative.dev/hack v0.0.0-20220913095247-7556452c2b54 sigs.k8s.io/yaml v1.3.0 ) diff --git a/go.sum b/go.sum index 2be2e631e..c6005ca9c 100644 --- a/go.sum +++ b/go.sum @@ -1180,8 +1180,8 @@ k8s.io/kube-openapi v0.0.0-20220328201542-3ee0da9b0b42/go.mod h1:Z/45zLw8lUo4wdi k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 h1:HNSDgDCrr/6Ly3WEGKZftiE7IY19Vz2GdbOCyI4qqhc= k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -knative.dev/hack v0.0.0-20220908170219-36b2b3c7a245 h1:VbG+uEhRW+t/xeq5G5/XazQrlbKmykJK1IeVfZMuyCQ= -knative.dev/hack v0.0.0-20220908170219-36b2b3c7a245/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q= +knative.dev/hack v0.0.0-20220913095247-7556452c2b54 h1:JycKYjjK9+noO3IWvRES6gW65SMUf/efNhaXRqh3u+A= +knative.dev/hack v0.0.0-20220913095247-7556452c2b54/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q= pgregory.net/rapid v0.3.3 h1:jCjBsY4ln4Atz78QoBWxUEvAHaFyNDQg9+WU62aCn1U= pgregory.net/rapid v0.3.3/go.mod h1:UYpPVyjFHzYBGHIxLFoupi8vwk6rXNzRY9OMvVxFIOU= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= diff --git a/vendor/knative.dev/hack/e2e-tests.sh b/vendor/knative.dev/hack/e2e-tests.sh index cb648d7e0..b8cba420f 100644 --- a/vendor/knative.dev/hack/e2e-tests.sh +++ b/vendor/knative.dev/hack/e2e-tests.sh @@ -54,6 +54,7 @@ function go_test_e2e() { # Setup the test cluster for running the tests. function setup_test_cluster() { + ( # Fail fast during setup. set -o errexit set -o pipefail @@ -108,6 +109,7 @@ function setup_test_cluster() { if function_exists test_setup; then test_setup || fail_test "test setup failed" fi + ) } # Signal (as return code and in the logs) that all E2E tests passed. diff --git a/vendor/knative.dev/hack/go.work b/vendor/knative.dev/hack/go.work index b20aabbbc..d9a0de87f 100644 --- a/vendor/knative.dev/hack/go.work +++ b/vendor/knative.dev/hack/go.work @@ -3,5 +3,5 @@ go 1.18 use ( . schema - test/e2e + test ) diff --git a/vendor/knative.dev/hack/go.work.sum b/vendor/knative.dev/hack/go.work.sum index d709822f8..cd1e58259 100644 --- a/vendor/knative.dev/hack/go.work.sum +++ b/vendor/knative.dev/hack/go.work.sum @@ -1,2 +1,12 @@ +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd h1:O7DYs+zxREGLKzKoMQrtrEacpb0ZVXA5rIwylE2Xchk= +golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= +k8s.io/apimachinery v0.20.6 h1:R5p3SlhaABYShQSO6LpPsYHjV05Q+79eBUR0Ut/f4tk= +k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= +k8s.io/klog/v2 v2.4.0 h1:7+X0fUguPyrKEC4WjH8iGDg3laWgMo5tMnRTIGTTxGQ= +sigs.k8s.io/structured-merge-diff v1.0.1-0.20191108220359-b1b620dd3f06 h1:zD2IemQ4LmOcAumeiyDWXKUI2SO0NYDe3H6QGvPOVgU= +sigs.k8s.io/structured-merge-diff/v4 v4.0.3 h1:4oyYo8NREp49LBBhKxEqCulFjg26rawYKrnCmg+Sr6c= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= diff --git a/vendor/knative.dev/hack/infra-library.sh b/vendor/knative.dev/hack/infra-library.sh index f2100fe24..662adfecc 100644 --- a/vendor/knative.dev/hack/infra-library.sh +++ b/vendor/knative.dev/hack/infra-library.sh @@ -133,5 +133,7 @@ function create_gke_test_cluster() { if [[ "${ENABLE_PREEMPTIBLE_NODES:-}" == "true" ]]; then extra_gcloud_flags="${extra_gcloud_flags} --preemptible" fi - run_kntest kubetest2 gke "${_custom_flags[@]}" --test-command="${_test_command[*]}" --extra-gcloud-flags="${extra_gcloud_flags}" + run_kntest kubetest2 gke "${_custom_flags[@]}" \ + --test-command="${_test_command[*]}" \ + --extra-gcloud-flags="${extra_gcloud_flags}" } diff --git a/vendor/knative.dev/hack/library.sh b/vendor/knative.dev/hack/library.sh index 1016d1cc9..faac80df7 100644 --- a/vendor/knative.dev/hack/library.sh +++ b/vendor/knative.dev/hack/library.sh @@ -659,9 +659,8 @@ function foreach_go_module() { local failed=0 local -r cmd="$1" shift - local gomod_filepath gomod_dir - while read -r gomod_filepath; do - gomod_dir="$(dirname "$gomod_filepath")" + local gomod_dir + while read -r gomod_dir; do pushd "$gomod_dir" > /dev/null "$cmd" "$@" || failed=$? popd > /dev/null @@ -669,7 +668,7 @@ function foreach_go_module() { echo "Command '${cmd}' failed in module $gomod_dir: $failed" >&2 return $failed fi - done < <(find . -name go.mod -type f ! -path "*/vendor/*" ! -path "*/third_party/*") + done < <(go_run knative.dev/test-infra/tools/modscope@latest ls -p) } # Update go deps. @@ -766,7 +765,7 @@ function __go_update_deps_for_module() { # Intended to be used like: # export MODULE_NAME=$(go_mod_module_name) function go_mod_module_name() { - grep -E '^module ' go.mod | cut -d' ' -f2 + go_run knative.dev/test-infra/tools/modscope@latest current } # Return a GOPATH to a temp directory. Works around the out-of-GOPATH issues diff --git a/vendor/knative.dev/hack/presubmit-tests.sh b/vendor/knative.dev/hack/presubmit-tests.sh index d99a923a6..1277aed4a 100644 --- a/vendor/knative.dev/hack/presubmit-tests.sh +++ b/vendor/knative.dev/hack/presubmit-tests.sh @@ -139,15 +139,14 @@ function __build_test_runner_for_module() { # Don't merge these two lines, or return code will always be 0. # Get all build tags in go code (ignore /vendor, /hack and /third_party) local tags - tags="$(grep -I -r '// +build' . | \ - grep -v '/vendor/' | \ + tags="$(grep -I -r '// +build' . | grep -v '/vendor/' | \ grep -v '/hack/' | \ grep -v '/third_party' | \ cut -f3 -d' ' | \ tr ',' '\n' | \ sort | uniq | \ grep -v '^!' | \ - tr '\n' ' ')" + paste -s -d, /dev/stdin)" local go_pkg_dirs go_pkg_dirs="$(go list -tags "${tags}" ./...)" || return $? if [[ -z "${go_pkg_dirs}" ]]; then @@ -241,13 +240,14 @@ function run_integration_tests() { function default_integration_test_runner() { local failed=0 - while IFS= read -r e2e_test; do - echo "Running integration test ${e2e_test}" - if ! ${e2e_test}; then - failed=1 - step_failed "${e2e_test}" + while read -r e2e_test; do + subheader "Running integration test ${e2e_test}" + "${e2e_test}" || failed=$? + if (( failed )); then + echo "${e2e_test} failed: $failed" >&2 + return $failed fi - done < <(find test/ ! -name "$(printf "*\n*")" -name "e2e-*tests.sh" -maxdepth 1) + done < <(find test/ -maxdepth 1 ! -name "$(printf "*\n*")" -name "e2e-*tests.sh") return ${failed} } @@ -355,18 +355,18 @@ function main() { exit 0 fi for test_to_run in "${TESTS_TO_RUN[@]}"; do - ${test_to_run} || { failed=1; step_failed "${test_to_run}"; } + ${test_to_run} || { failed=$?; step_failed "${test_to_run}"; } done fi - run_build_tests || { failed=1; step_failed "run_build_tests"; } + run_build_tests || { failed=$?; step_failed "run_build_tests"; } # If PRESUBMIT_TEST_FAIL_FAST is set to true, don't run unit tests if build tests failed if (( ! PRESUBMIT_TEST_FAIL_FAST )) || (( ! failed )); then - run_unit_tests || { failed=1; step_failed "run_unit_tests"; } + run_unit_tests || { failed=$?; step_failed "run_unit_tests"; } fi # If PRESUBMIT_TEST_FAIL_FAST is set to true, don't run integration tests if build/unit tests failed if (( ! PRESUBMIT_TEST_FAIL_FAST )) || (( ! failed )); then - run_integration_tests || { failed=1; step_failed "run_integration_tests"; } + run_integration_tests || { failed=$?; step_failed "run_integration_tests"; } fi exit ${failed} diff --git a/vendor/knative.dev/hack/release.sh b/vendor/knative.dev/hack/release.sh index db01c2a50..703d90344 100644 --- a/vendor/knative.dev/hack/release.sh +++ b/vendor/knative.dev/hack/release.sh @@ -311,7 +311,7 @@ function build_from_source() { # Build a release from source. function sign_release() { - if [ -z "$SIGN_IMAGES" ]; then # Temporary Feature Gate + if [ -z "${SIGN_IMAGES:-}" ]; then # Temporary Feature Gate return 0 fi ## Sign the images with cosign diff --git a/vendor/modules.txt b/vendor/modules.txt index 021d422d4..8f7cd3e2b 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1098,7 +1098,7 @@ k8s.io/utils/net k8s.io/utils/pointer k8s.io/utils/strings/slices k8s.io/utils/trace -# knative.dev/hack v0.0.0-20220908170219-36b2b3c7a245 +# knative.dev/hack v0.0.0-20220913095247-7556452c2b54 ## explicit; go 1.18 knative.dev/hack # sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2