Skip to content

Commit

Permalink
undid changes since those are a part of a different PR.
Browse files Browse the repository at this point in the history
  • Loading branch information
chitrangpatel committed Apr 27, 2022
1 parent a144937 commit d22579e
Showing 1 changed file with 0 additions and 56 deletions.
56 changes: 0 additions & 56 deletions pkg/pod/status_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ limitations under the License.
package pod

import (
"strings"
"testing"
"time"

Expand All @@ -34,61 +33,6 @@ import (

var ignoreVolatileTime = cmp.Comparer(func(_, _ apis.VolatileTime) bool { return true })

func TestSetTaskRunStatusBasedOnStepStatus(t *testing.T) {
for _, c := range []struct {
desc string
ContainerStatuses []corev1.ContainerStatus
}{{
desc: "test result with large pipeline result",
ContainerStatuses: []corev1.ContainerStatus{{
Name: "step-bar-0",
State: corev1.ContainerState{
Terminated: &corev1.ContainerStateTerminated{
Message: `[{"key":"resultName","value":"resultValue", "type":1}, {"key":"digest","value":"sha256:1234","resourceRef":{"name":"source-image"}}]`,
},
},
},
{
Name: "step-bar1",
State: corev1.ContainerState{
Terminated: &corev1.ContainerStateTerminated{
Message: `[{"key":"resultName","value":"resultValue", "type":1}, {"key":"digest","value":"sha256:1234` + strings.Repeat("a", 3072) + `","resourceRef":{"name":"source-image"}}]`,
},
},
},
{
Name: "step-bar2",
State: corev1.ContainerState{
Terminated: &corev1.ContainerStateTerminated{
Message: `[{"key":"resultName","value":"resultValue", "type":1}, {"key":"digest","value":"sha256:1234` + strings.Repeat("a", 3072) + `","resourceRef":{"name":"source-image"}}]`,
},
},
}},
}} {
t.Run(c.desc, func(t *testing.T) {
startTime := time.Date(2010, 1, 1, 1, 1, 1, 1, time.UTC)
tr := v1beta1.TaskRun{
ObjectMeta: metav1.ObjectMeta{
Name: "task-run",
Namespace: "foo",
},
Status: v1beta1.TaskRunStatus{
TaskRunStatusFields: v1beta1.TaskRunStatusFields{
StartTime: &metav1.Time{Time: startTime},
},
},
}

logger, _ := logging.NewLogger("", "status")
merr := setTaskRunStatusBasedOnStepStatus(logger, c.ContainerStatuses, &tr)
if merr != nil {
t.Errorf("setTaskRunStatusBasedOnStepStatus: %s", merr)
}

})
}
}

func TestMakeTaskRunStatus(t *testing.T) {
for _, c := range []struct {
desc string
Expand Down

0 comments on commit d22579e

Please sign in to comment.