Fix test fingerprints after metric name label change.
Change-Id: I9d927ca2bbb7424c4caaeef918971134e3d61acb
This commit is contained in:
parent
f91d98c93e
commit
7524a7a115
|
@ -21,92 +21,92 @@ import (
|
|||
func TestSamplesSort(t *testing.T) {
|
||||
input := Samples{
|
||||
&Sample{
|
||||
// Fingerprint: 7658840550047852795
|
||||
Metric: Metric{
|
||||
MetricNameLabel: "B",
|
||||
},
|
||||
Timestamp: 1,
|
||||
},
|
||||
&Sample{
|
||||
// Fingerprint: 7658840550047852795
|
||||
Metric: Metric{
|
||||
MetricNameLabel: "B",
|
||||
},
|
||||
Timestamp: 2,
|
||||
},
|
||||
&Sample{
|
||||
// Fingerprint: 13206712341014817019
|
||||
// Fingerprint: 5735370332639503759
|
||||
Metric: Metric{
|
||||
MetricNameLabel: "A",
|
||||
},
|
||||
Timestamp: 1,
|
||||
},
|
||||
&Sample{
|
||||
// Fingerprint: 13206712341014817019
|
||||
// Fingerprint: 5735370332639503759
|
||||
Metric: Metric{
|
||||
MetricNameLabel: "A",
|
||||
},
|
||||
Timestamp: 2,
|
||||
},
|
||||
&Sample{
|
||||
// Fingerprint: 2110968759080888571
|
||||
// Fingerprint: 13086089349438416271
|
||||
Metric: Metric{
|
||||
MetricNameLabel: "C",
|
||||
},
|
||||
Timestamp: 1,
|
||||
},
|
||||
&Sample{
|
||||
// Fingerprint: 2110968759080888571
|
||||
// Fingerprint: 13086089349438416271
|
||||
Metric: Metric{
|
||||
MetricNameLabel: "C",
|
||||
},
|
||||
Timestamp: 2,
|
||||
},
|
||||
&Sample{
|
||||
// Fingerprint: 187498541672539535
|
||||
Metric: Metric{
|
||||
MetricNameLabel: "B",
|
||||
},
|
||||
Timestamp: 1,
|
||||
},
|
||||
&Sample{
|
||||
// Fingerprint: 187498541672539535
|
||||
Metric: Metric{
|
||||
MetricNameLabel: "B",
|
||||
},
|
||||
Timestamp: 2,
|
||||
},
|
||||
}
|
||||
|
||||
expected := Samples{
|
||||
&Sample{
|
||||
// Fingerprint: 2110968759080888571
|
||||
Metric: Metric{
|
||||
MetricNameLabel: "C",
|
||||
},
|
||||
Timestamp: 1,
|
||||
},
|
||||
&Sample{
|
||||
// Fingerprint: 2110968759080888571
|
||||
Metric: Metric{
|
||||
MetricNameLabel: "C",
|
||||
},
|
||||
Timestamp: 2,
|
||||
},
|
||||
&Sample{
|
||||
// Fingerprint: 7658840550047852795
|
||||
// Fingerprint: 187498541672539535
|
||||
Metric: Metric{
|
||||
MetricNameLabel: "B",
|
||||
},
|
||||
Timestamp: 1,
|
||||
},
|
||||
&Sample{
|
||||
// Fingerprint: 7658840550047852795
|
||||
// Fingerprint: 187498541672539535
|
||||
Metric: Metric{
|
||||
MetricNameLabel: "B",
|
||||
},
|
||||
Timestamp: 2,
|
||||
},
|
||||
&Sample{
|
||||
// Fingerprint: 13206712341014817019
|
||||
// Fingerprint: 5735370332639503759
|
||||
Metric: Metric{
|
||||
MetricNameLabel: "A",
|
||||
},
|
||||
Timestamp: 1,
|
||||
},
|
||||
&Sample{
|
||||
// Fingerprint: 13206712341014817019
|
||||
// Fingerprint: 5735370332639503759
|
||||
Metric: Metric{
|
||||
MetricNameLabel: "A",
|
||||
},
|
||||
Timestamp: 2,
|
||||
},
|
||||
&Sample{
|
||||
// Fingerprint: 13086089349438416271
|
||||
Metric: Metric{
|
||||
MetricNameLabel: "C",
|
||||
},
|
||||
Timestamp: 1,
|
||||
},
|
||||
&Sample{
|
||||
// Fingerprint: 13086089349438416271
|
||||
Metric: Metric{
|
||||
MetricNameLabel: "C",
|
||||
},
|
||||
Timestamp: 2,
|
||||
},
|
||||
}
|
||||
|
||||
sort.Sort(input)
|
||||
|
@ -119,7 +119,7 @@ func TestSamplesSort(t *testing.T) {
|
|||
expectedFp.LoadFromMetric(expected[i].Metric)
|
||||
|
||||
if !actualFp.Equal(&expectedFp) {
|
||||
t.Fatalf("%d. Incorrect fingerprint. Got %s; want %s", i, actualFp, expectedFp)
|
||||
t.Fatalf("%d. Incorrect fingerprint. Got %s; want %s", i, actualFp.String(), expectedFp.String())
|
||||
}
|
||||
|
||||
if actual.Timestamp != expected[i].Timestamp {
|
||||
|
|
Loading…
Reference in New Issue