-
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
Add Terminated, Running, and Waiting Container States to Test Builder #1591
Add Terminated, Running, and Waiting Container States to Test Builder #1591
Conversation
/lgtm |
The following is the coverage report on pkg/.
|
/retest |
I have no problem with the change, but I'm a little curious why it's needed. In this PR it seems to only be used in a unit test to check that the test builder works. What we'd really benefit from is a test that a PodStatus with waiting/running/terminated steps get translated to a TaskRunStatus correctly, which I believe we should already have somewhere. That being said it's a small change, so if it helps you in some way or sets up a future test I'm all for it. (Just as an aside, unrelated to this PR really, I don't really love the test builders. I find it perfectly reasonable to just create Go structs directly, and having to maintain a copy of the test builders and add -- or forget to add -- support in a test builder every time we add a new field to a type just adds overhead. But other people seem to like them, so 🤷) |
@imjasonh We use this in CLI unit tests. I thought it might be helpful to make these available so that others could have an easier solution to find than what we did for the CLI. I'm not the biggest fan of test builder either, but, as you say, they are used quite frequently by some. Thought this was a good use case of it though. |
The following is the coverage report on pkg/.
|
/lgtm |
Ah perfect, thanks for that clarification. 👍 /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ImJasonH 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 |
Closes #1549
Changes
Adds three new funcs to test builder to allow setting the container state for testing purposes around Tekton. The three new funcs correspond to the container states for a step: Terminating, Running, and Waiting.
As a follow up, I think removing the
StateTerminated
func from test builder would be appropriate, but there should be a formal announcement about it before any work is done towards that.Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
See the contribution guide for more details.
Reviewer Notes
If API changes are included, additive changes must be approved by at least two OWNERS and backwards incompatible changes must be approved by more than 50% of the OWNERS, and they must first be added in a backwards compatible way.
Release Notes
N/A