Skip to content

Commit

Permalink
Use pipelineRun instead of taskRun in metrics_test…
Browse files Browse the repository at this point in the history
… copy/pasta I think, it needs to be name pipelineRun as it refers to
pipelineRun 😛

Signed-off-by: Vincent Demeester <vdemeest@redhat.com>
  • Loading branch information
vdemeester authored and tekton-robot committed May 5, 2020
1 parent a4065de commit 2eacbfc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/reconciler/pipelinerun/metrics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ func TestRecordPipelineRunDurationCount(t *testing.T) {

testData := []struct {
name string
taskRun *v1alpha1.PipelineRun
pipelineRun *v1alpha1.PipelineRun
expectedTags map[string]string
expectedCountTags map[string]string
expectedDuration float64
expectedCount int64
}{{
name: "for_succeeded_pipeline",
taskRun: tb.PipelineRun("pipelinerun-1", tb.PipelineRunNamespace("ns"),
pipelineRun: tb.PipelineRun("pipelinerun-1", tb.PipelineRunNamespace("ns"),
tb.PipelineRunSpec("pipeline-1"),
tb.PipelineRunStatus(
tb.PipelineRunStartTime(startTime),
Expand All @@ -78,7 +78,7 @@ func TestRecordPipelineRunDurationCount(t *testing.T) {
expectedCount: 1,
}, {
name: "for_failed_pipeline",
taskRun: tb.PipelineRun("pipelinerun-1", tb.PipelineRunNamespace("ns"),
pipelineRun: tb.PipelineRun("pipelinerun-1", tb.PipelineRunNamespace("ns"),
tb.PipelineRunSpec("pipeline-1"),
tb.PipelineRunStatus(
tb.PipelineRunStartTime(startTime),
Expand Down Expand Up @@ -108,7 +108,7 @@ func TestRecordPipelineRunDurationCount(t *testing.T) {
metrics, err := NewRecorder()
assertErrIsNil(err, "Recorder initialization failed", t)

err = metrics.DurationAndCount(test.taskRun)
err = metrics.DurationAndCount(test.pipelineRun)
assertErrIsNil(err, "DurationAndCount recording recording got an error", t)
metricstest.CheckDistributionData(t, "pipelinerun_duration_seconds", test.expectedTags, 1, test.expectedDuration, test.expectedDuration)
metricstest.CheckCountData(t, "pipelinerun_count", test.expectedCountTags, test.expectedCount)
Expand Down

0 comments on commit 2eacbfc

Please sign in to comment.