-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #932 from assafad/monitoring-linters
Apply monitoring linters
- Loading branch information
Showing
18 changed files
with
3,115 additions
and
1 deletion.
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
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
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,40 @@ | ||
package rules | ||
|
||
import ( | ||
"testing" | ||
|
||
. "github.com/onsi/ginkgo/v2" | ||
. "github.com/onsi/gomega" | ||
|
||
"github.com/machadovilaca/operator-observability/pkg/testutil" | ||
) | ||
|
||
func TestRules(t *testing.T) { | ||
RegisterFailHandler(Fail) | ||
RunSpecs(t, "Rules Suite") | ||
} | ||
|
||
var _ = Describe("Rules Validation", func() { | ||
var linter *testutil.Linter | ||
|
||
BeforeEach(func() { | ||
Expect(SetupRules()).To(Succeed()) | ||
linter = testutil.New() | ||
}) | ||
|
||
It("Should validate alerts", func() { | ||
linter.AddCustomAlertValidations( | ||
testutil.ValidateAlertNameLength, | ||
testutil.ValidateAlertRunbookURLAnnotation, | ||
testutil.ValidateAlertHealthImpactLabel, | ||
testutil.ValidateAlertPartOfAndComponentLabels) | ||
|
||
problems := linter.LintAlerts(ListAlerts()) | ||
Expect(problems).To(BeEmpty()) | ||
}) | ||
|
||
It("Should validate recording rules", func() { | ||
problems := linter.LintRecordingRules(ListRecordingRules()) | ||
Expect(problems).To(BeEmpty()) | ||
}) | ||
}) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.