-
Notifications
You must be signed in to change notification settings - Fork 711
test: add test cases for visualization using "Select *" queries #8589
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
Conversation
PR Reviewer Guide 🔍(Review updated until commit eef523e)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to eef523e
Previous suggestionsSuggestions up to commit 928bf96
|
928bf96 to
eef523e
Compare
|
Persistent review updated to latest commit eef523e |
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.
Greptile Overview
Summary
This PR adds a comprehensive end-to-end test for SELECT * query visualization functionality. The test validates that SELECT * queries default to line chart visualization, can be successfully saved to dashboards, and that the query inspector shows the correct transformed aggregation query.
Key test coverage includes:
- Running SELECT * query and verifying line chart is selected as default visualization
- Adding the visualization panel to a new dashboard with proper success confirmation
- Opening query inspector and asserting the transformed query shows histogram aggregation with proper aliases
- Clean dashboard cleanup to avoid test pollution
The test follows the existing pattern used in the test suite and maintains proper test isolation with dynamic dashboard/panel names and cleanup procedures.
Confidence Score: 4/5
- This PR is safe to merge with minimal risk as it only adds test coverage without modifying production code
- Score reflects well-structured test code that follows existing patterns, proper cleanup procedures, and comprehensive coverage of the SELECT * visualization flow. Minor deduction due to some hardcoded values and potential timing dependencies
- No files require special attention - the single test file follows established patterns and includes proper cleanup
Important Files Changed
File Analysis
| Filename | Score | Overview |
|---|---|---|
| tests/ui-testing/playwright-tests/dashboards/visualize.spec.js | 4/5 | Added comprehensive e2e test for SELECT * query visualization, verifying line chart rendering, dashboard saving, and query transformation inspection |
Sequence Diagram
sequenceDiagram
participant Test as Playwright Test
participant Page as Browser Page
participant PM as PageManager
participant LogsUI as Logs UI
participant VizUI as Visualization UI
participant Dashboard as Dashboard
participant Inspector as Query Inspector
Test->>PM: Initialize PageManager
Test->>PM: openLogs()
PM->>LogsUI: Navigate to logs page
Test->>PM: fillLogsQueryEditor("SELECT * FROM e2e_automate")
PM->>LogsUI: Fill query editor with SELECT * query
Test->>PM: setRelative("6", "w")
PM->>LogsUI: Set time range to 6 weeks
Test->>PM: logsApplyQueryButton()
PM->>LogsUI: Execute SELECT * query
Test->>PM: openVisualiseTab()
PM->>VizUI: Switch to visualization tab
Test->>PM: verifyChartRenders(page)
PM->>VizUI: Verify chart renders successfully
Test->>PM: verifyChartTypeSelected("line", true)
PM->>VizUI: Verify line chart is selected as default
Test->>PM: runQueryAndWaitForCompletion()
PM->>VizUI: Wait for query execution completion
Test->>PM: addPanelToNewDashboard(randomDashboardName, panelName)
PM->>Dashboard: Create new dashboard and add panel
Dashboard-->>Test: "Panel added to dashboard" success message
Test->>Page: Click panel dropdown menu
Test->>Page: Click Query Inspector option
PM->>Inspector: Open query inspector
Test->>Page: Assert transformed aggregation query
Inspector-->>Test: Show "SELECT histogram(_timestamp) AS zo_sql_key, count(*) AS zo_sql_num..."
Test->>Page: Close query inspector
Test->>Page: Navigate back to dashboard list
Test->>PM: deleteDashboard(randomDashboardName)
PM->>Dashboard: Clean up test dashboard
1 file reviewed, no comments
User description
… query
PR Type
Tests
Description
Add E2E test for SELECT * visualization
Verify default line chart selection
Validate inspector shows transformed histogram query
Save panel to dashboard and assert success
Diagram Walkthrough
File Walkthrough
visualize.spec.js
Add E2E test for SELECT * visualization and inspectortests/ui-testing/playwright-tests/dashboards/visualize.spec.js