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 integration upgrade test on older version #5784

Closed
wants to merge 1 commit into from

Conversation

JeromeJu
Copy link
Member

@JeromeJu JeromeJu commented Nov 22, 2022

Changes

This commit adds the integration test on older version to prevent regression of current changes.

To prove that this PR could catch the regression:

Test case for regression:

serviceaccount_test.go:163: Failed to create PipelineRun `pipeline-run-with-service-accounts-xtlybuvy`: admission webhook "webhook.pipeline.tekton.dev" denied the request: mutation failed: cannot decode incoming new object: json: unknown field "metadata"

/kind misc
fixes: #5782 case i

Submitter Checklist

As the author of this PR, please check off the items in this checklist:

  • [n/a] Has Docs included if any changes are user facing
  • Has Tests included if any functionality added or changed
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including
    functionality, content, code)
  • Has a kind label. You can add one by adding a comment on this PR that contains /kind <type>. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tep
  • [n/a] Release notes block below has been updated with any user facing changes (API changes, bug fixes, changes requiring upgrade notices or deprecation warnings)
  • Release notes contains the string "action required" if the change requires additional action from users switching to the new release

Release Notes

NONE

This commit addes the integration test on older version to prevent
regression of current changes.
@tekton-robot tekton-robot added release-note-none Denotes a PR that doesnt merit a release note. kind/misc Categorizes issue or PR as a miscellaneuous one. labels Nov 22, 2022
@tekton-robot tekton-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Nov 22, 2022
@JeromeJu JeromeJu marked this pull request as draft November 22, 2022 22:28
@tekton-robot tekton-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 22, 2022
@lbernick lbernick self-assigned this Nov 23, 2022
@JeromeJu
Copy link
Member Author

JeromeJu commented Nov 23, 2022

Actually it worked (the upgrade test failed and caught it). Just that the logs are not easy to find. But essentially the UI could be better in prow.

Current status:

Findings: didn't catch the expected error. Adding the example tests. Trying to figure out how to replicate the following steps in test:

Install Tekton < #4834
Create PipelineRun using client >= #4834

Thanks to the pointers from @austinzhao-go , the https://github.com/tektoncd/pipeline/blob/main/test/serviceaccount_test.go#L160 should have caught this.

@JeromeJu JeromeJu marked this pull request as ready for review November 23, 2022 21:30
@tekton-robot tekton-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 23, 2022
@lbernick
Copy link
Member

/test check-pr-has-kind-label

@tekton-robot
Copy link
Collaborator

@lbernick: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test pull-tekton-pipeline-alpha-integration-tests
  • /test pull-tekton-pipeline-build-tests
  • /test pull-tekton-pipeline-integration-tests
  • /test tekton-pipeline-unit-tests

The following commands are available to trigger optional jobs:

  • /test pull-tekton-pipeline-go-coverage

Use /test all to run all jobs.

In response to this:

/test check-pr-has-kind-label

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.

@lbernick lbernick closed this Nov 28, 2022
@lbernick lbernick reopened this Nov 28, 2022
@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please ask for approval from lbernick after the PR has been reviewed.

The full list of commands accepted by this bot can be found 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

@JeromeJu JeromeJu marked this pull request as draft November 30, 2022 15:20
@tekton-robot tekton-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 30, 2022
@JeromeJu JeromeJu marked this pull request as ready for review December 2, 2022 13:40
@tekton-robot tekton-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 2, 2022
@JeromeJu
Copy link
Member Author

JeromeJu commented Dec 2, 2022

Updated the test case to prove this workable, and test case updated at https://github.com/JeromeJu/pipeline/tree/upgrade-regression-test. PTAL @lbernick 🙏

@@ -46,12 +46,15 @@ set +o pipefail
header "Install the previous release of Tekton pipeline $PREVIOUS_PIPELINE_VERSION"
install_pipeline_crd_version $PREVIOUS_PIPELINE_VERSION

failed=0
# The integration test for the older version to prevent regression on existing changes.
go_test_e2e -timeout=20m ./test || 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.

It would be nice to update the initial comments (lines 21+) and describe what this script aims to test.

If I read this correctly, what you are doing here is to running the tests from main against the latest release of Tekton.
Unless tests are smart enough to skip themselves if a feature they rely on is not available, this test has a good chance of failing.

What we might consider doing is to run the tests from the latest release against main, which would ensure that no backward incompatible change was done.
Since there are cases where we do backward incompatible changes (in alpha and beta API versions, after the deprecation period), in these few cases we would have to call this out specifically in the tests, for instance we could have a mechanism to tell the tests to skip if the version of the target Tekton installation is greater than a certain value.

This would still require to go backk and update the tests from the released versions though. An alternative could be to maintain in this script a version dependent exclusion list, to be passed to the go test command, with comments explaining the reason for the skip.

Copy link
Member

@vdemeester vdemeester Dec 23, 2022

Choose a reason for hiding this comment

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

Note that we don't necessarily need to run all the test in the old "released" version 👼🏼. We just need to run enough testing to make sure it works (because ideally it runs a released version, that should have had all its own test run and successful when we released), upgrade and run the main test on the upgraded instance to make sure it behave as intended. So we could have a "light", relatively safe, test suite for that part.

@JeromeJu JeromeJu closed this Feb 8, 2023
@JeromeJu JeromeJu reopened this May 17, 2023
@tekton-robot
Copy link
Collaborator

@JeromeJu: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-tekton-pipeline-integration-tests 74cbae5 link true /test pull-tekton-pipeline-integration-tests
pull-tekton-pipeline-beta-integration-tests 74cbae5 link true /test pull-tekton-pipeline-beta-integration-tests
pull-tekton-pipeline-alpha-integration-tests 74cbae5 link true /test pull-tekton-pipeline-alpha-integration-tests

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@JeromeJu JeromeJu marked this pull request as draft May 17, 2023 19:47
@tekton-robot tekton-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 17, 2023
@JeromeJu JeromeJu closed this May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/misc Categorizes issue or PR as a miscellaneuous one. release-note-none Denotes a PR that doesnt merit a release note. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add client/server compatibility tests
5 participants