-
Notifications
You must be signed in to change notification settings - Fork 525
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add integration test assertion to ensure cortex_distributor_replicati…
…on_factor is not exported when ingest storage is enabled (#9385) * Add integration test to ensure cortex_distributor_replication_factor is not exported when ingest storage is enabled Signed-off-by: Marco Pracucci <[email protected]> * Added counterproof that cortex_distributor_replication_factor is exported when ingest storage is disabled Signed-off-by: Marco Pracucci <[email protected]> --------- Signed-off-by: Marco Pracucci <[email protected]>
- Loading branch information
Showing
4 changed files
with
106 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// SPDX-License-Identifier: AGPL-3.0-only | ||
// Provenance-includes-location: https://github.com/cortexproject/cortex/blob/master/integration/asserts.go | ||
// Provenance-includes-license: Apache-2.0 | ||
// Provenance-includes-copyright: The Cortex Authors. | ||
//go:build requires_docker | ||
|
||
package integration | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestIsRawMetricsContainingMetricName(t *testing.T) { | ||
rawMetrics := ` | ||
# HELP metric_1 Test | ||
# TYPE metric_1 counter | ||
metric_1{a="b"} 0 | ||
metric_1{c="d"} 0 | ||
# HELP metric_10 Test | ||
# TYPE metric_10 counter | ||
metric_10 0 | ||
# HELP metric_20 Test | ||
# TYPE metric_20 counter | ||
metric_20 0 | ||
` | ||
|
||
assert.True(t, isRawMetricsContainingMetricName("metric_1", rawMetrics)) | ||
assert.True(t, isRawMetricsContainingMetricName("metric_10", rawMetrics)) | ||
assert.True(t, isRawMetricsContainingMetricName("metric_20", rawMetrics)) | ||
assert.False(t, isRawMetricsContainingMetricName("metric_2", rawMetrics)) | ||
assert.False(t, isRawMetricsContainingMetricName("metric_200", rawMetrics)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters