diff --git a/go.mod b/go.mod index d866bd4361c..cf066c06dfc 100644 --- a/go.mod +++ b/go.mod @@ -43,7 +43,7 @@ require ( k8s.io/apiserver v0.18.8 k8s.io/client-go v11.0.1-0.20190805182717-6502b5e7b1b5+incompatible k8s.io/utils v0.0.0-20200603063816-c1c6865ac451 - knative.dev/hack v0.0.0-20201120192952-353db687ec5b + knative.dev/hack v0.0.0-20201125230335-c46a6498e9ed knative.dev/pkg v0.0.0-20201125095035-9bf616d2f46a knative.dev/reconciler-test v0.0.0-20201124190335-83a44efcdfef sigs.k8s.io/yaml v1.2.0 diff --git a/go.sum b/go.sum index c719aadd795..9b092b24dda 100644 --- a/go.sum +++ b/go.sum @@ -1105,8 +1105,9 @@ k8s.io/utils v0.0.0-20200603063816-c1c6865ac451/go.mod h1:jPW/WVKK9YHAvNhRxK0md/ knative.dev/hack v0.0.0-20201112185459-01a34c573bd8/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI= knative.dev/hack v0.0.0-20201118155651-b31d3bb6bff9 h1:OgYL1cATsWTS6kztSOuQqhmYfcn6ZdpPAQQ6TKCx00I= knative.dev/hack v0.0.0-20201118155651-b31d3bb6bff9/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI= -knative.dev/hack v0.0.0-20201120192952-353db687ec5b h1:Lc+AKgwhAZUD98mN++qTHeeaP6FRmS8fcwc/rXkP8G0= knative.dev/hack v0.0.0-20201120192952-353db687ec5b/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI= +knative.dev/hack v0.0.0-20201125230335-c46a6498e9ed h1:DrTU+vxQrNJtySxyNovUtl4si0ozjtU/AYhYaTz34YA= +knative.dev/hack v0.0.0-20201125230335-c46a6498e9ed/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI= knative.dev/pkg v0.0.0-20201117221452-0fccc54273ed/go.mod h1:nxlh3CUvx6WBPr1WKD96AHxFZPD2UKRDo9RUp8ILTyQ= knative.dev/pkg v0.0.0-20201125095035-9bf616d2f46a h1:pdJpLaq50mLKrPWYSQgTH2p64Dk7Fq/xID6l0F69cVY= knative.dev/pkg v0.0.0-20201125095035-9bf616d2f46a/go.mod h1:wXZqP8MXCxb51yNFlecA13BwG7Hk370SWDFWV4dx4ug= diff --git a/hack/generate-yamls.sh b/hack/generate-yamls.sh index 31d42e203e9..654f3bb97da 100755 --- a/hack/generate-yamls.sh +++ b/hack/generate-yamls.sh @@ -62,10 +62,11 @@ RELEASES=( readonly RELEASES # Flags for all ko commands KO_YAML_FLAGS="-P" +KO_FLAGS="${KO_FLAGS:-}" [[ "${KO_DOCKER_REPO}" != gcr.io/* ]] && KO_YAML_FLAGS="" readonly KO_YAML_FLAGS="${KO_YAML_FLAGS} ${KO_FLAGS} --platform=all" -if [[ -n "${TAG}" ]]; then +if [[ -n "${TAG:-}" ]]; then LABEL_YAML_CMD=(sed -e "s|eventing.knative.dev/release: devel|eventing.knative.dev/release: \"${TAG}\"|") else LABEL_YAML_CMD=(cat) diff --git a/test/e2e-common.sh b/test/e2e-common.sh index f36607eb530..ce48acfb69b 100755 --- a/test/e2e-common.sh +++ b/test/e2e-common.sh @@ -16,9 +16,11 @@ # This script includes common functions for testing setup and teardown. +# shellcheck disable=SC1090 + export GO111MODULE=on -source $(dirname $0)/../vendor/knative.dev/hack/e2e-tests.sh +source "$(dirname "${BASH_SOURCE[0]}")/../vendor/knative.dev/hack/e2e-tests.sh" # If gcloud is not available make it a no-op, not an error. which gcloud &>/dev/null || gcloud() { echo "[ignore-gcloud $*]" 1>&2; } @@ -56,14 +58,14 @@ readonly REPLICAS=3 # Should deploy a Knative Monitoring as well readonly DEPLOY_KNATIVE_MONITORING="${DEPLOY_KNATIVE_MONITORING:-1}" -TMP_DIR=$(mktemp -d -t ci-$(date +%Y-%m-%d-%H-%M-%S)-XXXXXXXXXX) +TMP_DIR=$(mktemp -d -t "ci-$(date +%Y-%m-%d-%H-%M-%S)-XXXXXXXXXX") readonly TMP_DIR readonly KNATIVE_DEFAULT_NAMESPACE="knative-eventing" # This the namespace used to install and test Knative Eventing. export SYSTEM_NAMESPACE -SYSTEM_NAMESPACE="${SYSTEM_NAMESPACE:-"knative-eventing-"$(cat /dev/urandom \ - | tr -dc 'a-z0-9' | fold -w 10 | head -n 1)}" +SYSTEM_NAMESPACE="${SYSTEM_NAMESPACE:-"knative-eventing-"$(head -c 128 < \ + /dev/urandom | tr -dc 'a-z0-9' | fold -w 10 | head -n 1)}" # Latest release. If user does not supply this as a flag, the latest # tagged release on the current branch will be used. @@ -109,14 +111,15 @@ function start_knative_eventing_monitoring() { # All generated YAMLs will be available and pointed by the corresponding # environment variables as set in /hack/generate-yamls.sh. function build_knative_from_source() { - local YAML_LIST="$(mktemp)" + local FULL_OUTPUT YAML_LIST LOG_OUTPUT ENV_OUTPUT + YAML_LIST="$(mktemp)" # Generate manifests, capture environment variables pointing to the YAML files. - local FULL_OUTPUT="$( \ - source $(dirname $0)/../hack/generate-yamls.sh ${REPO_ROOT_DIR} ${YAML_LIST} ; \ + FULL_OUTPUT="$( \ + source "$(dirname "${BASH_SOURCE[0]}")/../hack/generate-yamls.sh" "${REPO_ROOT_DIR}" "${YAML_LIST}" ; \ set | grep _YAML=/)" - local LOG_OUTPUT="$(echo "${FULL_OUTPUT}" | grep -v _YAML=/)" - local ENV_OUTPUT="$(echo "${FULL_OUTPUT}" | grep '^[_0-9A-Z]\+_YAML=/')" + LOG_OUTPUT="$(echo "${FULL_OUTPUT}" | grep -v _YAML=/)" + ENV_OUTPUT="$(echo "${FULL_OUTPUT}" | grep '^[_0-9A-Z]\+_YAML=/')" [[ -z "${LOG_OUTPUT}" || -z "${ENV_OUTPUT}" ]] && fail_test "Error generating manifests" # Only import the environment variables pointing to the YAML files. echo "${LOG_OUTPUT}" @@ -198,7 +201,7 @@ function install_latest_release() { } function install_mt_broker() { - if [[ -z "${EVENTING_MT_CHANNEL_BROKER_YAML}" ]]; then + if [[ -z "${EVENTING_MT_CHANNEL_BROKER_YAML:-}" ]]; then build_knative_from_source else echo "use exist EVENTING_MT_CHANNEL_BROKER_YAML" @@ -214,7 +217,7 @@ function install_mt_broker() { } function install_sugar() { - if [[ -z "${EVENTING_SUGAR_CONTROLLER_YAML}" ]]; then + if [[ -z "${EVENTING_SUGAR_CONTROLLER_YAML:-}" ]]; then build_knative_from_source else echo "use exist EVENTING_SUGAR_CONTROLLER_YAML" @@ -290,7 +293,7 @@ function test_setup() { install_test_resources || return 1 echo ">> Publish test images" - "$(dirname "$0")/upload-test-images.sh" e2e || fail_test "Error uploading test images" + "$(dirname "${BASH_SOURCE[0]}")/upload-test-images.sh" e2e || fail_test "Error uploading test images" } # Tear down resources used in the eventing tests. @@ -308,7 +311,7 @@ function uninstall_test_resources() { function install_channel_crds() { echo "Installing In-Memory Channel CRD" - if [[ -z "${EVENTING_IN_MEMORY_CHANNEL_YAML}" ]]; then + if [[ -z "${EVENTING_IN_MEMORY_CHANNEL_YAML:-}" ]]; then build_knative_from_source else echo "use exist EVENTING_SUGAR_CONTROLLER_YAML" diff --git a/test/e2e-upgrade-tests.sh b/test/e2e-upgrade-tests.sh index f74bb68c12c..4bfc6976070 100755 --- a/test/e2e-upgrade-tests.sh +++ b/test/e2e-upgrade-tests.sh @@ -20,15 +20,14 @@ export GO111MODULE=on -source "$(dirname "$0")/e2e-common.sh" - -readonly PROBER_READY_FILE="/tmp/prober-ready" -readonly PROBER_PIPE_FILE="/tmp/prober-signal" +# shellcheck disable=SC1090 +source "$(dirname "${BASH_SOURCE[0]}")/e2e-common.sh" # Overrides function knative_setup { - install_latest_release || fail_test 'Installing latest release of Knative Eventing failed' + # Nothing to do at setup + true } function install_test_resources { @@ -41,41 +40,14 @@ function uninstall_test_resources { true } -initialize $@ --skip-istio-addon - -TIMEOUT=${TIMEOUT:-30m} - -header "Running preupgrade tests" - -go_test_e2e -tags=preupgrade -timeout="${TIMEOUT}" ./test/upgrade || fail_test - -header "Starting prober test" -rm -fv ${PROBER_READY_FILE} -go_test_e2e -tags=probe -timeout="${TIMEOUT}" ./test/upgrade --pipefile="${PROBER_PIPE_FILE}" --readyfile="${PROBER_READY_FILE}" & -PROBER_PID=$! -echo "Prober PID is ${PROBER_PID}" - -wait_for_file ${PROBER_READY_FILE} || fail_test - -header "Performing upgrade to HEAD" -install_head || fail_test 'Installing HEAD version of eventing failed' -install_channel_crds || fail_test 'Installing HEAD channel CRDs failed' -install_mt_broker || fail_test 'Installing HEAD Broker failed' -install_sugar || fail_test 'Installing HEAD Sugar failed' - -header "Running postupgrade tests" -go_test_e2e -tags=postupgrade -timeout="${TIMEOUT}" ./test/upgrade || fail_test - -header "Performing downgrade to latest release" -install_latest_release || fail_test 'Installing latest release of Knative Eventing failed' - -header "Running postdowngrade tests" -go_test_e2e -tags=postdowngrade -timeout="${TIMEOUT}" ./test/upgrade || fail_test +initialize "$@" --skip-istio-addon -# The prober is blocking on ${PROBER_PIPE_FILE} to know when it should exit. -echo "done" > ${PROBER_PIPE_FILE} +TIMEOUT=${TIMEOUT:-60m} -header "Waiting for prober test" -wait ${PROBER_PID} || fail_test "Prober failed" +go_test_e2e \ + -tags=upgrade \ + -timeout="${TIMEOUT}" \ + ./test/upgrade \ + || fail_test success diff --git a/test/presubmit-tests.sh b/test/presubmit-tests.sh index 2c53eb0d0ce..9466836fd69 100755 --- a/test/presubmit-tests.sh +++ b/test/presubmit-tests.sh @@ -23,12 +23,14 @@ # Prefer sockpuppet over markdown presubmit checks, as it will correct # markdown issues with less human involvement. -export DISABLE_MD_LINTING=1 +# shellcheck disable=SC1090 + +export DISABLE_MD_LINTING=1 export GO111MODULE=on -source $(dirname $0)/../vendor/knative.dev/hack/presubmit-tests.sh +source "$(dirname "${BASH_SOURCE[0]}")/../vendor/knative.dev/hack/presubmit-tests.sh" # We use the default build, unit and integration test runners. -main $@ +main "$@" diff --git a/test/upgrade/continual.go b/test/upgrade/continual.go new file mode 100644 index 00000000000..e5ff5af2734 --- /dev/null +++ b/test/upgrade/continual.go @@ -0,0 +1,44 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package upgrade + +import ( + "context" + + testlib "knative.dev/eventing/test/lib" + "knative.dev/eventing/test/upgrade/prober" + pkgupgrade "knative.dev/pkg/test/upgrade" +) + +func ContinualTest() pkgupgrade.BackgroundOperation { + ctx := context.Background() + var client *testlib.Client + var probe prober.Prober + return pkgupgrade.NewBackgroundVerification("EventingContinualTest", + func(c pkgupgrade.Context) { + // setup + client = testlib.Setup(c.T, false) + config := prober.NewConfig(client.Namespace) + probe = prober.RunEventProber(ctx, c.Log, client, config) + }, + func(c pkgupgrade.Context) { + // verify + defer testlib.TearDown(client) + prober.AssertEventProber(ctx, c.T, probe) + }, + ) +} diff --git a/test/upgrade/installation/git_head.go b/test/upgrade/installation/git_head.go new file mode 100644 index 00000000000..61ac877d52c --- /dev/null +++ b/test/upgrade/installation/git_head.go @@ -0,0 +1,40 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package installation + +import ( + pkgupgrade "knative.dev/pkg/test/upgrade" +) + +func GitHead() pkgupgrade.Operation { + return pkgupgrade.NewOperation("EventingGitHead", func(c pkgupgrade.Context) { + ops := []string{ + "install_head", + "install_channel_crds", + "install_mt_broker", + "install_sugar", + } + for _, shellfunc := range ops { + c.Log.Info("Running shell function: ", shellfunc) + err := callShellFunction(shellfunc) + if err != nil { + c.T.Error(err) + return + } + } + }) +} diff --git a/test/upgrade/installation/latest.go b/test/upgrade/installation/latest.go new file mode 100644 index 00000000000..d94ddc079c1 --- /dev/null +++ b/test/upgrade/installation/latest.go @@ -0,0 +1,33 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package installation + +import ( + pkgupgrade "knative.dev/pkg/test/upgrade" +) + +func LatestStable() pkgupgrade.Operation { + return pkgupgrade.NewOperation("EventingLatestRelease", func(c pkgupgrade.Context) { + shellfunc := "install_latest_release" + c.Log.Info("Running shell function: ", shellfunc) + err := callShellFunction(shellfunc) + if err != nil { + c.T.Error(err) + return + } + }) +} diff --git a/test/upgrade/installation/shell.go b/test/upgrade/installation/shell.go new file mode 100644 index 00000000000..e51ca41d418 --- /dev/null +++ b/test/upgrade/installation/shell.go @@ -0,0 +1,39 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package installation + +import ( + "knative.dev/hack/shell" +) + +func callShellFunction(funcName string) error { + loc, err := shell.NewProjectLocation("../../..") + if err != nil { + return err + } + exec := shell.NewExecutor(shell.ExecutorConfig{ + ProjectLocation: loc, + }) + fn := shell.Function{ + Script: shell.Script{ + Label: funcName, + ScriptPath: "test/e2e-common.sh", + }, + FunctionName: funcName, + } + return exec.RunFunction(fn) +} diff --git a/test/upgrade/postdowngrade.go b/test/upgrade/postdowngrade.go new file mode 100644 index 00000000000..8ee96252ead --- /dev/null +++ b/test/upgrade/postdowngrade.go @@ -0,0 +1,27 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package upgrade + +import ( + pkgupgrade "knative.dev/pkg/test/upgrade" +) + +func PostDowngradeTest() pkgupgrade.Operation { + return pkgupgrade.NewOperation("EventingPostDowngradeTest", func(c pkgupgrade.Context) { + runSmokeTest(c.T) + }) +} diff --git a/test/upgrade/postdowngrade_test.go b/test/upgrade/postdowngrade_test.go deleted file mode 100644 index 25f70a2cb97..00000000000 --- a/test/upgrade/postdowngrade_test.go +++ /dev/null @@ -1,26 +0,0 @@ -// +build postdowngrade - -/* - * Copyright 2020 The Knative Authors - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package upgrade - -import ( - "testing" -) - -func TestPostDowngrade(t *testing.T) { - runSmokeTest(t) -} diff --git a/test/upgrade/postupgrade.go b/test/upgrade/postupgrade.go new file mode 100644 index 00000000000..7089ef52fb8 --- /dev/null +++ b/test/upgrade/postupgrade.go @@ -0,0 +1,27 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package upgrade + +import ( + pkgupgrade "knative.dev/pkg/test/upgrade" +) + +func PostUpgradeTest() pkgupgrade.Operation { + return pkgupgrade.NewOperation("EventingPostUpgradeTest", func(c pkgupgrade.Context) { + runSmokeTest(c.T) + }) +} diff --git a/test/upgrade/postupgrade_test.go b/test/upgrade/postupgrade_test.go deleted file mode 100644 index ed5351c2a3e..00000000000 --- a/test/upgrade/postupgrade_test.go +++ /dev/null @@ -1,26 +0,0 @@ -// +build postupgrade - -/* - * Copyright 2020 The Knative Authors - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package upgrade - -import ( - "testing" -) - -func TestPostUpgrade(t *testing.T) { - runSmokeTest(t) -} diff --git a/test/upgrade/preupgrade.go b/test/upgrade/preupgrade.go new file mode 100644 index 00000000000..cd4f911f548 --- /dev/null +++ b/test/upgrade/preupgrade.go @@ -0,0 +1,27 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package upgrade + +import ( + pkgupgrade "knative.dev/pkg/test/upgrade" +) + +func PreUpgradeTest() pkgupgrade.Operation { + return pkgupgrade.NewOperation("EventingPreUpgradeTest", func(c pkgupgrade.Context) { + runSmokeTest(c.T) + }) +} diff --git a/test/upgrade/preupgrade_test.go b/test/upgrade/preupgrade_test.go deleted file mode 100644 index 144c41e35fe..00000000000 --- a/test/upgrade/preupgrade_test.go +++ /dev/null @@ -1,26 +0,0 @@ -// +build preupgrade - -/* - * Copyright 2020 The Knative Authors - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package upgrade - -import ( - "testing" -) - -func TestPreUpgrade(t *testing.T) { - runSmokeTest(t) -} diff --git a/test/upgrade/probe_test.go b/test/upgrade/probe_test.go deleted file mode 100644 index 67882aac4a0..00000000000 --- a/test/upgrade/probe_test.go +++ /dev/null @@ -1,82 +0,0 @@ -// +build probe - -/* - * Copyright 2020 The Knative Authors - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package upgrade - -import ( - "context" - "io/ioutil" - "os" - "syscall" - "testing" - - "knative.dev/eventing/test" - - "github.com/wavesoftware/go-ensure" - "go.uber.org/zap" - "knative.dev/eventing/test/upgrade/prober" -) - -const ( - readyMessage = "prober ready" -) - -func TestEventsPropagationWithProber(t *testing.T) { - // We run the prober as a golang test because it fits in nicely with - // the rest of our integration tests, and AssertProberDefault needs - // a *testing.T. Unfortunately, "go test" intercepts signals, so we - // can't coordinate with the test by just sending e.g. SIGCONT, so we - // create a named pipe and wait for the upgrade script to write to it - // to signal that we should stop probing. - ensureTempFilesAreCleaned() - if err := syscall.Mkfifo(test.EventingFlags.PipeFile, 0666); err != nil { - t.Fatal("Failed to create pipe:", err) - } - defer ensureTempFilesAreCleaned() - client := setup(t, false) - defer tearDown(client) - - config := prober.NewConfig(client.Namespace) - - // Use zap.SugarLogger instead of t.Logf because we want to see failures - // inline with other logs instead of buffered until the end. - log := createLogger() - probe := prober.RunEventProber(context.Background(), log, client, config) - ensure.NoError(ioutil.WriteFile(test.EventingFlags.ReadyFile, []byte(readyMessage), 0666)) - defer prober.AssertEventProber(context.Background(), t, probe) - - log.Infof("Waiting for file: %v as a signal that "+ - "upgrade/downgrade is over, at which point we will finish the test "+ - "and check the prober.", test.EventingFlags.PipeFile) - _, _ = ioutil.ReadFile(test.EventingFlags.PipeFile) -} - -func createLogger() *zap.SugaredLogger { - log, err := zap.NewDevelopment() - ensure.NoError(err) - return log.Sugar() -} - -func ensureTempFilesAreCleaned() { - filenames := []string{test.EventingFlags.PipeFile, test.EventingFlags.ReadyFile} - for _, filename := range filenames { - _, err := os.Stat(filename) - if err == nil { - ensure.NoError(os.Remove(filename)) - } - } -} diff --git a/test/upgrade/smoke.go b/test/upgrade/smoke.go new file mode 100644 index 00000000000..d7c47b9ba77 --- /dev/null +++ b/test/upgrade/smoke.go @@ -0,0 +1,39 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package upgrade + +import ( + "context" + "testing" + + cloudevents "github.com/cloudevents/sdk-go/v2" + "knative.dev/eventing/test/e2e/helpers" + "knative.dev/eventing/test/lib" +) + +var channelTestRunner lib.ComponentsTestRunner + +func runSmokeTest(t *testing.T) { + helpers.SingleEventForChannelTestHelper( + context.Background(), + t, + cloudevents.EncodingBinary, + helpers.SubscriptionV1beta1, + "", + channelTestRunner, + ) +} diff --git a/test/upgrade/smoke_test.go b/test/upgrade/smoke_test.go deleted file mode 100644 index 41789d8b5c1..00000000000 --- a/test/upgrade/smoke_test.go +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2020 The Knative Authors - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package upgrade - -import ( - "context" - "testing" - - cloudevents "github.com/cloudevents/sdk-go/v2" - "knative.dev/eventing/test/e2e/helpers" -) - -func runSmokeTest(t *testing.T) { - helpers.SingleEventForChannelTestHelper( - context.Background(), - t, - cloudevents.EncodingBinary, - helpers.SubscriptionV1beta1, - "", - channelTestRunner, - ) -} diff --git a/test/upgrade/upgrade_test.go b/test/upgrade/upgrade_test.go new file mode 100644 index 00000000000..2157cdd26ad --- /dev/null +++ b/test/upgrade/upgrade_test.go @@ -0,0 +1,79 @@ +// +build upgrade + +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package upgrade + +import ( + "os" + "testing" + + "go.uber.org/zap" + "knative.dev/eventing/test" + testlib "knative.dev/eventing/test/lib" + "knative.dev/eventing/test/upgrade/installation" + pkgupgrade "knative.dev/pkg/test/upgrade" +) + +func TestEventingUpgrades(t *testing.T) { + suite := pkgupgrade.Suite{ + Tests: pkgupgrade.Tests{ + PreUpgrade: []pkgupgrade.Operation{ + PreUpgradeTest(), + }, + PostUpgrade: []pkgupgrade.Operation{ + PostUpgradeTest(), + }, + PostDowngrade: []pkgupgrade.Operation{ + PostDowngradeTest(), + }, + Continual: []pkgupgrade.BackgroundOperation{ + ContinualTest(), + }, + }, + Installations: pkgupgrade.Installations{ + Base: []pkgupgrade.Operation{ + installation.LatestStable(), + }, + UpgradeWith: []pkgupgrade.Operation{ + installation.GitHead(), + }, + DowngradeWith: []pkgupgrade.Operation{ + installation.LatestStable(), + }, + }, + } + c := newUpgradeConfig(t) + suite.Execute(c) +} + +func newUpgradeConfig(t *testing.T) pkgupgrade.Configuration { + log, err := zap.NewDevelopment() + if err != nil { + t.Fatal(err) + } + return pkgupgrade.Configuration{T: t, Log: log} +} + +func TestMain(m *testing.M) { + test.InitializeEventingFlags() + channelTestRunner = testlib.ComponentsTestRunner{ + ComponentFeatureMap: testlib.ChannelFeatureMap, + ComponentsToTest: test.EventingFlags.Channels, + } + os.Exit(m.Run()) +} diff --git a/third_party/VENDOR-LICENSE/knative.dev/hack/shell/LICENSE b/third_party/VENDOR-LICENSE/knative.dev/hack/shell/LICENSE new file mode 100644 index 00000000000..261eeb9e9f8 --- /dev/null +++ b/third_party/VENDOR-LICENSE/knative.dev/hack/shell/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/knative.dev/hack/microbenchmarks.sh b/vendor/knative.dev/hack/microbenchmarks.sh new file mode 100644 index 00000000000..440af2e1410 --- /dev/null +++ b/vendor/knative.dev/hack/microbenchmarks.sh @@ -0,0 +1,59 @@ +#!/usr/bin/env bash + +# Copyright 2019 The Knative Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +function microbenchmarks_run() { + if [ "$1" != "" ]; then + OUTPUT_FILE="$1" + else + OUTPUT_FILE="${ARTIFACTS:-$(mktemp -d)}/bench-result.txt" + fi + + echo "Output will be at $OUTPUT_FILE" + + # Run all microbenchmarks + go clean + go test -bench=. -benchmem -run="^$" -v ./... >> "$OUTPUT_FILE" || exit +} + +function microbenchmarks_run_and_compare() { + if [ "$1" == "" ] || [ $# -gt 1 ]; then + echo "Error: Expecting an argument" >&2 + echo "usage: $(basename $0) revision_to_compare" >&2 + exit 1 + fi + + # Benchstat is required to compare the bench results + GO111MODULE=off go get golang.org/x/perf/cmd/benchstat + + # Revision to use to compare with actual + REVISION="$1" + OUTPUT_DIR=${ARTIFACTS:-$(mktemp -d)} + + echo "Outputs will be at $OUTPUT_DIR" + + # Run this revision benchmarks + microbenchmarks_run "$OUTPUT_DIR/new.txt" + + # Run other revision benchmarks + git checkout "$REVISION" + microbenchmarks_run "$OUTPUT_DIR/old.txt" + + # Print results in console + benchstat "$OUTPUT_DIR/old.txt" "$OUTPUT_DIR/new.txt" + + # Generate html results + benchstat -html "$OUTPUT_DIR/old.txt" "$OUTPUT_DIR/new.txt" >> "$OUTPUT_DIR/results.html" +} diff --git a/vendor/knative.dev/hack/shell/executor.go b/vendor/knative.dev/hack/shell/executor.go new file mode 100644 index 00000000000..e6308a0706f --- /dev/null +++ b/vendor/knative.dev/hack/shell/executor.go @@ -0,0 +1,189 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package shell + +import ( + "errors" + "fmt" + "io/ioutil" + "os" + "os/exec" + "strings" + "time" +) + +const ( + defaultLabelOut = "[OUT]" + defaultLabelErr = "[ERR]" + executeMode = 0700 +) + +// ErrNoProjectLocation is returned if user didnt provided the project location. +var ErrNoProjectLocation = errors.New("project location isn't provided") + +// NewExecutor creates a new executor from given config. +func NewExecutor(config ExecutorConfig) Executor { + configureDefaultValues(&config) + return &streamingExecutor{ + ExecutorConfig: config, + } +} + +// RunScript executes a shell script with args. +func (s *streamingExecutor) RunScript(script Script, args ...string) error { + err := validate(s.ExecutorConfig) + if err != nil { + return err + } + cnt := script.scriptContent(s.ProjectLocation, args) + return withTempScript(cnt, func(bin string) error { + return stream(bin, s.ExecutorConfig, script.Label) + }) +} + +// RunFunction executes a shell function with args. +func (s *streamingExecutor) RunFunction(fn Function, args ...string) error { + err := validate(s.ExecutorConfig) + if err != nil { + return err + } + cnt := fn.scriptContent(s.ProjectLocation, args) + return withTempScript(cnt, func(bin string) error { + return stream(bin, s.ExecutorConfig, fn.Label) + }) +} + +type streamingExecutor struct { + ExecutorConfig +} + +func validate(config ExecutorConfig) error { + if config.ProjectLocation == nil { + return ErrNoProjectLocation + } + return nil +} + +func configureDefaultValues(config *ExecutorConfig) { + if config.Out == nil { + config.Out = os.Stdout + } + if config.Err == nil { + config.Err = os.Stderr + } + if config.LabelOut == "" { + config.LabelOut = defaultLabelOut + } + if config.LabelErr == "" { + config.LabelErr = defaultLabelErr + } + if config.Environ == nil { + config.Environ = os.Environ() + } + if !config.SkipDate && config.DateFormat == "" { + config.DateFormat = time.StampMilli + } + if config.PrefixFunc == nil { + config.PrefixFunc = defaultPrefixFunc + } +} + +func stream(bin string, cfg ExecutorConfig, label string) error { + c := exec.Command(bin) + c.Env = cfg.Environ + c.Stdout = NewPrefixer(cfg.Out, prefixFunc(StreamTypeOut, label, cfg)) + c.Stderr = NewPrefixer(cfg.Err, prefixFunc(StreamTypeErr, label, cfg)) + return c.Run() +} + +func prefixFunc(st StreamType, label string, cfg ExecutorConfig) func() string { + return func() string { + return cfg.PrefixFunc(st, label, cfg) + } +} + +func defaultPrefixFunc(st StreamType, label string, cfg ExecutorConfig) string { + sep := " " + var buf []string + if !cfg.SkipDate { + dt := time.Now().Format(cfg.DateFormat) + buf = append(buf, dt) + } + buf = append(buf, label) + switch st { + case StreamTypeOut: + buf = append(buf, cfg.LabelOut) + case StreamTypeErr: + buf = append(buf, cfg.LabelErr) + } + return strings.Join(buf, sep) + sep +} + +func withTempScript(contents string, fn func(bin string) error) error { + tmpfile, err := ioutil.TempFile("", "shellout-*.sh") + if err != nil { + return err + } + _, err = tmpfile.WriteString(contents) + if err != nil { + return err + } + err = tmpfile.Chmod(executeMode) + if err != nil { + return err + } + err = tmpfile.Close() + if err != nil { + return err + } + defer func() { + // clean up + _ = os.Remove(tmpfile.Name()) + }() + + return fn(tmpfile.Name()) +} + +func (fn *Function) scriptContent(location ProjectLocation, args []string) string { + return fmt.Sprintf(`#!/usr/bin/env bash + +set -Eeuo pipefail + +cd "%s" +source %s + +%s %s +`, location.RootPath(), fn.ScriptPath, fn.FunctionName, quoteArgs(args)) +} + +func (sc *Script) scriptContent(location ProjectLocation, args []string) string { + return fmt.Sprintf(`#!/usr/bin/env bash + +set -Eeuo pipefail + +cd "%s" +%s %s +`, location.RootPath(), sc.ScriptPath, quoteArgs(args)) +} + +func quoteArgs(args []string) string { + quoted := make([]string, len(args)) + for i, arg := range args { + quoted[i] = "\"" + strings.ReplaceAll(arg, "\"", "\\\"") + "\"" + } + return strings.Join(quoted, " ") +} diff --git a/vendor/knative.dev/hack/shell/fail-example.sh b/vendor/knative.dev/hack/shell/fail-example.sh new file mode 100644 index 00000000000..551ce662a34 --- /dev/null +++ b/vendor/knative.dev/hack/shell/fail-example.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +# Copyright 2020 The Knative Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +echo "$*" >&2 diff --git a/vendor/knative.dev/hack/shell/prefixer.go b/vendor/knative.dev/hack/shell/prefixer.go new file mode 100644 index 00000000000..273ee1cc4ff --- /dev/null +++ b/vendor/knative.dev/hack/shell/prefixer.go @@ -0,0 +1,68 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package shell + +import ( + "bytes" + "io" +) + +// NewPrefixer creates a new prefixer that forwards all calls to Write() to +// writer.Write() with all lines prefixed with the value of prefix. Having a +// function instead of a static prefix allows to print timestamps or other +// changing information. +func NewPrefixer(writer io.Writer, prefix func() string) io.Writer { + return &prefixer{prefix: prefix, writer: writer, trailingNewline: true} +} + +type prefixer struct { + prefix func() string + writer io.Writer + trailingNewline bool + buf bytes.Buffer // reuse buffer to save allocations +} + +func (pf *prefixer) Write(payload []byte) (int, error) { + pf.buf.Reset() // clear the buffer + + for _, b := range payload { + if pf.trailingNewline { + pf.buf.WriteString(pf.prefix()) + pf.trailingNewline = false + } + + pf.buf.WriteByte(b) + + if b == '\n' { + // do not print the prefix right after the newline character as this might + // be the very last character of the stream and we want to avoid a trailing prefix. + pf.trailingNewline = true + } + } + + n, err := pf.writer.Write(pf.buf.Bytes()) + if err != nil { + // never return more than original length to satisfy io.Writer interface + if n > len(payload) { + n = len(payload) + } + return n, err + } + + // return original length to satisfy io.Writer interface + return len(payload), nil +} diff --git a/vendor/knative.dev/hack/shell/project.go b/vendor/knative.dev/hack/shell/project.go new file mode 100644 index 00000000000..2d7ba9738b0 --- /dev/null +++ b/vendor/knative.dev/hack/shell/project.go @@ -0,0 +1,52 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package shell + +import ( + "errors" + "path" + "runtime" +) + +// ErrCantGetCaller is raised when we can't calculate a caller of NewProjectLocation. +var ErrCantGetCaller = errors.New("can't get caller") + +// NewProjectLocation creates a ProjectLocation that is used to calculate +// relative paths within the project. +func NewProjectLocation(pathToRoot string) (ProjectLocation, error) { + _, filename, _, ok := runtime.Caller(1) + if !ok { + return nil, ErrCantGetCaller + } + return &callerLocation{ + caller: filename, + pathToRoot: pathToRoot, + }, nil +} + +// RootPath return a path to root of the project. +func (c *callerLocation) RootPath() string { + return path.Join(path.Dir(c.caller), c.pathToRoot) +} + +// callerLocation holds a caller Go file, and a relative location to a project +// root directory. This information can be used to calculate relative paths and +// properly source shell scripts. +type callerLocation struct { + caller string + pathToRoot string +} diff --git a/vendor/knative.dev/hack/shell/types.go b/vendor/knative.dev/hack/shell/types.go new file mode 100644 index 00000000000..8e34515206d --- /dev/null +++ b/vendor/knative.dev/hack/shell/types.go @@ -0,0 +1,82 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package shell + +import "io" + +// ProjectLocation represents a project location on a file system. +type ProjectLocation interface { + RootPath() string +} + +// Script represents a script to be executed. +type Script struct { + Label string + ScriptPath string +} + +// Function represents a function, whom will be sourced from Script file, +// and executed. +type Function struct { + Script + FunctionName string +} + +// ExecutorConfig holds a executor configuration options. +type ExecutorConfig struct { + ProjectLocation + Streams + Labels + Environ []string +} + +// StreamType represets either output or error stream. +type StreamType int + +const ( + // StreamTypeOut represents process output stream. + StreamTypeOut StreamType = iota + // StreamTypeErr represents process error stream. + StreamTypeErr +) + +// PrefixFunc is used to build a prefix that will be added to each line of the +// script/function output or error stream. +type PrefixFunc func(st StreamType, label string, config ExecutorConfig) string + +// Labels holds a labels to be used to prefix Out and Err streams of executed +// shells scripts/functions. +type Labels struct { + LabelOut string + LabelErr string + SkipDate bool + DateFormat string + PrefixFunc +} + +// Streams holds a streams of a shell scripts/functions. +type Streams struct { + Out io.Writer + Err io.Writer +} + +// Executor represents a executor that can execute shell scripts and call +// functions directly. +type Executor interface { + RunScript(script Script, args ...string) error + RunFunction(fn Function, args ...string) error +} diff --git a/vendor/knative.dev/pkg/test/upgrade/functions.go b/vendor/knative.dev/pkg/test/upgrade/functions.go new file mode 100644 index 00000000000..50dc637fefa --- /dev/null +++ b/vendor/knative.dev/pkg/test/upgrade/functions.go @@ -0,0 +1,162 @@ +/* + * Copyright 2020 The Knative Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package upgrade + +import ( + "time" + + "go.uber.org/zap" +) + +// Execute the Suite of upgrade tests with a Configuration given. +func (s *Suite) Execute(c Configuration) { + l := c.logger() + se := suiteExecution{ + suite: enrichSuite(s), + configuration: c, + failed: false, + logger: l, + } + l.Info("🏃 Running upgrade test suite...") + + se.execute() + + if !se.failed { + l.Info("🥳🎉 Success! Upgrade suite completed without errors.") + } else { + l.Error("💣🤬💔️ Upgrade suite have failed!") + } +} + +// NewOperation creates a new upgrade operation or test. +func NewOperation(name string, handler func(c Context)) Operation { + return &simpleOperation{name: name, handler: handler} +} + +// NewBackgroundVerification is convenience function to easily setup a +// background operation that will setup environment and then verify environment +// status after receiving a StopEvent. +func NewBackgroundVerification(name string, setup func(c Context), verify func(c Context)) BackgroundOperation { + return NewBackgroundOperation(name, setup, func(bc BackgroundContext) { + WaitForStopEvent(bc, WaitForStopEventConfiguration{ + Name: name, + OnStop: func(event StopEvent) { + verify(Context{ + T: event.T, + Log: bc.Log, + }) + }, + OnWait: DefaultOnWait, + WaitTime: DefaultWaitTime, + }) + }) +} + +// NewBackgroundOperation creates a new background operation or test that can be +// notified to stop its operation. +func NewBackgroundOperation(name string, setup func(c Context), + handler func(bc BackgroundContext)) BackgroundOperation { + return &simpleBackgroundOperation{ + name: name, + setup: setup, + handler: handler, + } +} + +// WaitForStopEvent will wait until upgrade suite sends a stop event to it. +// After that happen a handler is invoked to verify environment state and report +// failures. +func WaitForStopEvent(bc BackgroundContext, w WaitForStopEventConfiguration) { + for { + select { + case stopEvent := <-bc.Stop: + handleStopEvent(stopEvent, bc, w) + return + default: + w.OnWait(bc, w) + } + time.Sleep(w.WaitTime) + } +} + +func (c Configuration) logger() *zap.SugaredLogger { + return c.Log.Sugar() +} + +// Name returns a friendly human readable text. +func (s *StopEvent) Name() string { + return s.name +} + +func handleStopEvent( + se StopEvent, + bc BackgroundContext, + wc WaitForStopEventConfiguration, +) { + bc.Log.Infof("%s have received a stop event: %s", wc.Name, se.Name()) + defer close(se.Finished) + wc.OnStop(se) +} + +func enrichSuite(s *Suite) *enrichedSuite { + es := &enrichedSuite{ + installations: s.Installations, + tests: enrichedTests{ + preUpgrade: s.Tests.PreUpgrade, + postUpgrade: s.Tests.PostUpgrade, + postDowngrade: s.Tests.PostDowngrade, + continual: make([]stoppableOperation, len(s.Tests.Continual)), + }, + } + for i, test := range s.Tests.Continual { + es.tests.continual[i] = stoppableOperation{ + BackgroundOperation: test, + stop: make(chan StopEvent), + } + } + return es +} + +// Name is a human readable operation title, and it will be used in t.Run. +func (h *simpleOperation) Name() string { + return h.name +} + +// Handler is a function that will be called to perform an operation. +func (h *simpleOperation) Handler() func(c Context) { + return h.handler +} + +// Name is a human readable operation title, and it will be used in t.Run. +func (s *simpleBackgroundOperation) Name() string { + return s.name +} + +// Setup method may be used to set up environment before upgrade/downgrade is +// performed. +func (s *simpleBackgroundOperation) Setup() func(c Context) { + return s.setup +} + +// Handler will be executed in background while upgrade/downgrade is being +// executed. It can be used to constantly validate environment during that +// time and/or wait for StopEvent being sent. After StopEvent is received +// user should validate environment, clean up resources, and report found +// issues to testing.T forwarded in StepEvent. +func (s *simpleBackgroundOperation) Handler() func(bc BackgroundContext) { + return s.handler +} diff --git a/vendor/knative.dev/pkg/test/upgrade/private_types.go b/vendor/knative.dev/pkg/test/upgrade/private_types.go new file mode 100644 index 00000000000..e34f090050f --- /dev/null +++ b/vendor/knative.dev/pkg/test/upgrade/private_types.go @@ -0,0 +1,63 @@ +/* + * Copyright 2020 The Knative Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package upgrade + +import "go.uber.org/zap" + +type suiteExecution struct { + suite *enrichedSuite + configuration Configuration + failed bool + logger *zap.SugaredLogger +} + +type enrichedSuite struct { + installations Installations + tests enrichedTests +} + +type enrichedTests struct { + preUpgrade []Operation + postUpgrade []Operation + postDowngrade []Operation + continual []stoppableOperation +} + +type stoppableOperation struct { + BackgroundOperation + stop chan StopEvent +} + +type operationGroup struct { + num int + operations []Operation + groupName string + groupTemplate string + elementTemplate string + skippingGroupTemplate string +} + +type simpleOperation struct { + name string + handler func(c Context) +} + +type simpleBackgroundOperation struct { + name string + setup func(c Context) + handler func(bc BackgroundContext) +} diff --git a/vendor/knative.dev/pkg/test/upgrade/steps.go b/vendor/knative.dev/pkg/test/upgrade/steps.go new file mode 100644 index 00000000000..c50bdcfb627 --- /dev/null +++ b/vendor/knative.dev/pkg/test/upgrade/steps.go @@ -0,0 +1,155 @@ +/* + * Copyright 2020 The Knative Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package upgrade + +import ( + "testing" +) + +const skippingOperationTemplate = `Skipping "%s" as previous operation have failed` + +func (se *suiteExecution) installingBase(num int) { + se.processOperationGroup(operationGroup{ + num: num, + operations: se.suite.installations.Base, + groupName: "InstallingBase", + elementTemplate: `%d.%d) Installing base install of "%s".`, + skippingGroupTemplate: "%d) 💿 No base installation registered. Skipping.", + groupTemplate: "%d) 💿 Installing base installations. %d are registered.", + }) +} + +func (se *suiteExecution) preUpgradeTests(num int) { + se.processOperationGroup(operationGroup{ + num: num, + operations: se.suite.tests.preUpgrade, + groupName: "PreUpgradeTests", + elementTemplate: `%d.%d) Testing with "%s".`, + skippingGroupTemplate: "%d) ✅️️ No pre upgrade tests registered. Skipping.", + groupTemplate: "%d) ✅️️ Testing functionality before upgrade is performed." + + " %d tests are registered.", + }) +} + +func (se *suiteExecution) startContinualTests(num int) { + l := se.logger + operations := se.suite.tests.continual + groupTemplate := "%d) 🔄 Starting continual tests. " + + "%d tests are registered." + elementTemplate := `%d.%d) Starting continual tests of "%s".` + numOps := len(operations) + se.configuration.T.Run("ContinualTests", func(t *testing.T) { + if numOps > 0 { + l.Infof(groupTemplate, num, numOps) + for i := range operations { + operation := operations[i] + l.Infof(elementTemplate, num, i+1, operation.Name()) + if se.failed { + l.Debugf(skippingOperationTemplate, operation.Name()) + return + } + setup := operation.Setup() + t.Run("Setup"+operation.Name(), func(t *testing.T) { + setup(Context{T: t, Log: l}) + }) + handler := operation.Handler() + go func() { + bc := BackgroundContext{Log: l, Stop: operation.stop} + handler(bc) + }() + + se.failed = se.failed || t.Failed() + if se.failed { + return + } + } + + } else { + l.Infof("%d) 🔄 No continual tests registered. Skipping.", num) + } + }) +} + +func (se *suiteExecution) verifyContinualTests(num int) { + l := se.logger + testsCount := len(se.suite.tests.continual) + if testsCount > 0 { + se.configuration.T.Run("VerifyContinualTests", func(t *testing.T) { + l.Infof("%d) ✋ Verifying %d running continual tests.", num, testsCount) + for i, operation := range se.suite.tests.continual { + t.Run(operation.Name(), func(t *testing.T) { + l.Infof(`%d.%d) Verifying "%s".`, num, i+1, operation.Name()) + finished := make(chan struct{}) + operation.stop <- StopEvent{ + T: t, + Finished: finished, + name: "Stop of " + operation.Name(), + } + <-finished + se.failed = se.failed || t.Failed() + l.Debugf(`Finished "%s"`, operation.Name()) + }) + } + }) + } +} + +func (se *suiteExecution) upgradeWith(num int) { + se.processOperationGroup(operationGroup{ + num: num, + operations: se.suite.installations.UpgradeWith, + groupName: "UpgradeWith", + elementTemplate: `%d.%d) Upgrading with "%s".`, + skippingGroupTemplate: "%d) 📀 No upgrade operations registered. Skipping.", + groupTemplate: "%d) 📀 Upgrading with %d registered operations.", + }) +} + +func (se *suiteExecution) postUpgradeTests(num int) { + se.processOperationGroup(operationGroup{ + num: num, + operations: se.suite.tests.postUpgrade, + groupName: "PostUpgradeTests", + elementTemplate: `%d.%d) Testing with "%s".`, + skippingGroupTemplate: "%d) ✅️️ No post upgrade tests registered. Skipping.", + groupTemplate: "%d) ✅️️ Testing functionality after upgrade is performed." + + " %d tests are registered.", + }) +} + +func (se *suiteExecution) downgradeWith(num int) { + se.processOperationGroup(operationGroup{ + num: num, + operations: se.suite.installations.DowngradeWith, + groupName: "DowngradeWith", + elementTemplate: `%d.%d) Downgrading with "%s".`, + skippingGroupTemplate: "%d) 💿 No downgrade operations registered. Skipping.", + groupTemplate: "%d) 💿 Downgrading with %d registered operations.", + }) +} + +func (se *suiteExecution) postDowngradeTests(num int) { + se.processOperationGroup(operationGroup{ + num: num, + operations: se.suite.tests.postDowngrade, + groupName: "PostDowngradeTests", + elementTemplate: `%d.%d) Testing with "%s".`, + skippingGroupTemplate: "%d) ✅️️ No post downgrade tests registered. Skipping.", + groupTemplate: "%d) ✅️️ Testing functionality after downgrade is performed." + + " %d tests are registered.", + }) +} diff --git a/vendor/knative.dev/pkg/test/upgrade/suite_execution.go b/vendor/knative.dev/pkg/test/upgrade/suite_execution.go new file mode 100644 index 00000000000..70c5ea095ea --- /dev/null +++ b/vendor/knative.dev/pkg/test/upgrade/suite_execution.go @@ -0,0 +1,85 @@ +/* + * Copyright 2020 The Knative Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package upgrade + +import ( + "testing" +) + +func (se *suiteExecution) processOperationGroup(op operationGroup) { + l := se.logger + se.configuration.T.Run(op.groupName, func(t *testing.T) { + if len(op.operations) > 0 { + l.Infof(op.groupTemplate, op.num, len(op.operations)) + for i, operation := range op.operations { + l.Infof(op.elementTemplate, op.num, i+1, operation.Name()) + if se.failed { + l.Debugf(skippingOperationTemplate, operation.Name()) + return + } + handler := operation.Handler() + t.Run(operation.Name(), func(t *testing.T) { + handler(Context{T: t, Log: l}) + }) + se.failed = se.failed || t.Failed() + if se.failed { + return + } + } + } else { + l.Infof(op.skippingGroupTemplate, op.num) + } + }) +} + +func (se *suiteExecution) execute() { + idx := 1 + operations := []func(num int){ + se.installingBase, + se.preUpgradeTests, + } + for _, operation := range operations { + operation(idx) + idx++ + if se.failed { + return + } + } + + se.startContinualTests(idx) + idx++ + if se.failed { + return + } + defer func() { + se.verifyContinualTests(idx) + }() + + operations = []func(num int){ + se.upgradeWith, + se.postUpgradeTests, + se.downgradeWith, + se.postDowngradeTests, + } + for _, operation := range operations { + operation(idx) + idx++ + if se.failed { + return + } + } +} diff --git a/vendor/knative.dev/pkg/test/upgrade/types.go b/vendor/knative.dev/pkg/test/upgrade/types.go new file mode 100644 index 00000000000..afcccec332a --- /dev/null +++ b/vendor/knative.dev/pkg/test/upgrade/types.go @@ -0,0 +1,123 @@ +/* + * Copyright 2020 The Knative Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package upgrade + +import ( + "testing" + "time" + + "go.uber.org/zap" +) + +// Suite represents a upgrade tests suite that can be executed and will perform +// execution in predictable manner. +type Suite struct { + Tests Tests + Installations Installations +} + +// Tests holds a list of operations for various part of upgrade suite. +type Tests struct { + PreUpgrade []Operation + PostUpgrade []Operation + PostDowngrade []Operation + Continual []BackgroundOperation +} + +// Installations holds a list of operations that will install Knative components +// in different versions. +type Installations struct { + Base []Operation + UpgradeWith []Operation + DowngradeWith []Operation +} + +// Operation represents a upgrade test operation like test or installation that +// can be provided by specific component or reused in aggregating components. +type Operation interface { + // Name is a human readable operation title, and it will be used in t.Run. + Name() string + // Handler is a function that will be called to perform an operation. + Handler() func(c Context) +} + +// BackgroundOperation represents a upgrade test operation that will be +// performed in background while other operations is running. To achieve that +// a passed BackgroundContext should be used to synchronize it's operations with +// Ready and Stop channels. +type BackgroundOperation interface { + // Name is a human readable operation title, and it will be used in t.Run. + Name() string + // Setup method may be used to set up environment before upgrade/downgrade is + // performed. + Setup() func(c Context) + // Handler will be executed in background while upgrade/downgrade is being + // executed. It can be used to constantly validate environment during that + // time and/or wait for StopEvent being sent. After StopEvent is received + // user should validate environment, clean up resources, and report found + // issues to testing.T forwarded in StepEvent. + Handler() func(bc BackgroundContext) +} + +// Context is an object that is passed to every operation. It contains testing.T +// for error reporting and zap.SugaredLogger for unbuffered logging. +type Context struct { + T *testing.T + Log *zap.SugaredLogger +} + +// BackgroundContext is a upgrade test execution context that will be passed +// down to each handler of BackgroundOperation. It contains a StopEvent channel +// which end user should use to obtain a testing.T for error reporting. Until +// StopEvent is sent user may use zap.SugaredLogger to log state of execution if +// necessary. +type BackgroundContext struct { + Log *zap.SugaredLogger + Stop <-chan StopEvent +} + +// StopEvent represents an event that is to be received by background operation +// to indicate that is should stop it's operations and validate results using +// passed T. User should use Finished channel to signalize upgrade suite that +// all stop & verify operations are finished and it is safe to end tests. +type StopEvent struct { + T *testing.T + Finished chan<- struct{} + name string +} + +// WaitForStopEventConfiguration holds a values to be used be WaitForStopEvent +// function. OnStop will be called when StopEvent is sent. OnWait will be +// invoked in a loop while waiting, and each wait act is driven by WaitTime +// amount. +type WaitForStopEventConfiguration struct { + Name string + OnStop func(event StopEvent) + OnWait func(bc BackgroundContext, self WaitForStopEventConfiguration) + WaitTime time.Duration +} + +// Configuration holds required and optional configuration to run upgrade tests. +type Configuration struct { + T *testing.T + Log *zap.Logger +} + +// SuiteExecutor is to execute upgrade test suite. +type SuiteExecutor interface { + Execute(c Configuration) +} diff --git a/test/upgrade/main_test.go b/vendor/knative.dev/pkg/test/upgrade/vars.go similarity index 56% rename from test/upgrade/main_test.go rename to vendor/knative.dev/pkg/test/upgrade/vars.go index 3a1c5d0bb04..8a8ba93e11a 100644 --- a/test/upgrade/main_test.go +++ b/vendor/knative.dev/pkg/test/upgrade/vars.go @@ -1,5 +1,6 @@ /* * Copyright 2020 The Knative Authors + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -15,23 +16,17 @@ package upgrade -import ( - "os" - "testing" - - "knative.dev/eventing/test" - testlib "knative.dev/eventing/test/lib" -) +import "time" -var setup = testlib.Setup -var tearDown = testlib.TearDown -var channelTestRunner testlib.ComponentsTestRunner +var ( + // DefaultWaitTime holds a default value for WaitForStopEventConfiguration + // when used within a NewBackgroundVerification function. + DefaultWaitTime = 20 * time.Millisecond -func TestMain(m *testing.M) { - test.InitializeEventingFlags() - channelTestRunner = testlib.ComponentsTestRunner{ - ComponentFeatureMap: testlib.ChannelFeatureMap, - ComponentsToTest: test.EventingFlags.Channels, + // DefaultOnWait is a implementation that will be called by default for each + // wait performed by WaitForStopEvent when used within + // NewBackgroundVerification function. + DefaultOnWait = func(bc BackgroundContext, self WaitForStopEventConfiguration) { + // do nothing by default } - os.Exit(m.Run()) -} +) diff --git a/vendor/modules.txt b/vendor/modules.txt index 22143d8cdfd..d94961090a9 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -961,9 +961,10 @@ k8s.io/utils/buffer k8s.io/utils/integer k8s.io/utils/pointer k8s.io/utils/trace -# knative.dev/hack v0.0.0-20201120192952-353db687ec5b +# knative.dev/hack v0.0.0-20201125230335-c46a6498e9ed ## explicit knative.dev/hack +knative.dev/hack/shell # knative.dev/pkg v0.0.0-20201125095035-9bf616d2f46a ## explicit knative.dev/pkg/apiextensions/storageversion @@ -1071,6 +1072,7 @@ knative.dev/pkg/test/monitoring knative.dev/pkg/test/prow knative.dev/pkg/test/slackutil knative.dev/pkg/test/spoof +knative.dev/pkg/test/upgrade knative.dev/pkg/test/zipkin knative.dev/pkg/tracing knative.dev/pkg/tracing/config