feat: add per-project quality view with flakiness/failure trends#54
Draft
Copilot wants to merge 3 commits into
Draft
feat: add per-project quality view with flakiness/failure trends#54Copilot wants to merge 3 commits into
Copilot wants to merge 3 commits into
Conversation
…tic tests Agent-Logs-Url: https://github.com/PhenX/playwright-dashboard/sessions/02d248ba-bcc3-42d9-9b14-a31bd1ade33c Co-authored-by: PhenX <42170+PhenX@users.noreply.github.com>
Owner
|
@copilot update the docs, tests, demo, do it each time a new public facing feature is added or modified |
Agent-Logs-Url: https://github.com/PhenX/playwright-dashboard/sessions/44454576-890c-4e4d-8479-b7e2d7ec8efc Co-authored-by: PhenX <42170+PhenX@users.noreply.github.com>
Contributor
Author
Done in commit
|
There was a problem hiding this comment.
Pull request overview
Adds a per-project Quality view to complement the existing performance insights, including new backend endpoints for stability/flakiness analytics, a new UI page and chart component, demo-mode fixtures/mapping, API types, docs, and Playwright API tests.
Changes:
- Added two project-level API endpoints:
/quality(trend + summary) and/flaky-tests(ranked flaky/failing tests + counts). - Added new Quality page (
/projects/[id]/quality) with summary cards, trend charts, and top flaky/failing test tables, plus sidebar navigation entry. - Added API types, documentation, demo fixtures/mapping, and API test coverage for the new endpoints.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/api.md | Documents the new /quality and /flaky-tests endpoints, query params, and response shapes. |
| application/types/api.ts | Adds shared TypeScript interfaces for the new quality/flakiness API responses. |
| application/tests/quality-api.spec.ts | Adds API-level tests for quality trend/summary and flaky/failing detection + query params + 404s. |
| application/tests/demo-generate.spec.ts | Extends demo-generation assertions to include the new endpoints and fixture files. |
| application/server/api/projects/[id]/quality.get.ts | Implements quality trend + aggregate summary endpoint based on recent runs. |
| application/server/api/projects/[id]/flaky-tests.get.ts | Implements flaky/failing test aggregation across recent runs. |
| application/public/demo/api/projects/1/quality.json | Adds demo fixture response for project 1 quality trend/summary. |
| application/public/demo/api/projects/1/flaky-tests.json | Adds demo fixture response for project 1 flaky/failing tests. |
| application/public/demo/api/projects/2/quality.json | Adds demo fixture response for project 2 quality trend/summary. |
| application/public/demo/api/projects/2/flaky-tests.json | Adds demo fixture response for project 2 flaky/failing tests. |
| application/public/demo/api/projects/3/quality.json | Adds demo fixture response for project 3 quality trend/summary. |
| application/public/demo/api/projects/3/flaky-tests.json | Adds demo fixture response for project 3 flaky/failing tests. |
| application/app/plugins/demo-fetch.client.ts | Maps the new API endpoints to the new demo JSON fixtures. |
| application/app/pages/projects/[id]/quality.vue | Adds the Quality page UI (summary cards, charts, and tables). |
| application/app/layouts/default.vue | Adds “Quality” navigation item in the project sidebar menu. |
| application/app/components/QualityTrendChart.vue | Adds the chart component for flakiness/failure trend visualization. |
|
|
||
| const runIds = recentRuns.map(r => r.id) | ||
| if (runIds.length === 0) { | ||
| return [] |
Comment on lines
+102
to
+107
| // Failed | ||
| if (row.status === 'failed' || row.status === 'timedOut') { | ||
| entry.failureCount++ | ||
| if (row.error) { | ||
| entry.lastError = row.error | ||
| } |
Comment on lines
+141
to
+148
| // Count tests that never failed | ||
| const neverFailed = Array.from(testCaseMap.values()).filter(t => t.failureCount === 0 && t.flakyCount === 0).length | ||
|
|
||
| return { | ||
| flakyTests, | ||
| failingTests, | ||
| neverFailed, | ||
| totalTestCases: testCaseMap.size |
Comment on lines
+30
to
+38
| return props.data.map(point => ({ | ||
| date: new Date(point.startTime), | ||
| flakyTests: point.flakyTests, | ||
| failedTests: point.failedTests, | ||
| totalTests: point.totalTests, | ||
| failureRate: point.failureRate, | ||
| flakyRate: point.flakyRate, | ||
| status: point.status | ||
| })) |
Owner
|
@copilot apply code suggestions |
…dChart - Return consistent object shape when no runs found (instead of []) - Track lastFailureDate to ensure lastError is from the most recent failure - Fix neverFailed to only check failureCount === 0 (not also flakyCount) - Sort chartData by date in QualityTrendChart for consistent rendering
Contributor
Author
Applied all 4 suggestions in the latest commit:
|
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.
Adds a Quality page (
/projects/[id]/quality) focused on test reliability and stability metrics, complementing the existing Performance page (speed/duration).Backend
GET /api/projects/[id]/quality— Returns per-run trend data (flaky count, failure count, rates) and a stability summary (overall pass/flaky/failure rates, failure-free streak)GET /api/projects/[id]/flaky-tests— Returns top 20 flaky tests (passed after retries) and top 20 failing tests with stats, plus count of never-failing testsFrontend
QualityTrendChart.vue— Dual-mode chart component (unovis) showing either flakiness or failure trends as stacked bars + rate line overlayquality.vuepage with:i-lucide-shield-checkicon between Performance and EditTypes
QualityTrendPoint,QualitySummary,QualityData,FlakyTest,FailingTest,FlakyTestsDatainterfacesDocumentation & Tests
docs/api.md— Added full reference for both new endpoints with query parameters, response shapes, and flakiness definitiontests/quality-api.spec.ts— 10 new API tests covering trend data shape, chronological ordering, summary stats, flaky/failing test detection, query parameter handling, and 404 responsesquality.jsonandflaky-tests.jsonfor all 3 demo projects (public/demo/api/projects/{1,2,3}/) with realistic data, and updateddemo-fetch.client.tsto map the 6 new endpointsNo schema changes required — uses existing
testRuns.flakyTests,testRunsCases.retries, andtestRunsCases.statusfields.