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

Refactor test cases for remote TaskRef #6778

Merged

Conversation

JeromeJu
Copy link
Member

@JeromeJu JeromeJu commented Jun 5, 2023

Changes

This commit refactors the test cases for taskRef_Test by:

  • separate the TestGetTaskFunc for local, resolution and bundle tests
    since part of the syntax has deprecated in v1beta1 and diverged when
    we are going to move to v1.
  • create a separated test class TestGetTaskFunc_Bundle since there would
    be no taskref.name field in bundle resolvers
  • remove the test cases regarding remote tasks ie. remote task without
    defaults in TestGetTaskFunc to TestGetTaskFunc_Remoteresolution and
    renames it to TestGetTaskFunc_Local
  • change the test cases where bundle resolver is used for the remote
    clusterTask, which does not make sense as a functionality given it is valid

/kind cleanup

Submitter Checklist

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

  • [n/a] 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 release-note-none Denotes a PR that doesnt merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 5, 2023
@JeromeJu JeromeJu force-pushed the remote-taskref-refactor-testcase branch from fe28e3a to 634d6c7 Compare June 5, 2023 21:27
@JeromeJu
Copy link
Member Author

JeromeJu commented Jun 5, 2023

/kind cleanup

@tekton-robot tekton-robot added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label Jun 5, 2023
@JeromeJu JeromeJu force-pushed the remote-taskref-refactor-testcase branch from 634d6c7 to 27672e4 Compare June 6, 2023 13:54
@tekton-robot tekton-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 6, 2023
@tekton-robot tekton-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 6, 2023
@JeromeJu JeromeJu force-pushed the remote-taskref-refactor-testcase branch from 27672e4 to 244a678 Compare June 6, 2023 19:01
@tekton-robot tekton-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 6, 2023
@JeromeJu JeromeJu force-pushed the remote-taskref-refactor-testcase branch from 244a678 to baf2f1d Compare June 6, 2023 19:02
@JeromeJu JeromeJu requested a review from lbernick June 6, 2023 19:03
Copy link
Member

@lbernick lbernick left a comment

Choose a reason for hiding this comment

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

@JeromeJu can you please add a bit more detail to your commit message about why we're separating local, resolution, and bundle tests from each other?

pkg/reconciler/taskrun/resources/taskref_test.go Outdated Show resolved Hide resolved
@JeromeJu JeromeJu force-pushed the remote-taskref-refactor-testcase branch from baf2f1d to d6677c7 Compare June 6, 2023 20:46
@tekton-robot tekton-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 6, 2023
@JeromeJu JeromeJu requested a review from lbernick June 6, 2023 20:46
pkg/reconciler/taskrun/resources/taskref_test.go Outdated Show resolved Hide resolved
pkg/reconciler/taskrun/resources/taskref_test.go Outdated Show resolved Hide resolved
@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lbernick

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

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 6, 2023
This commit refactors the test cases for taskRef_Test by:
- separate the TestGetTaskFunc for local, resolution and bundle tests
  since part of the syntax has deprecated in v1beta1 and diverged when
  we are going to move to v1.
- creats a separated test class TestGetTaskFunc_Bundle since there would
  be no  field in bundle resolvers
- remove the test cases regarding remote tasks ie. remote task without
  defaults in TestGetTaskFunc to TestGetTaskFunc_Remoteresolution and
  renames it to TestGetTaskFunc_Local
- change the test cases where bundle resolver is used for the remote
  clusterTask, which does not make sense as a functionality given it is valid
@JeromeJu JeromeJu force-pushed the remote-taskref-refactor-testcase branch from d6677c7 to f17c1de Compare June 6, 2023 21:27
@JeromeJu
Copy link
Member Author

JeromeJu commented Jun 6, 2023

/retest
flake :#6772

@Yongxuanzhang
Copy link
Member

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 7, 2023
@JeromeJu
Copy link
Member Author

JeromeJu commented Jun 7, 2023

/test pull-tekton-pipeline-beta-integration-tests
flake: #4169

@tekton-robot tekton-robot merged commit 2544266 into tektoncd:main Jun 7, 2023
JeromeJu added a commit to JeromeJu/pipeline that referenced this pull request Jun 9, 2023
This commit refactors the test cases related with remote pipelineRef,
which separates the original TestGetTaskFunc to local, bundle and
remote due to the syntax of v1beta1 bundle has been deprecated in v1
and replaced with the bundle resolver.

This is similar to the cleanup for TaskRef in tektoncd#6778
JeromeJu added a commit to JeromeJu/pipeline that referenced this pull request Jun 9, 2023
This commit refactors the test cases related with remote pipelineRef,
which separates the original TestGetTaskFunc to local, bundle and
remote due to the syntax of v1beta1 bundle has been deprecated in v1
and replaced with the bundle resolver.

This is similar to the cleanup for TaskRef in tektoncd#6778
JeromeJu added a commit to JeromeJu/pipeline that referenced this pull request Jun 9, 2023
This commit refactors the test cases related with remote pipelineRef,
which separates the original TestGetTaskFunc to local, bundle and
remote due to the syntax of v1beta1 bundle has been deprecated in v1
and replaced with the bundle resolver.

This is similar to the cleanup for TaskRef in tektoncd#6778
JeromeJu added a commit to JeromeJu/pipeline that referenced this pull request Jun 9, 2023
This commit refactors the test cases related with remote pipelineRef,
which separates the original TestGetTaskFunc to local, bundle and
remote due to the syntax of v1beta1 bundle has been deprecated in v1
and replaced with the bundle resolver.

This is similar to the cleanup for TaskRef in tektoncd#6778
tekton-robot pushed a commit that referenced this pull request Jun 12, 2023
This commit refactors the test cases related with remote pipelineRef,
which separates the original TestGetTaskFunc to local, bundle and
remote due to the syntax of v1beta1 bundle has been deprecated in v1
and replaced with the bundle resolver.

This is similar to the cleanup for TaskRef in #6778
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. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm Indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesnt merit a release note. 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.

4 participants