Skip to content

Migrate upgrade tests to the new framework#10216

Merged
knative-prow-robot merged 18 commits into
knative:masterfrom
mgencur:migrate_upgrade_tests
Jan 5, 2021
Merged

Migrate upgrade tests to the new framework#10216
knative-prow-robot merged 18 commits into
knative:masterfrom
mgencur:migrate_upgrade_tests

Conversation

@mgencur
Copy link
Copy Markdown
Contributor

@mgencur mgencur commented Nov 27, 2020

Fixes #9137

Proposed Changes

  • Use the upgrade framework from knative.dev/pkg/test/upgrade
  • Convert AssertAutoscaleUpToNumPods and inner functions to helper functions that return error instead of calling t.Fatal to fail the current test. Avoid using *testing.T so that these functions can be reused outside of tests or span multiple tests.
  • The autoscaler helper functions are used in upgrade tests where "setup" and "verify" phases run within different tests. Pull test.EnsureTearDown from SetupSvc to ensure that a kservice is not destroyed at the end of the first phase ("setup") but remains active until "verify" phase. This is ensured by calling EnsureTearDown later in the "verify" phase.
  • Adjust Bash scripts to avoid unbound variable errors during upgrade tests exexution (due to using -u flag by the upgrade framework).

Release Note


@knative-prow-robot knative-prow-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 27, 2020
@google-cla google-cla Bot added the cla: yes Indicates the PR's author has signed the CLA. label Nov 27, 2020
@knative-prow-robot knative-prow-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. area/test-and-release It flags unit/e2e/conformance/perf test issues for product features labels Nov 27, 2020
@codecov
Copy link
Copy Markdown

codecov Bot commented Nov 27, 2020

Codecov Report

Merging #10216 (5dbd73b) into master (90291ee) will increase coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10216      +/-   ##
==========================================
+ Coverage   87.99%   88.01%   +0.01%     
==========================================
  Files         187      187              
  Lines        8808     8808              
==========================================
+ Hits         7751     7752       +1     
- Misses        815      816       +1     
+ Partials      242      240       -2     
Impacted Files Coverage Δ
pkg/autoscaler/scaling/multiscaler.go 87.71% <0.00%> (-1.76%) ⬇️
pkg/reconciler/configuration/configuration.go 86.71% <0.00%> (-1.57%) ⬇️
pkg/activator/net/revision_backends.go 90.41% <0.00%> (-0.92%) ⬇️
pkg/reconciler/autoscaling/kpa/scaler.go 90.00% <0.00%> (+1.42%) ⬆️
pkg/autoscaler/statforwarder/forwarder.go 96.29% <0.00%> (+5.55%) ⬆️
pkg/autoscaler/statforwarder/processor.go 88.88% <0.00%> (+5.55%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 90291ee...429b845. Read the comment docs.

@mgencur mgencur force-pushed the migrate_upgrade_tests branch 8 times, most recently from a1ff592 to d33a694 Compare November 30, 2020 15:48
@knative-prow-robot knative-prow-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 1, 2020
@mgencur mgencur force-pushed the migrate_upgrade_tests branch from f81894e to 4e5454a Compare December 1, 2020 07:10
@knative-prow-robot knative-prow-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 1, 2020
@mgencur mgencur force-pushed the migrate_upgrade_tests branch 2 times, most recently from cdbb0a4 to 28d884c Compare December 1, 2020 07:51
@mgencur mgencur changed the title [WIP] Migrate upgrade tests to the new framework Migrate upgrade tests to the new framework Dec 1, 2020
@knative-prow-robot knative-prow-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 1, 2020
Copy link
Copy Markdown

@cardil cardil left a comment

Choose a reason for hiding this comment

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

Looks quite well. I found some minor issues.

Comment thread test/e2e/autoscale.go Outdated
Comment thread test/e2e/autoscale.go
Comment thread test/upgrade/autoscaler.go
Comment thread test/upgrade/autoscaler.go Outdated
Comment thread test/upgrade/autoscaler.go
Comment thread test/upgrade/autoscaler.go Outdated
Comment thread test/upgrade/autoscaler.go Outdated
Comment thread test/upgrade/probe.go
Comment thread test/upgrade/upgrade_test.go Outdated
Comment thread test/upgrade/upgrade_test.go
@mgencur
Copy link
Copy Markdown
Contributor Author

mgencur commented Dec 1, 2020

/retest

1 similar comment
@mgencur
Copy link
Copy Markdown
Contributor Author

mgencur commented Dec 1, 2020

/retest

@mgencur mgencur force-pushed the migrate_upgrade_tests branch 2 times, most recently from 162bead to cb68163 Compare December 2, 2020 09:36
@mgencur
Copy link
Copy Markdown
Contributor Author

mgencur commented Dec 2, 2020

/retest

1 similar comment
@mgencur
Copy link
Copy Markdown
Contributor Author

mgencur commented Dec 2, 2020

/retest

@mgencur
Copy link
Copy Markdown
Contributor Author

mgencur commented Dec 2, 2020

The error in pull-knative-serving-istio-stable-no-mesh-tls doesn't seem to be related to this PR:

2020/12/02 11:33:53 Failed to setup DNS record: timed out waiting for the condition

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 4, 2021
mgencur added 18 commits January 5, 2021 08:12
* Convert AssertAutoscaleUpToNumPods and inner functions to helper
functions that
return error instead of calling t.Fatal to fail the current test.
Avoid using *testing.T
so that these functions can be reused outside of tests or span
multiple tests.
* The autoscaler helper functions are used in upgrade tests where
"setup" and
"verify" phases run within different tests. Pull test.EnsureTearDown
from SetupSvc to ensure
that a kservice is not destroyed at the end of the first phase
("setup") but
remains active until "verify" phase. This is ensured by calling
EnsureTearDown later in the
  "verify" phase.
* Adjust Bash scripts to avoid unbound variable errors during upgrade
tests exexution (due
  to using -u flag by the upgrade framework).
That's for easy reuse in other repos such as knative/operator
* autoscale and prober tests will fail if ingress is replaced during
upgrade
@mgencur mgencur force-pushed the migrate_upgrade_tests branch from f6b2ac7 to 429b845 Compare January 5, 2021 07:12
@knative-prow-robot knative-prow-robot removed the lgtm Indicates that a PR is ready to be merged. label Jan 5, 2021
@nak3
Copy link
Copy Markdown
Contributor

nak3 commented Jan 5, 2021

/lgtm
/approve

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 5, 2021
@knative-prow-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cardil, mgencur, nak3

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

@knative-prow-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 5, 2021
@mgencur
Copy link
Copy Markdown
Contributor Author

mgencur commented Jan 5, 2021

/hold cancel

I believe the hold label from Markus is redundant at this point. The upgrade tests were fixed some time ago.

@knative-prow-robot knative-prow-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 5, 2021
@mgencur
Copy link
Copy Markdown
Contributor Author

mgencur commented Jan 5, 2021

/retest

@knative-prow-robot knative-prow-robot merged commit d2f2944 into knative:master Jan 5, 2021
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/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement tests with plugable upgrade mechanism

6 participants