-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
divide ApplyTaskResultsToPipelineResults tests into success and error #6388
divide ApplyTaskResultsToPipelineResults tests into success and error #6388
Conversation
This commit divides ApplyTaskResultsToPipelineResults unit tests into success and error, two separate tests to improve the readibility and easier to find bugs. Before this commit, the unit test doesn't check the case when the return error is not nil but expect nil, and some errors are not checked. Signed-off-by: Yongxuan Zhang yongxuanzhang@google.com
f0e0dda
to
72804c3
Compare
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.
LGTM with one minor comment
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dibyom 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 |
@@ -3764,6 +3709,164 @@ func TestApplyTaskResultsToPipelineResults(t *testing.T) { | |||
}}, | |||
}, | |||
expectedResults: nil, | |||
}, { | |||
description: "multiple-results-multiple-successful-tasks ", |
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.
NIT: extra space after tasks "
skippedTasks: []v1beta1.SkippedTask{{ | ||
Name: "skippedTask", | ||
}}, | ||
expectedResults: nil, |
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.
same as @dibyom's comment ⬇️ expectedResults is nil by default
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.
we keep the definition but no need to initialize to nil here
thanks a bunch @Yongxuanzhang for organizing these tests, I left some NITs, please feel free to address them in a separate PR. /lgtm |
Changes
This commit divides ApplyTaskResultsToPipelineResults unit tests into success and error, two separate tests to improve the readability and easier to find bugs. Before this commit, the unit test doesn't check the case when the return error is not nil but expect nil, and some errors are not checked.
No functional changes, but fix some tests bugs.
/kind misc
Signed-off-by: Yongxuan Zhang yongxuanzhang@google.com
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
functionality, content, code)
/kind <type>
. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tepRelease Notes