-
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 e2e tests for Windows #4139
Conversation
Two new tests have been added for Windows TaskRuns for testing success and failure states.
Hi @aiden-deloryn. Thanks for your PR. I'm waiting for a tektoncd member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
/assign @dibyom |
/ok-to-test |
test/windows_test.go
Outdated
Name: "unnamed-0", | ||
ContainerName: "step-unnamed-0", | ||
}} | ||
ignoreTerminatedFields := cmpopts.IgnoreFields(corev1.ContainerStateTerminated{}, "StartedAt", "FinishedAt", "ContainerID") |
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.
minor nit: these two ingnoreField variables are the same across both tests...maybe extract them to a var at the top of the file and reuse?
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.
Can you add some docs in a README about how to run windows tests, assuming running against a cluster with Windows nodes? Eventually we'll make this easier but some docs for now would be nice.
test/windows_test.go
Outdated
taskRun := &v1beta1.TaskRun{ | ||
ObjectMeta: metav1.ObjectMeta{Name: taskRunName, Namespace: namespace}, | ||
Spec: v1beta1.TaskRunSpec{ | ||
TaskRef: &v1beta1.TaskRef{Name: taskName}, |
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.
You can skip creating the Task then the TaskRun by specifying the taskSpec. This should be slightly faster and theoretically more robust to transient errors.
test/windows_test.go
Outdated
ignoreTerminatedFields := cmpopts.IgnoreFields(corev1.ContainerStateTerminated{}, "StartedAt", "FinishedAt", "ContainerID") | ||
ignoreStepFields := cmpopts.IgnoreFields(v1beta1.StepState{}, "ImageID") | ||
if d := cmp.Diff(taskrun.Status.Steps, expectedStepState, ignoreTerminatedFields, ignoreStepFields); d != "" { | ||
t.Fatalf("-got, +want: %v", d) |
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.
I think we tend to print these as -want,+got
test/windows_test.go
Outdated
ignoreTerminatedFields := cmpopts.IgnoreFields(corev1.ContainerStateTerminated{}, "StartedAt", "FinishedAt", "ContainerID") | ||
ignoreStepFields := cmpopts.IgnoreFields(v1beta1.StepState{}, "ImageID") | ||
if d := cmp.Diff(taskrun.Status.Steps, expectedStepState, ignoreTerminatedFields, ignoreStepFields); d != "" { | ||
t.Fatalf("-got, +want: %v", d) |
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 here
E2E tests for Windows have been updated based on review feedback. Instructions for how to run Windows tests have also been added to test/README.md
Thanks for the feedback, those changes have been added 🙂 |
/test pull-tekton-pipeline-alpha-integration-tests |
/lgtm |
[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 |
Changes
Two new tests have been added for Windows TaskRuns for testing
success and failure states.
/kind misc
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
functionality, content, code)
Release Notes