Skip to content

E2e spec type - #12

Closed
RaihanSultana wants to merge 23 commits into
arxdsilva:mainfrom
RaihanSultana:e2e-spec-type
Closed

E2e spec type#12
RaihanSultana wants to merge 23 commits into
arxdsilva:mainfrom
RaihanSultana:e2e-spec-type

Conversation

@RaihanSultana

@RaihanSultana RaihanSultana commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

resolved pr comments:

  1. refactored spec type normalization
  2. updated frontend
  3. updated migration file check

Summary by CodeRabbit

  • New Features
    • Added spec type filtering capabilities to E2E runs and heatmap views, allowing users to filter by spec type (setup, happyPath, negativePath)
    • Added spec type column to the failed specs results table for improved visibility and reporting
    • Fixed E2E pass-rate calculation to correctly display 100% instead of ∞% when there are zero failed test runs

@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 43fce33b-ad5d-4775-b8f0-a0fe690dbb73

📥 Commits

Reviewing files that changed from the base of the PR and between ff76824 and c5bf43f.

📒 Files selected for processing (13)
  • cmd/coveragecli/main.go
  • cmd/frontend/web/assets/e2e.js
  • cmd/frontend/web/e2eTest.html
  • internal/adapters/http/handlers.go
  • internal/adapters/postgres/e2e_spec_result_repository.go
  • internal/adapters/postgres/e2e_test_run_repository.go
  • internal/application/e2e_usecase.go
  • internal/application/e2e_usecase_test.go
  • internal/application/integration_usecase.go
  • internal/application/mock_application.go
  • internal/application/ports.go
  • internal/domain/e2e.go
  • migrations/004_add_spec_type.sql

📝 Walkthrough

Walkthrough

Adds a specType classification (happyPath, negativePath, setup) across the full E2E stack: a DB migration adds a constrained spec_type column to e2e_test_spec_results, the domain model and application DTOs gain SpecType fields with allowlist validation, repositories persist and filter by spec type, HTTP handlers forward the new query parameter, the Playwright CLI normalizer derives specType from file names, and the frontend adds spec type filter dropdowns and a new table column.

Changes

specType end-to-end feature

Layer / File(s) Summary
DB migration and domain model extension
migrations/004_add_spec_type.sql, internal/domain/e2e.go
Adds spec_type TEXT column with CHECK constraint and composite index to e2e_test_spec_results; extends E2ESpecResult struct with SpecType string.
Application contracts: DTOs, interface, and allowlist
internal/application/e2e_usecase.go, internal/application/integration_usecase.go, internal/application/ports.go
Adds SpecType to IngestSpecReport, ListE2ERunsInput, E2EHeatmapInput, and FailedSpecResponse; introduces validSpecTypes allowlist; updates E2ETestRunRepository interface signatures.
Application use case: validation and propagation
internal/application/e2e_usecase.go, internal/application/mock_application.go
Validates specType on ingest, list, and heatmap inputs; propagates SpecType through entity building and failed-spec response mapping; updates stubs for new interface.
Postgres repository: persistence and filtering
internal/adapters/postgres/e2e_spec_result_repository.go, internal/adapters/postgres/e2e_test_run_repository.go
Adds spec_type to INSERT/SELECT/scan in spec result repository; adds specType parameter with conditional EXISTS subquery to ListByProject and HeatmapData in run repository.
HTTP handler wiring
internal/adapters/http/handlers.go
ListE2ERuns and GetE2EHeatmap handlers read the specType query parameter and pass it to use case inputs.
Playwright CLI specType classification
cmd/coveragecli/main.go
normalizePlaywrightReport derives specType from suite file name inspection with projectId fallback, and emits suite_type and specType in normalized spec output.
Frontend filter UI and table column
cmd/frontend/web/e2eTest.html, cmd/frontend/web/assets/e2e.js
Adds e2eSpecTypeFilter and heatmapSpecTypeFilter dropdowns; wires change handlers; propagates specType to backend requests; adds Spec Type column to failed-specs table; fixes zero-failure pass-rate display; updates colspan values.
Application use case tests
internal/application/e2e_usecase_test.go
Adds SpecType to existing test fixtures; adds subtests for entity propagation, validation of invalid/allowed values, list-runs invalid specType error, and heatmap input.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • arxdsilva/opencoverage#10: Established normalizePlaywrightReport and the E2E heatmap/run ingestion flows that this PR directly extends with specType classification and filtering.

Suggested reviewers

  • arxdsilva

🐇 A new field hops into the struct today,
specType now labels each spec's way—
happyPath, setup, or negativePath declared,
The filter dropdown is lovingly prepared.
The database CHECK keeps the values in line,
And 100% pass rate at last looks fine! ✨

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants