-
Notifications
You must be signed in to change notification settings - Fork 713
test: add test cases for various filter operators in dashboard #8918
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
|
Failed to generate code suggestions for PR |
|
| Status | Total | Passed | Failed | Skipped | Flaky | Pass Rate | Duration |
|---|---|---|---|---|---|---|---|
| All tests passed | 367 | 343 | 0 | 19 | 5 | 93% | 4m 38s |
|
Failed to generate code suggestions for PR |
|
| Status | Total | Passed | Failed | Skipped | Flaky | Pass Rate | Duration |
|---|---|---|---|---|---|---|---|
| All tests passed | 367 | 343 | 0 | 19 | 5 | 93% | 4m 38s |
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
Greptile Summary
This PR adds test coverage for the Contains operator in dashboard filters and enhances the test_summary.py test to be more robust.
Key changes:
- Added new Playwright test verifying that the Contains operator correctly generates
str_match()SQL queries when applied to dashboard filters with variables - Enhanced
test_summaryfunction to support fallback frombase_url_sctobase_urlwhen super cluster URL is unavailable - Fixed dashboard ID extraction logic to handle both v5 and v6 dashboard schema versions
- Fixed indentation issues where cleanup code (function, dashboard, stream deletion) was incorrectly nested inside the alert deletion loop
Notes:
- The test additions are comprehensive and follow existing test patterns
- The dashboard schema version handling (v5/v6) improves test robustness against API changes
Confidence Score: 4/5
- This PR is safe to merge with minimal risk
- The changes add test coverage and improve test robustness. The new Contains operator test is comprehensive and follows existing patterns. The test_summary.py changes fix real issues (indentation/scoping problems) and add proper fallback handling. Only minor style improvement suggested (using logging instead of print statements).
- No files require special attention
Important Files Changed
File Analysis
| Filename | Score | Overview |
|---|---|---|
| tests/api-testing/tests/test_summary.py | 4/5 | Enhanced test to support base_url fallback and handle both v5/v6 dashboard schemas; refactored indentation and fixed deletion logic scoping |
| tests/ui-testing/playwright-tests/dashboards/dashboard-filter.spec.js | 5/5 | Added new test validating Contains operator generates correct str_match() SQL query for dashboard filters with variables |
Sequence Diagram
sequenceDiagram
participant Test as Test Suite
participant Browser as Playwright Browser
participant Dashboard as Dashboard UI
participant Filter as Filter Component
participant Query as Query Inspector
participant API as Backend API
Note over Test,API: New Contains Operator Test Flow
Test->>Browser: Navigate to dashboards
Browser->>Dashboard: Load dashboard page
Test->>Dashboard: Create new dashboard
Test->>Dashboard: Open dashboard settings
Test->>Dashboard: Add variable (variablename)
Test->>Dashboard: Add panel with e2e_automate stream
Test->>Dashboard: Select variable value (ziox)
Test->>Filter: Add filter field (kubernetes_container_name)
Test->>Filter: Add filter condition (Contains, $variablename)
Filter->>API: Apply filter with Contains operator
API-->>Dashboard: Return filtered data
Test->>Query: Open query inspector
Query-->>Test: Display SQL query
Test->>Test: Verify str_match() function in SQL
Note over Test: Assert: WHERE str_match(kubernetes_container_name, 'ziox')
Test->>Dashboard: Save panel
Test->>Dashboard: Delete dashboard
2 files reviewed, 1 comment
| url_sc = base_url_sc | ||
| # Use base_url_sc if available, otherwise fall back to base_url | ||
| url_sc = base_url_sc if base_url_sc is not None else base_url | ||
| print("URL for super cluster:", url_sc) |
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.
style: multiple print statements throughout this test; use logging framework instead for better control over test output
Context Used: Context from dashboard - Use a logging framework instead of print statements for debugging in tests to allow better control o... (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: tests/api-testing/tests/test_summary.py
Line: 346:346
Comment:
**style:** multiple print statements throughout this test; use logging framework instead for better control over test output
**Context Used:** Context from `dashboard` - Use a logging framework instead of print statements for debugging in tests to allow better control o... ([source](https://app.greptile.com/review/custom-context?memory=befcce0d-3612-43a4-bad9-e9446a1b7237))
How can I resolve this? If you propose a fix, please make it concise.
|
| Status | Total | Passed | Failed | Skipped | Flaky | Pass Rate | Duration |
|---|---|---|---|---|---|---|---|
| 1 test failed | 247 | 227 | 1 | 17 | 2 | 92% | 3m 45s |
Test Failure Analysis
- dashboard-streaming.spec.js: Timeout issues while interacting with UI elements
- dashboard streaming testcases should verify the custom value search from variable dropdown with streaming enabled: Locator timeout waiting for button[data-test="dashboard-add-custom-value-btn"] to be clickable.
Root Cause Analysis
- The changes in dashboard-variables.js introduced a new parameter, which may have affected the timing of UI interactions.
Recommended Actions
- Increase the timeout duration for the locator in dashboard-variables.js to ensure the button is clickable. 2. Verify the visibility of the button before attempting to click it in the addDashboardVariable method. 3. Add explicit waits or checks to ensure the UI is fully loaded before executing the click action.
Test Run FailedAuthor: Testdino Test Results
Test Failure Analysis
Root Cause Analysis
Recommended Actions
|
|
| Status | Total | Passed | Failed | Skipped | Flaky | Pass Rate | Duration |
|---|---|---|---|---|---|---|---|
| All tests passed | 371 | 349 | 0 | 19 | 3 | 94% | 4m 39s |
ca2e24c to
b661d99
Compare
|
| Status | Total | Passed | Failed | Skipped | Flaky | Pass Rate | Duration |
|---|---|---|---|---|---|---|---|
| All tests passed | 371 | 349 | 0 | 19 | 3 | 94% | 4m 40s |
b661d99 to
22e6115
Compare
|
| Status | Total | Passed | Failed | Skipped | Flaky | Pass Rate | Duration |
|---|---|---|---|---|---|---|---|
| All tests passed | 371 | 346 | 0 | 19 | 6 | 93% | 5m 41s |
|
| Status | Total | Passed | Failed | Skipped | Flaky | Pass Rate | Duration |
|---|---|---|---|---|---|---|---|
| All tests passed | 377 | 348 | 0 | 19 | 10 | 92% | 5m 43s |
d3fb839 to
32c256a
Compare
|
| Status | Total | Passed | Failed | Skipped | Flaky | Pass Rate | Duration |
|---|---|---|---|---|---|---|---|
| All tests passed | 377 | 350 | 0 | 19 | 8 | 93% | 5m 42s |
|
| Status | Total | Passed | Failed | Skipped | Flaky | Pass Rate | Duration |
|---|---|---|---|---|---|---|---|
| All tests passed | 376 | 350 | 0 | 19 | 7 | 93% | 5m 41s |
…ashboard ID extraction logic
…ameters for improved functionality
83acdf4 to
81b73f7
Compare
|
| Status | Total | Passed | Failed | Skipped | Flaky | Pass Rate | Duration |
|---|---|---|---|---|---|---|---|
| All tests passed | 376 | 348 | 0 | 19 | 9 | 93% | 5m 40s |
No description provided.