Skip to content

Commit

Permalink
Refine Conformance test for Pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
JeromeJu committed Apr 2, 2024
1 parent a9d8a9b commit 34673be
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion test/conformance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ import (

type conditionFn func(name string) ConditionAccessorFn

// TestTaskRun examines the conformance of Tekton pipeline @HEAD. It does not
// searve as part of the OSS conformance test suite but aims to keep the
// devel conformant and to prevent regressions.
func TestTaskRun(t *testing.T) {
ctx := context.Background()
ctx, cancel := context.WithCancel(ctx)
Expand Down Expand Up @@ -76,6 +79,7 @@ spec:
Reason: "Completed",
},
},
TerminationReason: "Completed",
}},
}, {
name: "failed-task-run",
Expand Down Expand Up @@ -105,20 +109,23 @@ spec:
Reason: "Completed",
},
},
TerminationReason: "Completed",
}, {
ContainerState: corev1.ContainerState{
Terminated: &corev1.ContainerStateTerminated{
ExitCode: 1,
Reason: "Error",
},
},
TerminationReason: "Error",
}, {
ContainerState: corev1.ContainerState{
Terminated: &corev1.ContainerStateTerminated{
ExitCode: 1,
Reason: "Error",
},
},
TerminationReason: "Skipped",
}},
}} {
t.Run(tc.name, func(t *testing.T) {
Expand Down Expand Up @@ -182,7 +189,7 @@ spec:
}

ignoreTerminatedFields := cmpopts.IgnoreFields(corev1.ContainerStateTerminated{}, "StartedAt", "FinishedAt", "ContainerID")
ignoreStepFields := cmpopts.IgnoreFields(v1.StepState{}, "ImageID", "Name", "ContainerName")
ignoreStepFields := cmpopts.IgnoreFields(v1.StepState{}, "ImageID", "Name", "Container")
if d := cmp.Diff(tr.Status.Steps, tc.expectedStepState, ignoreTerminatedFields, ignoreStepFields); d != "" {
t.Fatalf("-got, +want: %v", d)
}
Expand Down

0 comments on commit 34673be

Please sign in to comment.