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 upgrade tests to test main against previous release #6690

Closed
wants to merge 1 commit into from

Conversation

JeromeJu
Copy link
Member

@JeromeJu JeromeJu commented May 19, 2023

Changes

This commit adds the upgrade tests for testing main against the e2e tests from the previous release to prevent regression. Incompatible changes made in the current release cycle are expected to be catched.

This should also catch the case where existing resources become invalid with tests from previous releases.

/kind misc
fixes #6728

Submitter Checklist

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

  • Has Docs if any changes are user facing, including updates to minimum requirements e.g. Kubernetes version bumps
  • 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). See some examples of good release notes.
  • [n/a] Release notes contains the string "action required" if the change requires additional action from users switching to the new release

Release Notes

NONE

@tekton-robot tekton-robot added kind/misc Categorizes issue or PR as a miscellaneuous one. release-note-none Denotes a PR that doesnt merit a release note. labels May 19, 2023
@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 assign imjasonh after the PR has been reviewed.
You can assign the PR to them by writing /assign @imjasonh in a comment when ready.

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

@tekton-robot tekton-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label May 19, 2023
@@ -24,6 +24,10 @@
# Scenario 2: install the previous release, create the pipelines and tasks, upgrade
# to the current release, and validate whether the Tekton pipeline works.

# Scenario 3: install the current pipelines, use the integration tests from the previous release(s)
# to prevent regression. Incompatible changes made in the current release cycle are expected to fail
# and will be skipped after failing once.
Copy link
Member

Choose a reason for hiding this comment

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

How does the skipping work? Is there a way to mark as test as skipped for the upgrade test suite?

Copy link
Member Author

Choose a reason for hiding this comment

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

  • We could introduce a new build tag for upgrade tests, but this would require updates to the e2e test tag when a feature is introduced or there are any breaking changes made to it and spotted by the upgrade test.
  • We could have a 'skip list'(probably in the e2e-test-upgrade.sh) and use regex and mv command to move around skipped tests in the ./test folder.

I thought this could be in a followup PR? if not so happy to add in this PR if any of the above sounds ok to add

Copy link
Member

Choose a reason for hiding this comment

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

I think we should do it in this PR, so we have a way to make backwards incompatible changes if needed, or at least some plan for how we would do so without skipping upgrade tests entirely. I think it's confusing for this comment to describe this functionality if it's not part of this PR.

I'm not sure what it means exactly to skip upgrade tests after they fail once? Does this mean the first time CI is run for one PR, within a CI run after failing once, or between all CI runs for all PRs? I'm not sure if we'd want to just skip failing tests without some user intervention to signal that an incompatible change is intentional.

I'm also not sure what the best way of doing this is. Can you elaborate a bit more on how your ideas would work? Is the intention that you'd have to modify the skip list when making an incompatible change?

I think either tekton chains or chainguard (not sure which) has tests like this already so it might be worth talking to @wlynch about how they work.

Copy link
Member Author

@JeromeJu JeromeJu May 23, 2023

Choose a reason for hiding this comment

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

I'm not sure what it means exactly to skip upgrade tests after they fail once? Does this mean the first time CI is run for one PR, within a CI run after failing once, or between all CI runs for all PRs?

The intentions for skipping here is to prevent the upgrade test from failing consistently when there are known incompatible changes made on devel (of which there should be only few cases that we run into ideally).

I'm not sure what it means exactly to skip upgrade tests after they fail once? Does this mean the first time CI is run for one PR, within a CI run after failing once, or between all CI runs for all PRs?

The upgrade tests now we have is a CRON job. The case I am picturing that if it is observed to fail for the first time during this dev cycle, then we would want to investigate if the failed test is a regression and then decide to either escalate or to skip it(if it is an intentional breaking change).

I was suggesting the 2 alternatives based on the above assumptions if the case is reasonable 🤔 .

I had the chance to learn from @wlynch a bit ago when working on #5784, IIRC some mapping of certain versions and enabled features has been one of the suggestions to take. I am not sure if a list of e2e tests with 'breaking changes' would be a good idea at this stage for our features since there shouldn't be many?

Copy link
Member

Choose a reason for hiding this comment

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

Oh, I forgot upgrade tests are a cron job. I wonder if it would make sense to run them as part of CI instead? We might be constrained by our test cluster bandwidth though just based on our experience with integration tests.

Of the two approaches you mentioned, I think the "skip list" is better because it's opt-out rather than opt-in.

Copy link
Member Author

@JeromeJu JeromeJu May 23, 2023

Choose a reason for hiding this comment

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

Thanks @lbernick , I do agree that it would be nice and responsive to detect breaking changes in CI. Added #6709 as a followup to track moving upgrade tests to CI.

I have also tried out the "skip list" approach in the current commit. Moving forward when we are running against multiple previous releases, we could change the 'skip list' to a mapping of specific releases and incompatible features/tests.

Copy link
Member

Choose a reason for hiding this comment

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

Oh, I forgot upgrade tests are a cron job. I wonder if it would make sense to run them as part of CI instead? We might be constrained by our test cluster bandwidth though just based on our experience with integration tests.

One idea would be to run these tests as part of the release pipeline

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks Dibyo, tracked the upcoming goals at #6709

Copy link
Member

Choose a reason for hiding this comment

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

Thinking about this more-- it would be nice to at least run upgrade tests as part of CI if this file is changed-- otherwise it's hard to say with confidence that this PR works as intended

@tekton-robot tekton-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels May 23, 2023
@JeromeJu JeromeJu requested a review from dibyom May 23, 2023 21:08
test/e2e-tests-upgrade.sh Outdated Show resolved Hide resolved
test/e2e-tests-upgrade.sh Outdated Show resolved Hide resolved
test/e2e-tests-upgrade.sh Outdated Show resolved Hide resolved
header "Testing main against the latest release to detect regression"
get_tests_from_release $PREVIOUS_PIPELINE_VERSION

skip_breaking_tests
Copy link
Member

Choose a reason for hiding this comment

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

@JeromeJu curious if you've been able to test this locally, especially the test skipping part. Do you have an example output?

Copy link
Member Author

@JeromeJu JeromeJu May 25, 2023

Choose a reason for hiding this comment

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

I have tried it locally with 1-2 tests name in the list, it just removed those tests from our tests suites(skipping seems to work fine).
May I ask what would an ideal example output to be, it feels that has to be a long output as the logs we have in prow?

Copy link
Member

Choose a reason for hiding this comment

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

maybe just comment in this thread with a link to a github gist?

Copy link
Member Author

Choose a reason for hiding this comment

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

test/e2e-tests-upgrade.sh Outdated Show resolved Hide resolved
@@ -24,6 +24,10 @@
# Scenario 2: install the previous release, create the pipelines and tasks, upgrade
# to the current release, and validate whether the Tekton pipeline works.

# Scenario 3: install the current pipelines, use the integration tests from the previous release(s)
# to prevent regression. Incompatible changes made in the current release cycle are expected to fail
# and will be skipped after failing once.
Copy link
Member

Choose a reason for hiding this comment

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

Thinking about this more-- it would be nice to at least run upgrade tests as part of CI if this file is changed-- otherwise it's hard to say with confidence that this PR works as intended

test/e2e-tests-upgrade.sh Outdated Show resolved Hide resolved
# Upgrade to the current release.
header "Upgrade to the current release of Tekton pipeline"
install_pipeline_crd
# Run the integration tests.c
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# Run the integration tests.c
# Run the integration tests.

function skip_breaking_examples {
for TEST in "${BACKWARD_INCOMPATIBLE_EXAMPLES[@]}"; do
echo "Remove $TEST since it is a breaking change at devel"
rm ./examples/v1/"$TEST".yaml
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if instead of removing the examples tests from the local copy of the repo, would it instead make sense to update the examples tests to accept a flag for which tests should be skipped?

test/e2e-tests-upgrade.sh Outdated Show resolved Hide resolved
test/e2e-tests-upgrade.sh Outdated Show resolved Hide resolved
This commit adds the upgrade tests for testing main against the e2e
tests from the previous release to prevent regression. Incompatible
changes made in the current release cycle are expected to be catched.
@JeromeJu
Copy link
Member Author

Has been prioritizing on other issues and just got back onto this. So far I haven't figured out a way to only trigger such upgrade test when an actual regression happen? Seems the only way rn is to wait for the nightly CRON job.

@lbernick
Copy link
Member

Has been prioritizing on other issues and just got back onto this. So far I haven't figured out a way to only trigger such upgrade test when an actual regression happen? Seems the only way rn is to wait for the nightly CRON job.

Can you clarify what you're trying to do? I think running these checks in CI is tracked in #6709, or you can run it locally to test. Arguably, we should be running these tests as part of CI before making changes to them, otherwise it's hard to know if the changes work as intended, but we could justify saving this for future work.

@JeromeJu
Copy link
Member Author

Can you clarify what you're trying to do? I think running these checks in CI is tracked in #6709, or you can run it locally to test.

I was in the middle of trying to open a new PR and left the current branch as an example for upgrade test changes only, but now let's just keep it in this one.

Arguably, we should be running these tests as part of CI before making changes to them, otherwise it's hard to know if the changes work as intended, but we could justify saving this for future work.

I am trying to seek for a way to figure a way out to put this as part of the CI and circumvent the flakes which is apparent in our CI. Is it suggesting that making the upgrade test part of the CI ideally prior to the current PR?

@tekton-robot tekton-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 10, 2023
@tekton-robot
Copy link
Collaborator

@JeromeJu: PR needs rebase.

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.

@tekton-robot
Copy link
Collaborator

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale with a justification.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.

/lifecycle stale

Send feedback to tektoncd/plumbing.

@tekton-robot tekton-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 8, 2023
@JeromeJu JeromeJu closed this Oct 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/misc Categorizes issue or PR as a miscellaneuous one. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. release-note-none Denotes a PR that doesnt merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add upgrade tests against e2e tests from previous releases
5 participants