Skip to content

Commit 794d425

Browse files
authored
Merge pull request #5 from sysdiglabs/fix-test
Fix test
2 parents a914e22 + 47aec0b commit 794d425

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pkg/translator/translator_test.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,15 @@ var _ = Describe("Config", func() {
2121
})
2222
It("Removes all labels", func() {
2323
originalText := "irate(elasticsearch_indices_store_throttle_time_seconds_total{kube_cluster_name=$k8s_cluster,cluster=~$es_cluster, host=~$node,kube_namespace_name=~$namespace, kube_workload_name=~$workload}[$__interval]) "
24-
expectedText := "irate(elasticsearch_indices_store_throttle_time_seconds_total[5m])"
24+
expectedText := "irate(elasticsearch_indices_store_throttle_time_seconds_total[5m]) "
2525
processedText := RemoveSysdigLabels(originalText, "all")
2626
Expect(expectedText).To(Equal(processedText))
2727
})
28+
It("Remove $__scope", func() {
29+
originalText := "irate(elasticsearch_indices_store_throttle_time_seconds_total{$__scope, kube_cluster_name=$k8s_cluster}[$__interval])"
30+
expectedText := "irate(elasticsearch_indices_store_throttle_time_seconds_total[5m])"
31+
processedText := RemoveSysdigLabels(originalText, "")
32+
Expect(expectedText).To(Equal(processedText))
33+
})
2834
})
2935
})

0 commit comments

Comments
 (0)