-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[TEP-0056]: Extract common status helper functions from pipelinerun_test.go.
#8850
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
[TEP-0056]: Extract common status helper functions from pipelinerun_test.go.
#8850
Conversation
Create `pkg/reconciler/testing/status.go` and move status related helper functions for `TaskRun/CustomRun` and later `PipelineRun` there. Remove duplication from helper functions. Move yaml parsing helper functions to `test/parse/yaml.go`. Rename import `ttesting ==> th`, short for "testing helpers". Issue tektoncd#8760, tektoncd#7166. Signed-off-by: Stanislav Jakuschevskij <[email protected]>
ee7adb9 to
0fa2316
Compare
|
The following is the coverage report on the affected files.
|
|
The following is the coverage report on the affected files.
|
vdemeester
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vdemeester The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
afrittoli
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @twoGiants - is the idea that these functions will be used elsewhere in testing as well, e.g. for pip testing?
/lgtm
@afrittoli they are already, see here. I extracted them into the new file and extend them with pip related helpers here in my working branch. I want to avoid bloating I started to put the pip tests which are not part of a table driven test cases in existing test functions in their own file here. This file will grow when more functionality (Params, Timeouts, Results, ...) will be implemented. I think that is how
Even without refactoring the actual helpers/tests much, this will reduce the cognitive load in the tests by an order of magnitude. Working in this giant |
Changes
Create
pkg/reconciler/testing/status.goand move status related helper functions forTaskRun/CustomRunand laterPipelineRunthere. Remove duplication from helper functions.Move yaml parsing helper functions to
test/parse/yaml.go.Rename import
ttesting ==> th, short for "testing helpers".Issue #8760, #7166.
/kind cleanup
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
/kind <type>. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tepRelease Notes