test: Add integration test for non-Prometheus panel query extraction#586
Draft
nullren wants to merge 1 commit intografana:mainfrom
Draft
test: Add integration test for non-Prometheus panel query extraction#586nullren wants to merge 1 commit intografana:mainfrom
nullren wants to merge 1 commit intografana:mainfrom
Conversation
Adds a test that creates a dashboard with CloudWatch, Elasticsearch, and Prometheus panels, then validates that GetDashboardPanelQueriesTool returns queries for all three. Currently, only Prometheus panels are returned because the extraction logic only checks for the 'expr' field. This test documents the bug described in grafana#585. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Collaborator
|
I think #539 might already kind of address this, although the test is certainly helpful. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GetDashboardPanelQueriesToolreturns queries for all three datasource typesexprfield (Prometheus/Loki), silently dropping panels using other datasource typesRelated
Test plan
go test -tags integration ./tools/ -run TestGetDashboardPanelQueries_NonPrometheusDatasourcesagainst a local Grafana instance🤖 Generated with Claude Code
Note
Low Risk
Test-only change gated behind the
integrationbuild tag; no production logic is modified (main risk is adding a failing CI test if integration tests are run).Overview
Adds a new
integration-tagged test (TestGetDashboardPanelQueries_NonPrometheusDatasources) that provisions a dashboard containing CloudWatch, Elasticsearch, and Prometheus panels, then assertsGetDashboardPanelQueriesToolreturns queries for all datasource types.The test currently documents the known bug that non-Prometheus panels are silently omitted (extraction only checks
targets[].expr), so it will fail until the underlying query-extraction logic is expanded.Written by Cursor Bugbot for commit b384a10. This will update automatically on new commits. Configure here.