Skip to content

Commit

Permalink
ResolvedPipelineRunTask to ResolvedPipelineTask
Browse files Browse the repository at this point in the history
`ResolvedPipelineRunTask` is a confusing name for a `PipelineTask`
and its resources, plus we don't have a `PipelineRunTask` object.

This change renames `ResolvedPipelineRunTask` to `ResolvedPipelineTask`.

Issue: #5024
  • Loading branch information
jerop committed Jun 22, 2022
1 parent 13a3c5d commit db07cae
Show file tree
Hide file tree
Showing 10 changed files with 459 additions and 459 deletions.
188 changes: 94 additions & 94 deletions pkg/reconciler/pipelinerun/pipelinerun.go

Large diffs are not rendered by default.

68 changes: 34 additions & 34 deletions pkg/reconciler/pipelinerun/pipelinerun_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3066,12 +3066,12 @@ func TestGetTaskRunTimeout(t *testing.T) {
timeoutDuration *metav1.Duration
timeoutFields *v1beta1.TimeoutFields
startTime time.Time
rprt *resources.ResolvedPipelineRunTask
rpt *resources.ResolvedPipelineTask
expected *metav1.Duration
}{{
name: "nil timeout duration",
startTime: now,
rprt: &resources.ResolvedPipelineRunTask{
rpt: &resources.ResolvedPipelineTask{
PipelineTask: &v1beta1.PipelineTask{
Timeout: nil,
},
Expand All @@ -3081,7 +3081,7 @@ func TestGetTaskRunTimeout(t *testing.T) {
name: "timeout specified in pr",
timeoutDuration: &metav1.Duration{Duration: 20 * time.Minute},
startTime: now,
rprt: &resources.ResolvedPipelineRunTask{
rpt: &resources.ResolvedPipelineTask{
PipelineTask: &v1beta1.PipelineTask{
Timeout: nil,
},
Expand All @@ -3091,7 +3091,7 @@ func TestGetTaskRunTimeout(t *testing.T) {
name: "0 timeout duration",
timeoutDuration: &metav1.Duration{Duration: 0 * time.Minute},
startTime: now,
rprt: &resources.ResolvedPipelineRunTask{
rpt: &resources.ResolvedPipelineTask{
PipelineTask: &v1beta1.PipelineTask{
Timeout: nil,
},
Expand All @@ -3101,7 +3101,7 @@ func TestGetTaskRunTimeout(t *testing.T) {
name: "taskrun being created after timeout expired",
timeoutDuration: &metav1.Duration{Duration: 1 * time.Minute},
startTime: now.Add(-2 * time.Minute),
rprt: &resources.ResolvedPipelineRunTask{
rpt: &resources.ResolvedPipelineTask{
PipelineTask: &v1beta1.PipelineTask{
Timeout: nil,
},
Expand All @@ -3111,7 +3111,7 @@ func TestGetTaskRunTimeout(t *testing.T) {
name: "taskrun being created with timeout for PipelineTask",
timeoutDuration: &metav1.Duration{Duration: 20 * time.Minute},
startTime: now,
rprt: &resources.ResolvedPipelineRunTask{
rpt: &resources.ResolvedPipelineTask{
PipelineTask: &v1beta1.PipelineTask{
Timeout: &metav1.Duration{Duration: 2 * time.Minute},
},
Expand All @@ -3121,7 +3121,7 @@ func TestGetTaskRunTimeout(t *testing.T) {
name: "0 timeout duration for PipelineRun, PipelineTask timeout still applied",
timeoutDuration: &metav1.Duration{Duration: 0 * time.Minute},
startTime: now,
rprt: &resources.ResolvedPipelineRunTask{
rpt: &resources.ResolvedPipelineTask{
PipelineTask: &v1beta1.PipelineTask{
Timeout: &metav1.Duration{Duration: 2 * time.Minute},
},
Expand All @@ -3133,7 +3133,7 @@ func TestGetTaskRunTimeout(t *testing.T) {
Tasks: &metav1.Duration{Duration: 20 * time.Minute},
},
startTime: now,
rprt: &resources.ResolvedPipelineRunTask{
rpt: &resources.ResolvedPipelineTask{
PipelineTask: &v1beta1.PipelineTask{
Timeout: nil,
},
Expand All @@ -3146,7 +3146,7 @@ func TestGetTaskRunTimeout(t *testing.T) {
Tasks: &metav1.Duration{Duration: 20 * time.Minute},
},
startTime: now,
rprt: &resources.ResolvedPipelineRunTask{
rpt: &resources.ResolvedPipelineTask{
PipelineTask: &v1beta1.PipelineTask{
Timeout: nil,
},
Expand All @@ -3158,7 +3158,7 @@ func TestGetTaskRunTimeout(t *testing.T) {
Tasks: &metav1.Duration{Duration: 20 * time.Minute},
},
startTime: now,
rprt: &resources.ResolvedPipelineRunTask{
rpt: &resources.ResolvedPipelineTask{
PipelineTask: &v1beta1.PipelineTask{
Timeout: &metav1.Duration{Duration: 2 * time.Minute},
},
Expand All @@ -3170,7 +3170,7 @@ func TestGetTaskRunTimeout(t *testing.T) {
Tasks: &metav1.Duration{Duration: 1 * time.Minute},
},
startTime: now,
rprt: &resources.ResolvedPipelineRunTask{
rpt: &resources.ResolvedPipelineTask{
PipelineTask: &v1beta1.PipelineTask{
Timeout: &metav1.Duration{Duration: 2 * time.Minute},
},
Expand All @@ -3182,7 +3182,7 @@ func TestGetTaskRunTimeout(t *testing.T) {
Tasks: &metav1.Duration{Duration: 20 * time.Minute},
},
startTime: now.Add(-10 * time.Minute),
rprt: &resources.ResolvedPipelineRunTask{
rpt: &resources.ResolvedPipelineTask{
PipelineTask: &v1beta1.PipelineTask{},
TaskRun: &v1beta1.TaskRun{
Status: v1beta1.TaskRunStatus{
Expand All @@ -3199,7 +3199,7 @@ func TestGetTaskRunTimeout(t *testing.T) {
Tasks: &metav1.Duration{Duration: 20 * time.Minute},
},
startTime: now.Add(-10 * time.Minute),
rprt: &resources.ResolvedPipelineRunTask{
rpt: &resources.ResolvedPipelineTask{
PipelineTask: &v1beta1.PipelineTask{
Timeout: &metav1.Duration{Duration: 15 * time.Minute},
},
Expand All @@ -3218,7 +3218,7 @@ func TestGetTaskRunTimeout(t *testing.T) {
Tasks: &metav1.Duration{Duration: 20 * time.Minute},
},
startTime: now.Add(-10 * time.Minute),
rprt: &resources.ResolvedPipelineRunTask{
rpt: &resources.ResolvedPipelineTask{
PipelineTask: &v1beta1.PipelineTask{
Timeout: &metav1.Duration{Duration: 15 * time.Minute},
},
Expand Down Expand Up @@ -3248,7 +3248,7 @@ func TestGetTaskRunTimeout(t *testing.T) {
},
},
}
if d := cmp.Diff(getTaskRunTimeout(context.TODO(), pr, tc.rprt, testClock), tc.expected); d != "" {
if d := cmp.Diff(getTaskRunTimeout(context.TODO(), pr, tc.rpt, testClock), tc.expected); d != "" {
t.Errorf("Unexpected task run timeout. Diff %s", diff.PrintWantGot(d))
}
})
Expand All @@ -3266,28 +3266,28 @@ func TestGetFinallyTaskRunTimeout(t *testing.T) {
timeoutFields *v1beta1.TimeoutFields
startTime time.Time
pr *v1beta1.PipelineRun
rprt *resources.ResolvedPipelineRunTask
rpt *resources.ResolvedPipelineTask
expected *metav1.Duration
}{{
name: "nil timeout duration",
startTime: now,
rprt: &resources.ResolvedPipelineRunTask{
rpt: &resources.ResolvedPipelineTask{
PipelineTask: &v1beta1.PipelineTask{},
},
expected: &metav1.Duration{Duration: 60 * time.Minute},
}, {
name: "timeout specified in pr",
timeoutDuration: &metav1.Duration{Duration: 20 * time.Minute},
startTime: now,
rprt: &resources.ResolvedPipelineRunTask{
rpt: &resources.ResolvedPipelineTask{
PipelineTask: &v1beta1.PipelineTask{},
},
expected: &metav1.Duration{Duration: 20 * time.Minute},
}, {
name: "taskrun being created after timeout expired",
timeoutDuration: &metav1.Duration{Duration: 1 * time.Minute},
startTime: now.Add(-2 * time.Minute),
rprt: &resources.ResolvedPipelineRunTask{
rpt: &resources.ResolvedPipelineTask{
PipelineTask: &v1beta1.PipelineTask{},
},
expected: &metav1.Duration{Duration: 1 * time.Second},
Expand All @@ -3298,7 +3298,7 @@ func TestGetFinallyTaskRunTimeout(t *testing.T) {
Tasks: &metav1.Duration{Duration: 20 * time.Minute},
},
startTime: now,
rprt: &resources.ResolvedPipelineRunTask{
rpt: &resources.ResolvedPipelineTask{
PipelineTask: &v1beta1.PipelineTask{},
},
expected: &metav1.Duration{Duration: 20 * time.Minute},
Expand All @@ -3308,7 +3308,7 @@ func TestGetFinallyTaskRunTimeout(t *testing.T) {
Finally: &metav1.Duration{Duration: 20 * time.Minute},
},
startTime: now,
rprt: &resources.ResolvedPipelineRunTask{
rpt: &resources.ResolvedPipelineTask{
PipelineTask: &v1beta1.PipelineTask{},
},
expected: &metav1.Duration{Duration: 20 * time.Minute},
Expand All @@ -3320,14 +3320,14 @@ func TestGetFinallyTaskRunTimeout(t *testing.T) {
Finally: &metav1.Duration{Duration: 20 * time.Minute},
},
startTime: now,
rprt: &resources.ResolvedPipelineRunTask{
rpt: &resources.ResolvedPipelineTask{
PipelineTask: &v1beta1.PipelineTask{},
},
expected: &metav1.Duration{Duration: 20 * time.Minute},
}, {
name: "use pipeline.finally[].timeout",
startTime: now,
rprt: &resources.ResolvedPipelineRunTask{
rpt: &resources.ResolvedPipelineTask{
PipelineTask: &v1beta1.PipelineTask{
Timeout: &metav1.Duration{Duration: 2 * time.Minute},
},
Expand All @@ -3340,7 +3340,7 @@ func TestGetFinallyTaskRunTimeout(t *testing.T) {
Finally: &metav1.Duration{Duration: 1 * time.Minute},
},
startTime: now,
rprt: &resources.ResolvedPipelineRunTask{
rpt: &resources.ResolvedPipelineTask{
PipelineTask: &v1beta1.PipelineTask{
Timeout: &metav1.Duration{Duration: 2 * time.Minute},
},
Expand All @@ -3352,7 +3352,7 @@ func TestGetFinallyTaskRunTimeout(t *testing.T) {
Finally: &metav1.Duration{Duration: 20 * time.Minute},
},
startTime: now.Add(-10 * time.Minute),
rprt: &resources.ResolvedPipelineRunTask{
rpt: &resources.ResolvedPipelineTask{
PipelineTask: &v1beta1.PipelineTask{},
TaskRun: &v1beta1.TaskRun{
Status: v1beta1.TaskRunStatus{
Expand All @@ -3369,7 +3369,7 @@ func TestGetFinallyTaskRunTimeout(t *testing.T) {
Finally: &metav1.Duration{Duration: 20 * time.Minute},
},
startTime: now.Add(-10 * time.Minute),
rprt: &resources.ResolvedPipelineRunTask{
rpt: &resources.ResolvedPipelineTask{
PipelineTask: &v1beta1.PipelineTask{
Timeout: &metav1.Duration{Duration: 15 * time.Minute},
},
Expand All @@ -3389,7 +3389,7 @@ func TestGetFinallyTaskRunTimeout(t *testing.T) {
Finally: &metav1.Duration{Duration: 20 * time.Minute},
},
startTime: now.Add(-10 * time.Minute),
rprt: &resources.ResolvedPipelineRunTask{
rpt: &resources.ResolvedPipelineTask{
PipelineTask: &v1beta1.PipelineTask{
Timeout: &metav1.Duration{Duration: 15 * time.Minute},
},
Expand Down Expand Up @@ -3419,7 +3419,7 @@ func TestGetFinallyTaskRunTimeout(t *testing.T) {
},
},
}
if d := cmp.Diff(tc.expected, getFinallyTaskRunTimeout(context.TODO(), pr, tc.rprt, testClock)); d != "" {
if d := cmp.Diff(tc.expected, getFinallyTaskRunTimeout(context.TODO(), pr, tc.rpt, testClock)); d != "" {
t.Errorf("Unexpected finally task run timeout. Diff %s", diff.PrintWantGot(d))
}
})
Expand Down Expand Up @@ -7217,7 +7217,7 @@ func TestGetTaskrunWorkspaces_Failure(t *testing.T) {
tests := []struct {
name string
pr *v1beta1.PipelineRun
rprt *resources.ResolvedPipelineRunTask
rprt *resources.ResolvedPipelineTask
expectedError string
}{{
name: "failure declaring workspace with different name",
Expand All @@ -7227,7 +7227,7 @@ metadata:
spec:
workspaces:
- name: source`),
rprt: &resources.ResolvedPipelineRunTask{
rprt: &resources.ResolvedPipelineTask{
PipelineTask: &v1beta1.PipelineTask{
Name: "resolved-pipelinetask",
Workspaces: []v1beta1.WorkspacePipelineTaskBinding{{
Expand All @@ -7247,7 +7247,7 @@ spec:
workspaces:
- name: source
`),
rprt: &resources.ResolvedPipelineRunTask{
rprt: &resources.ResolvedPipelineTask{
PipelineTask: &v1beta1.PipelineTask{
Name: "resolved-pipelinetask",
Workspaces: []v1beta1.WorkspacePipelineTaskBinding{{
Expand Down Expand Up @@ -7277,7 +7277,7 @@ func TestGetTaskrunWorkspaces_Success(t *testing.T) {
tests := []struct {
name string
pr *v1beta1.PipelineRun
rprt *resources.ResolvedPipelineRunTask
rprt *resources.ResolvedPipelineTask
}{{
name: "valid declaration of workspace names",
pr: parse.MustParsePipelineRun(t, `
Expand All @@ -7286,7 +7286,7 @@ metadata:
spec:
workspaces:
- name: source`),
rprt: &resources.ResolvedPipelineRunTask{
rprt: &resources.ResolvedPipelineTask{
PipelineTask: &v1beta1.PipelineTask{
Name: "resolved-pipelinetask",
Workspaces: []v1beta1.WorkspacePipelineTaskBinding{{
Expand All @@ -7304,7 +7304,7 @@ metadata:
spec:
workspaces:
- name: source`),
rprt: &resources.ResolvedPipelineRunTask{
rprt: &resources.ResolvedPipelineTask{
PipelineTask: &v1beta1.PipelineTask{
Name: "resolved-pipelinetask",
Workspaces: []v1beta1.WorkspacePipelineTaskBinding{{
Expand Down
Loading

0 comments on commit db07cae

Please sign in to comment.