Skip to content
This repository was archived by the owner on Feb 22, 2022. It is now read-only.

Add upgrade tests into the e2e-tests-latest-eventing#93

Merged
knative-prow-robot merged 3 commits intoknative:masterfrom
houshengbo:upgrade-test
Feb 13, 2020
Merged

Add upgrade tests into the e2e-tests-latest-eventing#93
knative-prow-robot merged 3 commits intoknative:masterfrom
houshengbo:upgrade-test

Conversation

@houshengbo
Copy link

@houshengbo houshengbo commented Feb 5, 2020

Issue to be fixed

Fixes #94

Proposed Changes

  • This PR adds the tests to verify the correct number and names of knative eventing
    deployments.

  • The test tag postupgrade is added, marking the tests to run after upgrade to the
    latest HEAD of operator, with the latest generated manifest of knative eventing.

Release Note

Copy link
Contributor

@knative-prow-robot knative-prow-robot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@houshengbo: 0 warnings.

Details

In response to this:

This PR adds the tests to verify the correct number and names of knative eventing
deployments.

The test tag postupgrade is added, marking the tests to run after upgrade to the
latest HEAD of operator, with the latest generated manifest of knative eventing.

Issue to be fixed

Fixes #

Proposed Changes

Release Note

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: houshengbo

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@houshengbo
Copy link
Author

/test pull-knative-eventing-operator-integration-tests-on-latest-eventing

@houshengbo
Copy link
Author

/test pull-knative-eventing-operator-integration-tests-on-latest-eventing

@aliok
Copy link
Member

aliok commented Feb 6, 2020

cc @cardil you might want to have a look perhaps?

@cardil
Copy link
Contributor

cardil commented Feb 6, 2020

Doesn't this upgrade test should mirror the knative/eventing#2388 ? Now, it only runs some simple test after upgrade.

In knative/eventing#2388 I'm doing upgrade & downgrade, while validating that running knative services (probe), will still run, and we will not lose any events during upgrade & downgrade.

@houshengbo
Copy link
Author

@cardil That's the goal as well, so far we add some tests to verify the deployments of the knatvie eventing in a macro scope from the operator's perspective. We will ultamately own the tests in eventing with the tag preupgrade, and postupgrade.
Also, we also move on with serving-operator to add the upgrade flow as well, so all the upgrade tests will live in operators in future.

# Run the integration tests
go_test_e2e -timeout=20m ./test/e2e || failed=1
# Run the postupgrade tests
go_test_e2e -tags=postupgrade -timeout=${TIMEOUT} ./test/upgrade || failed=1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 on this. Also good that we're changing the name of this file with #96

@aliok
Copy link
Member

aliok commented Feb 7, 2020

@houshengbo while working on this, I found some errors in the .sh file and fixed them.
Here's the PR that is sent against your PR branch: houshengbo#1

Actually, those improvements are applicable to other scripts in this and other Knative repos, but let me send PRs for them separately. Please leave that to me.

Comment on lines +69 to +71
// Knative Eventing has 4 deployments.
expectedNumDeployments := 4
deploys := []string{"eventing-controller", "eventing-webhook", "imc-controller", "imc-dispatcher"}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After knative/eventing#2519 this is changed

// Knative Eventing has 5 deployments.
expectedNumDeployments := 5
deploys := []string{"eventing-controller", "broker-controller", "eventing-webhook", "imc-controller", "imc-dispatcher"}

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

Copy link
Member

@aliok aliok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs some adaption. Added a few comments.

@aliok
Copy link
Member

aliok commented Feb 7, 2020

@houshengbo

Added some comments.

IMO, let's merge #95 first. Then adapt this PR (see my reasons below)

My reasons:

I have some doubts about the purpose of this exercise.

  • e2e-tests.sh is using the release manifest in kodata. So:
    • it starts the operator
    • installs Knative eventing using the 0.12 manifest
    • doing some tests (like deployment recreated when deleted etc.)
  • e2e-tests-latest-eventing.sh which uses the manifest from master of Knative eventing.
    • it starts the operator
    • installs Knative eventing using the manifest from master
    • doing some tests like (checking number of deployments and expected deployments etc.)

As we're going test the upgrade of the operator, we need the resources created by a previous version of the operator. Simply pointing the operator to old manifest won't work because in #95 we're deleting obsolote resources by name.

So, IMO, the process should be:

  • Deploy the latest released version of operator
  • Create CR, so that old Knative eventing version is created (with obsolote resources)
  • Delete the operator and deploy the operator from local code
  • Check expected resources and new resources (obsolote things should be gone, new things should be there)

IMO, let's merge #95 first. Then adapt this PR.

About @cardil 's comments: let's do them later in sync with @cardil

@houshengbo
Copy link
Author

I have renamed the script from e2e-tests-latest-eventing.sh to e2e-upgrade-tests.sh, which is dedicated to run the upgrade tests for operator, including the operator itself and the knative.

Prow job has been created to run the upgrade tests as well in test-infra.

@houshengbo houshengbo force-pushed the upgrade-test branch 5 times, most recently from 4d8bc1e to 2073e44 Compare February 11, 2020 16:55
@@ -1,5 +1,5 @@
/*
Copyright 2019 The Knative Authors
Copyright 2020 The Knative Authors
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in the future, this doesnt need to changed
the copyright year is based on when the file is first added.

header "Installing Knative Eventing operator latest public release"
local full_url="https://github.com/knative/eventing-operator/releases/download/${LATEST_EVENTING_RELEASE_VERSION}/eventing-operator.yaml"

local RELEASE_YAML="$(mktemp)"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lower case
release_yaml

"errors"
"path/filepath"
"runtime"
"knative.dev/eventing-operator/test/client"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

group with other knative.dev/eventing-operator imports

This PR adds the tests to verify the correct number and names of knative eventing
deployments.

The test tag postupgrade is added, marking the tests to run after upgrade to the
latest HEAD of operator, with the latest generated manifest of knative eventing.
@k4leung4
Copy link
Contributor

/lgtm

@aliok
Copy link
Member

aliok commented Feb 14, 2020

I finally had time to review this PR after the changes.

Great work @houshengbo , thank you!

houshengbo pushed a commit to houshengbo/eventing-operator that referenced this pull request Feb 17, 2020
* Add upgrade tests into the e2e-tests-latest-eventing

This PR adds the tests to verify the correct number and names of knative eventing
deployments.

The test tag postupgrade is added, marking the tests to run after upgrade to the
latest HEAD of operator, with the latest generated manifest of knative eventing.

* Add the installation of the previous release and upgrade to the latest

* Fixes this PR based on the latest comments
knative-prow-robot pushed a commit that referenced this pull request Feb 18, 2020
* Build config consistently as per in serving (#105)

* Add upgrade tests into the e2e-tests-latest-eventing (#93)

* Add upgrade tests into the e2e-tests-latest-eventing

This PR adds the tests to verify the correct number and names of knative eventing
deployments.

The test tag postupgrade is added, marking the tests to run after upgrade to the
latest HEAD of operator, with the latest generated manifest of knative eventing.

* Add the installation of the previous release and upgrade to the latest

* Fixes this PR based on the latest comments

* Add additionalPrinterColumns (#98)

* Update the library from jcrossley3/manifestival to manifestival

Co-authored-by: Ali Ok <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add the upgrade tests

6 participants