From b802e663b3104760ea6bb455b2c5f9cfb899735b Mon Sep 17 00:00:00 2001 From: Pramod Bindal Date: Thu, 19 Sep 2024 12:23:26 +0530 Subject: [PATCH] Fix Test --- pkg/pipelinerunmetrics/metrics.go | 1 - pkg/pipelinerunmetrics/metrics_test.go | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/pkg/pipelinerunmetrics/metrics.go b/pkg/pipelinerunmetrics/metrics.go index 858499e4a85..a743ad2e1e9 100644 --- a/pkg/pipelinerunmetrics/metrics.go +++ b/pkg/pipelinerunmetrics/metrics.go @@ -409,7 +409,6 @@ func (r *Recorder) RunningPipelineRuns(lister listers.PipelineRunLister) error { mutators := []tag.Mutator{ tag.Insert(namespaceTag, pr.Namespace), tag.Insert(pipelineTag, pipelineName), - //tag.Insert(pipelinerunTag, pr.Name), } if r.cfg != nil && r.cfg.RunningPipelinerunLevel == "pipelinerun" { pipelineRunKey = pipelineRunKey + "#" + pr.Name diff --git a/pkg/pipelinerunmetrics/metrics_test.go b/pkg/pipelinerunmetrics/metrics_test.go index 9d9122548b8..832b82e1119 100644 --- a/pkg/pipelinerunmetrics/metrics_test.go +++ b/pkg/pipelinerunmetrics/metrics_test.go @@ -484,7 +484,7 @@ func TestRecordRunningPipelineRunsCount(t *testing.T) { // Add N randomly-named PipelineRuns with differently-succeeded statuses. for _, tr := range []*v1.PipelineRun{ newPipelineRun(corev1.ConditionTrue, ""), - newPipelineRun(corev1.ConditionUnknown, "test-x"), + newPipelineRun(corev1.ConditionUnknown, "test"), newPipelineRun(corev1.ConditionFalse, ""), } { if err := informer.Informer().GetIndexer().Add(tr); err != nil { @@ -502,7 +502,7 @@ func TestRecordRunningPipelineRunsCount(t *testing.T) { t.Errorf("RunningPipelineRuns: %v", err) } metricstest.CheckLastValueData(t, "running_pipelineruns_count", map[string]string{}, 1) - metricstest.CheckLastValueData(t, "running_pipelineruns", map[string]string{"pipeline": "anonymous", "namespace": "test-x"}, 1) + metricstest.CheckLastValueData(t, "running_pipelineruns", map[string]string{"pipeline": "anonymous", "namespace": "test"}, 1) } func TestRecordRunningPipelineRunsResolutionWaitCounts(t *testing.T) {