-
Notifications
You must be signed in to change notification settings - Fork 28
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
Plugin E2E: Add support for testing alert query #779
Conversation
08adcd0
to
269f36d
Compare
209773f
to
e8bb71d
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.
I think this looks great!
I think the flows are a bit different if you are defining the alert rules as Grafana managed
and Datasource managed
alert rules. But I guess it should be enough to test the datasource via the Grafana managed
flow.
@josmperez do you want to have a look at the docs? |
ec4c5fa
to
da5fef6
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.
ignore approval (added it to wrong PR). i will review soon.
@josmperez can you take a look at the docs? |
docusaurus/docs/e2e-test-a-plugin/test-a-data-source-plugin/alert-queries.md
Outdated
Show resolved
Hide resolved
docusaurus/docs/e2e-test-a-plugin/test-a-data-source-plugin/alert-queries.md
Outdated
Show resolved
Hide resolved
docusaurus/docs/e2e-test-a-plugin/test-a-data-source-plugin/alert-queries.md
Outdated
Show resolved
Hide resolved
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.
Nice work. LGTM.
…ert-queries.md Co-authored-by: Joseph Perez <[email protected]>
…ert-queries.md Co-authored-by: Joseph Perez <[email protected]>
…ert-queries.md Co-authored-by: Joseph Perez <[email protected]>
44e1f90
to
f0c0540
Compare
🚀 PR was released in |
What this PR does / why we need it:
This PR makes it possible to write e2e tests that verifies that a backend data source plugin can return data frames in a format that is compatible with alerting.
The process for testing alerting compatibility is as follows:
alertRuleEditPage
fixture to open a new, empty alert rule edit page OR use thegotoAlertRuleEditPage
fixture to open an already existing alert rule.Preview
button to evaluate the alert query. If successful, the data source is compatible with alerting.This
AlertRuleEditPage
model follows the same pattern as all the other page models - it can be instantiated with or without an id. As mentioned above, it's exposed throughalertRuleEditPage
fixture (new alert rules) andgotoAlertRuleEditPage
fixture (existing alert rules). I've also added areadProvisionedAlertRule
that makes it possible to read a provisioned alert rule.In practice, I think this will be useful to check for regressions in backend data source plugins. In the past, it has happened that changes to the backend code and how the data frames are being constructed leads to breakages in alerting. Running e2e tests that checks for breakages should be able to catch these regressions.
Which issue(s) this PR fixes:
Part of #796
Will follow up with a docs PR later.
📦 Published PR as canary version:
Canary Versions
✨ Test out this PR locally via: