Skip to content

Commit

Permalink
Remove dot import from tests
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminguttmann-avtq committed Oct 26, 2023
1 parent 41df30e commit 11984f8
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 26 deletions.
18 changes: 9 additions & 9 deletions nozzle/rollup/counter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import (
"time"

"github.com/bosh-prometheus/firehose_exporter/metrics"
. "github.com/bosh-prometheus/firehose_exporter/nozzle/rollup"
"github.com/bosh-prometheus/firehose_exporter/nozzle/rollup"
"github.com/onsi/ginkgo"
"github.com/onsi/gomega"
)

var _ = ginkgo.Describe("Counter Rollup", func() {
extract := func(batches []*PointsBatch) []*metrics.RawMetric {
extract := func(batches []*rollup.PointsBatch) []*metrics.RawMetric {
var points []*metrics.RawMetric
for _, b := range batches {
points = append(points, b.Points...)
Expand All @@ -19,7 +19,7 @@ var _ = ginkgo.Describe("Counter Rollup", func() {
}

ginkgo.It("returns counters for rolled up events", func() {
counterRollup := NewCounterRollup(
counterRollup := rollup.NewCounterRollup(
"0",
nil,
)
Expand All @@ -36,7 +36,7 @@ var _ = ginkgo.Describe("Counter Rollup", func() {
})

ginkgo.It("returns points that track a running total of rolled up events", func() {
counterRollup := NewCounterRollup(
counterRollup := rollup.NewCounterRollup(
"0",
[]string{"included-tag"},
)
Expand All @@ -63,7 +63,7 @@ var _ = ginkgo.Describe("Counter Rollup", func() {
})

ginkgo.It("returns separate counters for distinct source IDs", func() {
counterRollup := NewCounterRollup(
counterRollup := rollup.NewCounterRollup(
"0",
[]string{"included-tag"},
)
Expand All @@ -84,7 +84,7 @@ var _ = ginkgo.Describe("Counter Rollup", func() {
})

ginkgo.It("returns separate counters for different included tags", func() {
counterRollup := NewCounterRollup(
counterRollup := rollup.NewCounterRollup(
"0",
[]string{"included-tag"},
)
Expand All @@ -107,7 +107,7 @@ var _ = ginkgo.Describe("Counter Rollup", func() {
})

ginkgo.It("does not return separate counters for different excluded tags", func() {
counterRollup := NewCounterRollup(
counterRollup := rollup.NewCounterRollup(
"0",
[]string{"included-tag"},
)
Expand All @@ -130,10 +130,10 @@ var _ = ginkgo.Describe("Counter Rollup", func() {

ginkgo.Context("CleanPeriodic", func() {
ginkgo.It("should clean metrics after amount of time", func() {
counterRollup := NewCounterRollup(
counterRollup := rollup.NewCounterRollup(
"0",
nil,
SetCounterCleaning(10*time.Millisecond, 50*time.Millisecond),
rollup.SetCounterCleaning(10*time.Millisecond, 50*time.Millisecond),
)

counterRollup.Record(
Expand Down
26 changes: 13 additions & 13 deletions nozzle/rollup/histogram_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"time"

"github.com/bosh-prometheus/firehose_exporter/metrics"
. "github.com/bosh-prometheus/firehose_exporter/nozzle/rollup"
"github.com/bosh-prometheus/firehose_exporter/nozzle/rollup"
"github.com/bosh-prometheus/firehose_exporter/transform"
dto "github.com/prometheus/client_model/go"

Expand Down Expand Up @@ -61,7 +61,7 @@ func (h *histogram) Bucket(le string) *dto.Histogram {
}

var _ = ginkgo.Describe("Histogram Rollup", func() {
extract := func(batches []*PointsBatch) []*histogram {
extract := func(batches []*rollup.PointsBatch) []*histogram {
var histograms []*histogram

for _, b := range batches {
Expand All @@ -74,7 +74,7 @@ var _ = ginkgo.Describe("Histogram Rollup", func() {
}

ginkgo.It("returns aggregate information for rolled up events", func() {
rollup := NewHistogramRollup(
rollup := rollup.NewHistogramRollup(
"0",
nil,
)
Expand All @@ -97,7 +97,7 @@ var _ = ginkgo.Describe("Histogram Rollup", func() {
})

ginkgo.It("returns batches which each includes a size estimate", func() {
rollup := NewHistogramRollup(
rollup := rollup.NewHistogramRollup(
"0",
nil,
)
Expand All @@ -114,7 +114,7 @@ var _ = ginkgo.Describe("Histogram Rollup", func() {
})

ginkgo.It("returns points for each bucket in the histogram", func() {
rollup := NewHistogramRollup(
rollup := rollup.NewHistogramRollup(
"0",
nil,
)
Expand All @@ -140,7 +140,7 @@ var _ = ginkgo.Describe("Histogram Rollup", func() {
})

ginkgo.It("returns points with the timestamp given to Rollup", func() {
rollup := NewHistogramRollup(
rollup := rollup.NewHistogramRollup(
"node-index",
nil,
)
Expand All @@ -156,7 +156,7 @@ var _ = ginkgo.Describe("Histogram Rollup", func() {
})

ginkgo.It("returns histograms with labels based on tags", func() {
rollup := NewHistogramRollup(
rollup := rollup.NewHistogramRollup(
"node-index",
[]string{"included-tag"},
)
Expand All @@ -179,7 +179,7 @@ var _ = ginkgo.Describe("Histogram Rollup", func() {
})

ginkgo.It("returns points that track a running total of rolled up events", func() {
rollup := NewHistogramRollup(
rollup := rollup.NewHistogramRollup(
"0",
[]string{"included-tag"},
)
Expand All @@ -206,7 +206,7 @@ var _ = ginkgo.Describe("Histogram Rollup", func() {
})

ginkgo.It("returns separate histograms for distinct source IDs", func() {
rollup := NewHistogramRollup(
rollup := rollup.NewHistogramRollup(
"0",
[]string{"included-tag"},
)
Expand All @@ -229,7 +229,7 @@ var _ = ginkgo.Describe("Histogram Rollup", func() {
})

ginkgo.It("returns separate histograms for different included tags", func() {
rollup := NewHistogramRollup(
rollup := rollup.NewHistogramRollup(
"0",
[]string{"included-tag"},
)
Expand All @@ -252,7 +252,7 @@ var _ = ginkgo.Describe("Histogram Rollup", func() {
})

ginkgo.It("does not return separate histograms for different excluded tags", func() {
rollup := NewHistogramRollup(
rollup := rollup.NewHistogramRollup(
"0",
[]string{"included-tag"},
)
Expand All @@ -277,10 +277,10 @@ var _ = ginkgo.Describe("Histogram Rollup", func() {
ginkgo.Context("CleanPeriodic", func() {

ginkgo.It("should clean metrics after amount of time", func() {
rollup := NewHistogramRollup(
rollup := rollup.NewHistogramRollup(
"0",
nil,
SetHistogramCleaning(10*time.Millisecond, 50*time.Millisecond),
rollup.SetHistogramCleaning(10*time.Millisecond, 50*time.Millisecond),
)
rollup.Record(
"source-id",
Expand Down
8 changes: 4 additions & 4 deletions transform/normalize_name_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@ import (
"github.com/onsi/ginkgo"
"github.com/onsi/gomega"

. "github.com/bosh-prometheus/firehose_exporter/transform"
"github.com/bosh-prometheus/firehose_exporter/transform"
)

var _ = ginkgo.Describe("NormalizeName", func() {
ginkgo.It("normalizes a name", func() {
gomega.Expect(NormalizeName("This_is_-_a-MetricName.Example/-._/._with:0_-._/totals")).To(gomega.Equal("this_is___a_metric_name_example_______with_0_____totals"))
gomega.Expect(transform.NormalizeName("This_is_-_a-MetricName.Example/-._/._with:0_-._/totals")).To(gomega.Equal("this_is___a_metric_name_example_______with_0_____totals"))
})
})

var _ = ginkgo.Describe("NormalizeNameDesc", func() {
ginkgo.It("normalizes a name description", func() {
gomega.Expect(NormalizeNameDesc("/p.This_is_-_a-MetricName.Example/with:0totals")).To(gomega.Equal("/p-This_is_-_a-MetricName.Example/with:0totals"))
gomega.Expect(transform.NormalizeNameDesc("/p.This_is_-_a-MetricName.Example/with:0totals")).To(gomega.Equal("/p-This_is_-_a-MetricName.Example/with:0totals"))
})
})

var _ = ginkgo.Describe("NormalizeOriginDesc", func() {
ginkgo.It("normalizes a description", func() {
gomega.Expect(NormalizeOriginDesc("This_is-a.Desc.Example")).To(gomega.Equal("This_is-a-Desc-Example"))
gomega.Expect(transform.NormalizeOriginDesc("This_is-a.Desc.Example")).To(gomega.Equal("This_is-a-Desc-Example"))
})
})

0 comments on commit 11984f8

Please sign in to comment.