-
Notifications
You must be signed in to change notification settings - Fork 43
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
Add ServiceMonitor and E2E tests for Prometheus #286
Conversation
4402400
to
bf53528
Compare
054898b
to
8c7102c
Compare
8c7102c
to
c7941b3
Compare
dfce1c8
to
a3709e1
Compare
dbf2d6d
to
0cc57f6
Compare
Changes applied, thank you! |
0cc57f6
to
77e2076
Compare
/retest |
1 similar comment
/retest |
9556f85
to
fb7beba
Compare
tests/validator_test.go
Outdated
@@ -895,6 +908,22 @@ func eventuallyFailToCreateVm(vm *kubevirtv1.VirtualMachine) bool { | |||
}, shortTimeout).Should(Equal(metav1.StatusReasonInvalid), "Should have given the invalid error") | |||
} | |||
|
|||
func failVmCreationToIncreaseRejectedVmsMetrics() { | |||
rejectedCountBefore := totalRejectedVmsMetricsValue() | |||
template := TemplateWithRules() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This template is not deleted after the test. It will be deleted once the namespace is removed, but that will not happen, if the tests are executed with existing SSP CR.
Can you add code to delete it, so the namspace is not polluted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the current code the template would not be deleted, if one of the Expect()
calls panics.
Instead, can you create the template before this function is called, and pass it as a parameter? Then it can be deleted in AfterEach()
.
a44c926
to
4e47891
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update. I have just 3 more small comments.
tests/validator_test.go
Outdated
@@ -895,6 +908,22 @@ func eventuallyFailToCreateVm(vm *kubevirtv1.VirtualMachine) bool { | |||
}, shortTimeout).Should(Equal(metav1.StatusReasonInvalid), "Should have given the invalid error") | |||
} | |||
|
|||
func failVmCreationToIncreaseRejectedVmsMetrics() { | |||
rejectedCountBefore := totalRejectedVmsMetricsValue() | |||
template := TemplateWithRules() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the current code the template would not be deleted, if one of the Expect()
calls panics.
Instead, can you create the template before this function is called, and pass it as a parameter? Then it can be deleted in AfterEach()
.
f29675b
to
fd55d0d
Compare
Add ServiceMonitor to seperate from kubevirts ServiceMonitor. Add e2e tests for all Alerts. Signed-off-by: borod108 <boris.od@gmail.com>
fd55d0d
to
6a20a3f
Compare
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
@borod108: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
The CI failure probably means that CI is not testing what we expect. There is no template with I will look into it. |
Ignore my previous comment. The CI is correct. It is not testing this PR, but a merge commit of Can you try rebasing this PR on top of |
/retest |
/lgtm |
componentAlertLabelKey = "kubernetes_operator_component" | ||
componentAlertLabelValue = "ssp-operator" | ||
PrometheusRuleName = "prometheus-k8s-rules-cnv" | ||
MonitorNamespace = "openshift-monitoring" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will it only work in OpenShift?
I think it should work for both monitoring
and openshift-monitoring
namespaces...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will only work in openshift (the operator is working with templates that only work on openshift anyway)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and it should run on okd, since it has the same namespace (https://docs.okd.io/latest/monitoring/monitoring-overview.html#default-monitoring-components_monitoring-overview)
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: akrejcir The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Add ServiceMonitor to seperate from kubevirts ServiceMonitor.
Add e2e tests for all Alerts
Signed-off-by: borod108 boris.od@gmail.com