Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

integration: Simplify ruler test assertions, fix comment #9988

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions integration/ruler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,7 @@ func TestRulerMetricsForInvalidQueriesAndNoFetchedSeries(t *testing.T) {
addNewRuleAndWait(groupName2, expression2, false)

// Ensure that samples were returned.
require.Less(t, 0, getLastEvalSamples())
require.Positive(t, getLastEvalSamples())

// Ensure that the metric for no fetched series was not incremented.
require.Equal(t, zeroSeriesQueries, getZeroSeriesQueriesTotal())
Expand All @@ -740,7 +740,7 @@ func TestRulerMetricsForInvalidQueriesAndNoFetchedSeries(t *testing.T) {
addNewRuleAndWait(groupName3, expression3, false)

// Ensure that samples were returned.
require.Less(t, 0, getLastEvalSamples())
require.Positive(t, getLastEvalSamples())

// Ensure that the metric for no fetched series was not incremented.
require.Equal(t, zeroSeriesQueries, getZeroSeriesQueriesTotal())
Expand All @@ -752,8 +752,8 @@ func TestRulerMetricsForInvalidQueriesAndNoFetchedSeries(t *testing.T) {
const expression4 = `sum(metric{foo=~"1|2"}) + vector(1.2345)`
addNewRuleAndWait(groupName4, expression4, false)

// Ensure that samples were not returned.
require.Less(t, 0, getLastEvalSamples())
// Ensure that samples were returned.
require.Positive(t, getLastEvalSamples())

// Ensure that the metric for no fetched series was not incremented.
require.Equal(t, zeroSeriesQueries, getZeroSeriesQueriesTotal())
Expand All @@ -769,7 +769,7 @@ func TestRulerMetricsForInvalidQueriesAndNoFetchedSeries(t *testing.T) {
require.Zero(t, getLastEvalSamples())

// Ensure that the metric for no fetched series was incremented.
require.Less(t, zeroSeriesQueries, getZeroSeriesQueriesTotal())
require.Greater(t, getZeroSeriesQueriesTotal(), zeroSeriesQueries)

deleteRuleAndWait(groupName5)
zeroSeriesQueries = getZeroSeriesQueriesTotal()
Expand All @@ -782,7 +782,7 @@ func TestRulerMetricsForInvalidQueriesAndNoFetchedSeries(t *testing.T) {
require.Zero(t, getLastEvalSamples())

// Ensure that the metric for no fetched series was incremented.
require.Less(t, zeroSeriesQueries, getZeroSeriesQueriesTotal())
require.Greater(t, getZeroSeriesQueriesTotal(), zeroSeriesQueries)
})

// Now let's stop ingester, and recheck metrics. This should increase cortex_ruler_queries_failed_total failures.
Expand Down
Loading