Write a SQL query to identify the longest streak of passing test runs for each test case.
Runs are ordered chronologically by run_at, with run_id breaking timestamp ties. A run is passing only when status = 'PASS'; failed, skipped, and NULL statuses break a streak.
test_case_id, test_case_name, longest_passing_streak, streak_start_run_id, and streak_end_run_id.test_case_id. If streaks tie, report the earliest streak.| Column | Type | Description |
|---|---|---|
| test_case_idPK | VARCHAR(20) | Unique test case identifier |
| test_case_name | VARCHAR(100) | Human-readable test case name |
| Column | Type | Description |
|---|---|---|
| run_idPK | INT | Unique test run identifier |
| test_case_id | VARCHAR(20) | Test case executed by the run |
| run_at | TIMESTAMP | Timestamp when the run completed |
| status | VARCHAR(20) | Run outcome, such as PASS, FAIL, or SKIPPED |