-
Notifications
You must be signed in to change notification settings - Fork 75
Eventing upgrade tests #530
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
openshift-merge-robot
merged 21 commits into
openshift-knative:master
from
cardil:feature/SRVKE-475-eventing-upgrade-tests
Nov 2, 2020
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
0047b93
Splitting upgrade test to accommodate Eventing
cardil 5047f4c
Add an image template
cardil c772711
Upgrade tests with Eventing by default
cardil 06e588b
Proper error reporting from shell scripts
cardil 6e7ffdd
Merge remote-tracking branch 'upstream/master' into feature/SRVKE-475…
cardil de917a3
Merge remote-tracking branch 'upstream/master' into feature/SRVKE-475…
cardil 50a8e74
Remove serving & eventing ns at teardown
cardil 2771a27
Merge remote-tracking branch 'upstream/master' into feature/SRVKE-475…
cardil 53371c9
Merge remote-tracking branch 'upstream/master' into feature/SRVKE-475…
cardil 34cb78c
Adding missing return statements + prober end idempotency
cardil af0f010
Declare a waited PIDs array
cardil 08c0999
Merge remote-tracking branch 'upstream/master' into feature/SRVKE-475…
cardil 4ac1675
Merge remote-tracking branch 'upstream/master' into feature/SRVKE-475…
cardil bc35947
Rely on PID directory instead of Bash arrays
cardil cb4b083
Merge remote-tracking branch 'upstream/master' into feature/SRVKE-475…
cardil d402d57
Eventing test bits deploy properly
cardil 14759d1
Proper waiting on prober's end
cardil 30b91b9
Creating a namespaces for previous release
cardil c02d7f8
Merge remote-tracking branch 'upstream/master' into feature/SRVKE-475…
cardil 6cfb729
Add env vars to configure upgrade tests
cardil 7c2b75e
Lowering interval from 2ms to 50ms
cardil File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,125 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| readonly EVENTING_READY_FILE="/tmp/eventing-prober-ready" | ||
| readonly EVENTING_PROBER_FILE="/tmp/eventing-prober-signal" | ||
|
|
||
| function upstream_knative_eventing_e2e { | ||
| ( | ||
| logger.info 'Running eventing tests' | ||
|
|
||
| local failed=0 | ||
|
|
||
| TEST_IMAGE_TEMPLATE="registry.svc.ci.openshift.org/openshift/knative-${KNATIVE_EVENTING_VERSION}:knative-eventing-test-{{.Name}}" | ||
| export TEST_IMAGE_TEMPLATE="registry.svc.ci.openshift.org/openshift/knative-${KNATIVE_EVENTING_VERSION}:knative-eventing-test-{{.Name}}" | ||
|
|
||
| cd "$KNATIVE_EVENTING_HOME" || return $? | ||
| cd "${KNATIVE_EVENTING_HOME}" || return $? | ||
|
|
||
| # shellcheck disable=SC1090 | ||
| source "${KNATIVE_EVENTING_HOME}/openshift/e2e-common.sh" | ||
|
|
||
| # run_e2e_tests defined in knative-eventing | ||
| run_e2e_tests || failed=$? | ||
|
|
||
| return $failed | ||
| ) | ||
| } | ||
|
|
||
| function actual_eventing_version { | ||
| oc get knativeeventing.operator.knative.dev \ | ||
| knative-eventing -n "${EVENTING_NAMESPACE}" -o=jsonpath="{.status.version}" \ | ||
| || return $? | ||
| } | ||
|
|
||
| function prepare_knative_eventing_tests { | ||
| logger.info 'Nothing to prepare for Eventing upgrade tests' | ||
| } | ||
|
|
||
| function run_eventing_preupgrade_test { | ||
| logger.info 'Running Eventing pre upgrade tests' | ||
|
|
||
| cd "${KNATIVE_EVENTING_HOME}" || return $? | ||
|
|
||
| local image_template | ||
| # FIXME: SRVKE-606 use registry.svc.ci.openshift.org image | ||
| image_template="quay.io/openshift-knative/{{.Name}}:${KNATIVE_EVENTING_VERSION}" | ||
|
|
||
| go_test_e2e -tags=preupgrade \ | ||
| -timeout=10m ./test/upgrade \ | ||
| --imagetemplate="${image_template}" \ | ||
| || return $? | ||
|
|
||
| logger.success 'Eventing pre upgrade tests passed' | ||
| } | ||
|
|
||
| function start_eventing_prober { | ||
| local eventing_prober_pid pid_file image_template eventing_prober_interval | ||
| pid_file="${1:?Pass a PID file as arg[1]}" | ||
| logger.info 'Starting Eventing prober' | ||
|
|
||
| EVENTING_PROBER_INTERVAL_MSEC="${EVENTING_PROBER_INTERVAL_MSEC:-50}" | ||
| eventing_prober_interval="${EVENTING_PROBER_INTERVAL_MSEC}ms" | ||
|
|
||
|
|
||
| rm -fv "${EVENTING_PROBER_FILE}" "${EVENTING_READY_FILE}" | ||
| cd "${KNATIVE_EVENTING_HOME}" || return $? | ||
|
|
||
| # FIXME: SRVKE-606 use registry.svc.ci.openshift.org image | ||
| image_template="quay.io/openshift-knative/{{.Name}}:${KNATIVE_EVENTING_VERSION}" | ||
|
|
||
| # FIXME: knative/operator#297 Restore scale to zero setting | ||
| E2E_UPGRADE_TESTS_SERVING_SCALETOZERO=false \ | ||
| E2E_UPGRADE_TESTS_SERVING_USE=true \ | ||
| E2E_UPGRADE_TESTS_CONFIGMOUNTPOINT=/.config/wathola \ | ||
| E2E_UPGRADE_TESTS_INTERVAL="${eventing_prober_interval}" \ | ||
| go_test_e2e -tags=probe \ | ||
| -timeout=30m \ | ||
| ./test/upgrade \ | ||
| --pipefile="${EVENTING_PROBER_FILE}" \ | ||
| --readyfile="${EVENTING_READY_FILE}" \ | ||
| --imagetemplate="${image_template}" & | ||
| eventing_prober_pid=$! | ||
|
|
||
| logger.debug "Eventing prober PID is ${eventing_prober_pid}" | ||
|
|
||
| echo ${eventing_prober_pid} > "${pid_file}" | ||
| } | ||
|
|
||
| function wait_for_eventing_prober_ready { | ||
| wait_for_file "${EVENTING_READY_FILE}" || return $? | ||
|
|
||
| logger.success 'Eventing prober is ready' | ||
| } | ||
|
|
||
| function end_eventing_prober { | ||
| local prober_pid | ||
| prober_pid="${1:?Pass a prober pid as arg[1]}" | ||
|
|
||
| end_prober 'Eventing' "${prober_pid}" "${EVENTING_PROBER_FILE}" || return $? | ||
| } | ||
|
|
||
| function check_eventing_upgraded { | ||
| local latest_version | ||
| latest_version="${1:?Pass a target eventing version as arg[1]}" | ||
|
|
||
| logger.debug 'Check KnativeEventing has the latest version with Ready status' | ||
| timeout 300 "[[ ! ( \$(oc get knativeeventing.operator.knative.dev \ | ||
| knative-eventing -n ${EVENTING_NAMESPACE} -o=jsonpath='{.status.version}') \ | ||
| == ${latest_version} && \$(oc get knativeeventing.operator.knative.dev \ | ||
| knative-eventing -n ${EVENTING_NAMESPACE} \ | ||
| -o=jsonpath='{.status.conditions[?(@.type==\"Ready\")].status}') == True ) ]]" \ | ||
| || return $? | ||
| } | ||
|
|
||
| function run_eventing_postupgrade_test { | ||
| logger.info 'Running Eventing post upgrade tests' | ||
| local image_template | ||
|
|
||
| cd "${KNATIVE_EVENTING_HOME}" || return $? | ||
|
|
||
| # FIXME: SRVKE-606 use registry.svc.ci.openshift.org image | ||
| image_template="quay.io/openshift-knative/{{.Name}}:${KNATIVE_EVENTING_VERSION}" | ||
|
|
||
| go_test_e2e -tags=postupgrade \ | ||
| -timeout=10m ./test/upgrade \ | ||
| --imagetemplate="${image_template}" \ | ||
| || return $? | ||
|
|
||
| logger.success 'Eventing post upgrade tests passed' | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.