Skip to content

Support appium junit - #13

Closed
RaihanSultana wants to merge 24 commits into
arxdsilva:mainfrom
RaihanSultana:support-appium-junit
Closed

Support appium junit#13
RaihanSultana wants to merge 24 commits into
arxdsilva:mainfrom
RaihanSultana:support-appium-junit

Conversation

@RaihanSultana

@RaihanSultana RaihanSultana commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Added normalization tool to support appium junit report

Summary by CodeRabbit

  • New Features

    • Added support for classifying E2E specs by type and showing that type in the UI.
    • E2E runs and heatmap views can now be filtered by spec type.
  • Bug Fixes

    • Improved pass-rate display so runs with no failures now show 100% instead of ∞%.
    • Failed-spec details now include the spec type for easier troubleshooting.
  • Tests

    • Added coverage for Appium-style XML report handling and spec-type validation.

@coderabbitai

coderabbitai Bot commented Jun 24, 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: cb2b07d8-97d6-4153-a209-d882a014f7cc

📥 Commits

Reviewing files that changed from the base of the PR and between 53429ef and 620a3f7.

📒 Files selected for processing (15)
  • cmd/coveragecli/main.go
  • cmd/coveragecli/main_test.go
  • cmd/coveragecli/testdata/appium-junit-report.xml
  • 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 dimension (setup, happyPath, negativePath) end-to-end: a DB migration adds the column with constraints and an index, the domain model gains the field, application use cases validate and propagate it, repository queries gain EXISTS subquery filters, HTTP handlers forward the query parameter, the CLI gains JUnit XML ingestion support with Appium normalization, and the frontend adds spec-type filter dropdowns and a table column.

Changes

specType E2E Filtering

Layer / File(s) Summary
DB migration and domain model
migrations/004_add_spec_type.sql, internal/domain/e2e.go
Adds spec_type column to e2e_test_spec_results with NOT NULL, a CHECK constraint, and a composite index on (e2e_run_id, spec_type); adds SpecType string to E2ESpecResult.
Application contracts and ports
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 method signatures for ListByProject and HeatmapData.
Application use case logic and tests
internal/application/e2e_usecase.go, internal/application/mock_application.go, internal/application/e2e_usecase_test.go
Propagates SpecType through buildE2EEntities, validateE2EIngestInput, failedE2ESpecsFromResults, ListE2ERunsUseCase.Execute, and GetE2EHeatmapUseCase.Execute; adjusts mock stubs; adds subtests for specType validation, entity building, listing, and heatmap filtering.
PostgreSQL repository filtering
internal/adapters/postgres/e2e_spec_result_repository.go, internal/adapters/postgres/e2e_test_run_repository.go
Extends INSERT/SELECT/Scan in spec result repository to include spec_type; adds EXISTS subquery predicates for specType in ListByProject and HeatmapData.
HTTP handler wiring
internal/adapters/http/handlers.go
Reads specType query parameter in ListE2ERuns and GetE2EHeatmap handlers and sets SpecType on the respective application input structs.
CLI JUnit XML support and specType normalization
cmd/coveragecli/main.go, cmd/coveragecli/main_test.go, cmd/coveragecli/testdata/appium-junit-report.xml
Adds JUnitTestSuites/JUnitTestSuite/JUnitTestCase XML struct models; detects .xml vs .json from file extension; routes to normalizePlaywrightJUnit (stub) or normalizeAppiumJUnit (full implementation) for XML; extends normalizePlaywrightReport to classify specType from filename or projectId; adds Appium XML fixture and TestNormalizeAppiumJUnit.
Frontend specType filter UI and table column
cmd/frontend/web/e2eTest.html, cmd/frontend/web/assets/e2e.js
Adds e2eSpecTypeFilter and heatmapSpecTypeFilter dropdowns; wires change event listeners; includes specType in API query parameters; adds a "Spec Type" column to the failed specs table; updates all colspan values; changes ∞% to 100% when there are no failed runs.

Sequence Diagram(s)

sequenceDiagram
  participant Browser as Browser (e2eTest.html + e2e.js)
  participant HTTPHandler as HTTP Handler (handlers.go)
  participant UseCase as ListE2ERunsUseCase / GetE2EHeatmapUseCase
  participant Repo as E2ETestRunRepository (postgres)
  participant DB as PostgreSQL

  Browser->>HTTPHandler: GET /e2e-test-runs?specType=happyPath
  HTTPHandler->>UseCase: Execute(ListE2ERunsInput{SpecType: "happyPath"})
  UseCase->>UseCase: validate specType against validSpecTypes
  UseCase->>Repo: ListByProject(..., specType="happyPath", ...)
  Repo->>DB: SELECT ... WHERE EXISTS (SELECT 1 FROM e2e_test_spec_results WHERE spec_type=$N)
  DB-->>Repo: filtered runs
  Repo-->>UseCase: []E2ETestRun
  UseCase-->>HTTPHandler: runs + failed specs with SpecType
  HTTPHandler-->>Browser: JSON response
  Browser->>Browser: render Spec Type column in failed specs table
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • arxdsilva/opencoverage#10: Adds the core E2E test screen, endpoints, and ingestion flow that this PR extends with specType filtering across the same frontend, HTTP, and CLI upload paths.
  • arxdsilva/opencoverage#11: Directly overlaps with this PR, implementing the same specType field end-to-end from ingest through ListE2ERuns/heatmap APIs, repository SQL, and frontend filters/table at the same function/query/field level.

Suggested reviewers

  • arxdsilva

Poem

🐇 A rabbit hops through every layer neat,
From SQL columns to the heatmap beat.
happyPath, negativePath, or setup too —
Each spec now wears a label, bright and true.
JUnit XML? No problem, parsed with glee!
The spec type filter sets the data free. 🌟

✨ 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.

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