Skip to content

Conversation

@ktx-akshay
Copy link
Collaborator

No description provided.

@github-actions
Copy link
Contributor

Failed to generate code suggestions for PR

@ktx-akshay ktx-akshay force-pushed the e2e-dashboard-pytest branch from 5751323 to 704e95b Compare October 27, 2025 12:20
@ktx-akshay ktx-akshay marked this pull request as ready for review October 27, 2025 12:55
@github-actions
Copy link
Contributor

Failed to generate code suggestions for PR

Copy link
Contributor

@greptile-apps greptile-apps bot left a 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 significantly expands the dashboard test suite by adding 9 new comprehensive pytest test cases. The changes enhance test coverage for dashboard functionality including export/import, batch operations, variables, multi-tab dashboards, filtering, timed annotations, and hash-based conflict detection.

Key additions:

  • test_export_dashboard - validates dashboard export in portable format
  • test_move_multiple_dashboards_batch - tests batch moving dashboards between folders
  • test_dashboard_with_variables - verifies dashboard variable configuration (custom type, multi-select)
  • test_dashboard_with_multiple_tabs - tests multi-tab dashboard creation and retrieval
  • test_list_dashboards_by_title_pattern - validates title-based filtering
  • test_list_dashboards_by_folder - tests folder-based filtering
  • test_create_timed_annotation and test_get_timed_annotations - validates annotation lifecycle
  • test_dashboard_hash_conflict_detection - verifies hash field tracking for conflict detection
  • test_dashboard_with_panel_filters - tests complex panel-level filter configurations

The PR also includes minor improvements to existing tests:

  • Added USER_EMAIL constant extracted from environment variables
  • Improved test_dashboard_search_stream_query with better error handling and stream validation
  • Added skip logic when data streams are unavailable

Minor issues found:

  • Uses print() statements instead of logging framework (4 instances in lines 130-146)
  • Redundant import pytest statement inside a function (line 97)

Confidence Score: 4/5

  • This PR is safe to merge with minimal risk - it only adds test cases without modifying production code
  • The changes are low-risk as they only add new test cases to improve coverage of dashboard functionality. All new tests follow existing patterns, properly clean up resources, and handle edge cases. The only issues are minor style improvements (using logging instead of print statements) that don't affect functionality.
  • No files require special attention - the style improvements for print statements are optional

Important Files Changed

File Analysis

Filename Score Overview
tests/api-testing/tests/test_dashboards.py 4/5 Added 9 comprehensive pytest test cases for dashboard functionality including variables, tabs, annotations, export, and filtering - minor style improvements needed for print statements

Sequence Diagram

sequenceDiagram
    participant Test as Test Suite
    participant API as Dashboard API
    participant DB as Database
    
    Note over Test,DB: Dashboard Export Test
    Test->>API: POST /api/default/dashboards (create)
    API->>DB: Store dashboard
    DB-->>API: Dashboard created
    API-->>Test: Return dashboard_id
    Test->>API: GET /api/default/dashboards/{id}/export
    API->>DB: Fetch dashboard
    DB-->>API: Dashboard data
    API-->>Test: Exported dashboard (v5 format)
    Test->>API: DELETE /api/default/dashboards/{id}
    API->>DB: Delete dashboard
    DB-->>API: Deleted
    API-->>Test: Success
    
    Note over Test,DB: Dashboard with Variables Test
    Test->>API: POST /api/default/dashboards (with variables)
    API->>DB: Store dashboard + variables
    DB-->>API: Dashboard created
    API-->>Test: Return dashboard_id
    Test->>API: GET /api/default/dashboards/{id}
    API->>DB: Fetch dashboard
    DB-->>API: Dashboard with variables
    API-->>Test: Verify variables list
    Test->>API: DELETE /api/default/dashboards/{id}
    
    Note over Test,DB: Batch Move Dashboards Test
    Test->>API: POST /api/v2/default/folders/dashboards
    API->>DB: Create folder
    DB-->>API: folder_id
    API-->>Test: Return folder_id
    loop Create 3 dashboards
        Test->>API: POST /api/default/dashboards
        API->>DB: Store dashboard
        DB-->>API: dashboard_id
        API-->>Test: Return dashboard_id
    end
    Test->>API: PATCH /api/default/dashboards/move (batch)
    API->>DB: Update dashboard folders
    DB-->>API: Updated
    API-->>Test: Success
    loop Cleanup
        Test->>API: DELETE /api/default/dashboards/{id}
    end
    
    Note over Test,DB: Timed Annotations Test
    Test->>API: POST /api/default/dashboards (with panels)
    API->>DB: Store dashboard
    DB-->>API: dashboard_id
    API-->>Test: Return dashboard_id
    Test->>API: POST /api/default/dashboards/{id}/annotations
    API->>DB: Store annotations
    DB-->>API: Success
    API-->>Test: Annotations created
    Test->>API: GET /api/default/dashboards/{id}/annotations
    API->>DB: Fetch annotations
    DB-->>API: Annotation data
    API-->>Test: Return annotations
    Test->>API: DELETE /api/default/dashboards/{id}
Loading

Additional Comments (1)

  1. tests/api-testing/tests/test_dashboards.py, line 130-146 (link)

    style: use logging framework instead of print() for 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)

1 file reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

@ktx-akshay ktx-akshay force-pushed the e2e-dashboard-pytest branch from f8ca17d to 51674bf Compare October 28, 2025 05:33
@testdino-playwright-reporter
Copy link

⚠️ Test Run Unstable


Author: ktx-akshay | Branch: e2e-dashboard-pytest | Commit: 51674bf

Testdino Test Results

Status Total Passed Failed Skipped Flaky Pass Rate Duration
All tests passed 271 254 0 16 1 94% 3m 34s

View Detailed Results

@testdino-playwright-reporter
Copy link

Testdino Test Results

Status Total Passed Failed Skipped Flaky Pass Rate Duration
All tests passed 73 71 0 2 0 97% 4m 39s

View Detailed Results

@testdino-playwright-reporter
Copy link

Testdino Test Results

Status Total Passed Failed Skipped Flaky Pass Rate Duration
All tests passed 73 71 0 2 0 97% 4m 39s

View Detailed Results

@testdino-playwright-reporter
Copy link

Testdino Test Results

Status Total Passed Failed Skipped Flaky Pass Rate Duration
All tests passed 75 73 0 2 0 97% 4m 39s

View Detailed Results

@testdino-playwright-reporter
Copy link

⚠️ Test Run Unstable


Author: ktx-akshay | Branch: e2e-dashboard-pytest | Commit: 604d448

Testdino Test Results

Status Total Passed Failed Skipped Flaky Pass Rate Duration
All tests passed 365 343 0 19 3 94% 4m 38s

View Detailed Results

@ktx-akshay ktx-akshay force-pushed the e2e-dashboard-pytest branch from 604d448 to d65aa57 Compare October 28, 2025 08:24
@testdino-playwright-reporter
Copy link

⚠️ Test Run Unstable


Author: ktx-akshay | Branch: e2e-dashboard-pytest | Commit: d65aa57

Testdino Test Results

Status Total Passed Failed Skipped Flaky Pass Rate Duration
All tests passed 365 342 0 19 4 94% 4m 38s

View Detailed Results

@ktx-akshay ktx-akshay force-pushed the e2e-dashboard-pytest branch from d65aa57 to fc7fb59 Compare October 28, 2025 08:57
@ktx-akshay ktx-akshay force-pushed the e2e-dashboard-pytest branch from fc7fb59 to 3f7ff11 Compare October 28, 2025 09:34
@testdino-playwright-reporter
Copy link

⚠️ Test Run Unstable


Author: ktx-akshay | Branch: e2e-dashboard-pytest | Commit: 3f7ff11

Testdino Test Results

Status Total Passed Failed Skipped Flaky Pass Rate Duration
All tests passed 365 343 0 19 3 94% 7m 6s

View Detailed Results

@ktx-akshay ktx-akshay merged commit 3af7349 into main Oct 28, 2025
32 checks passed
@ktx-akshay ktx-akshay deleted the e2e-dashboard-pytest branch October 28, 2025 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants