Skip to content
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

Add e2e test for rollback scenario #5702

Merged
merged 2 commits into from
Oct 3, 2019

Conversation

taragu
Copy link
Contributor

@taragu taragu commented Sep 27, 2019

/lint

Part of #5285

Proposed Changes

  • Add e2e test for rollback scenario

Release Note

NONE

@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label Sep 27, 2019
@knative-prow-robot knative-prow-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. area/test-and-release It flags unit/e2e/conformance/perf test issues for product features labels Sep 27, 2019
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.

@taragu: 0 warnings.

In response to this:

/lint

Part of #5285

Proposed Changes

  • Add e2e test for rollback scenario

Release Note

NONE

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.

test/crd.go Outdated
@@ -35,6 +35,7 @@ type ResourceNames struct {
TrafficTarget string
URL *url.URL
Image string
BYOName string
Copy link
Member

Choose a reason for hiding this comment

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

Rather than passing this everywhere, we can just pass a new option to write the name? We probably even have a function to set this.


withTrafficSpecOld := WithInlineRouteSpec(v1alpha1.RouteSpec{
Traffic: []v1alpha1.TrafficTarget{
{
Copy link
Member

Choose a reason for hiding this comment

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

nit: use {{ for less indentation.

// Now, rollback to the first RevisionSpec
rollbackSvc := resources.Service.DeepCopy()
rollbackSvc.Spec = v1alpha1.ServiceSpec{
DeprecatedRelease: &v1alpha1.ReleaseType{
Copy link
Member

Choose a reason for hiding this comment

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

When we rollback the Service's spec should be identical to when it was first created.

Copy link
Member

Choose a reason for hiding this comment

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

The whole point of the test is that we should be able to rollback the whole spec (e.g. GitOps) and things should still work. So the progression should be:

First:

spec: 
  template:
    metadata:
      name: foo
    spec:
       containers:
       - image: foo
  traffic:
  - revisionName: foo
    percent: 100

Second:

spec: 
  template:
    metadata:
      name: bar
    spec:
       containers:
       - image: bar
  traffic:
  - revisionName: bar
    percent: 100

Third:

spec: 
  template:
    metadata:
      name: foo
    spec:
       containers:
       - image: foo
  traffic:
  - revisionName: foo
    percent: 100

However, what you have (ignoring release mode) is more like:

spec: 
  template:
    metadata:
      name: bar
    spec:
       containers:
       - image: bar
  traffic:
  - revisionName: foo
    percent: 100

The whole point is that we should be able to achieve the third state by simply re-applying the initial state.

@taragu taragu force-pushed the e2e-rollback-byo-name branch 6 times, most recently from 05e5536 to 6ac7fe0 Compare October 2, 2019 16:46
@taragu
Copy link
Contributor Author

taragu commented Oct 2, 2019

This PR is ready for another review

test/e2e/rollback_byo_test.go Outdated Show resolved Hide resolved
@taragu
Copy link
Contributor Author

taragu commented Oct 3, 2019

@dgerd thanks for the review! This PR is ready for another look.

@dgerd
Copy link

dgerd commented Oct 3, 2019

/lgtm
/approve

Thanks Tara!

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 3, 2019
@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dgerd, taragu

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

The pull request process is described here

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

@knative-prow-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 3, 2019
@taragu
Copy link
Contributor Author

taragu commented Oct 3, 2019

/test pull-knative-serving-unit-tests

@taragu
Copy link
Contributor Author

taragu commented Oct 3, 2019

/test pull-knative-serving-unit-tests

2 similar comments
@taragu
Copy link
Contributor Author

taragu commented Oct 3, 2019

/test pull-knative-serving-unit-tests

@taragu
Copy link
Contributor Author

taragu commented Oct 3, 2019

/test pull-knative-serving-unit-tests

@knative-test-reporter-robot

The following jobs failed:

Test name Triggers Retries
pull-knative-serving-integration-tests pull-knative-serving-integration-tests 1/3
pull-knative-serving-unit-tests pull-knative-serving-unit-tests 1/3

Automatically retrying due to test flakiness...
/test pull-knative-serving-integration-tests

@knative-prow-robot knative-prow-robot merged commit dec3c5e into knative:master Oct 3, 2019
@taragu taragu deleted the e2e-rollback-byo-name branch November 12, 2019 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/test-and-release It flags unit/e2e/conformance/perf test issues for product features cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants