Add E2E frontend test mapping merge with Jest mappings

What does this MR do and why?

Adds E2E frontend test mapping merge functionality to combine E2E test mappings with Jest test mappings for multi-category coverage attribution.

When E2E tests run with Istanbul coverage enabled, they generate js-coverage-by-example-*.json files that map test locations to the source files they cover. This MR:

  1. Collects E2E test mapping files from the child pipeline
  2. Merges them with existing Jest test mappings
  3. Exports the combined mapping to ClickHouse

This enables coverage attribution for frontend files to show both Jest and E2E test coverage, supporting the multi-category feature ownership initiative.

Changes

New files

File Description
scripts/frontend/merge_e2e_frontend_test_mapping.js Merges E2E mappings (test -> sources) with Jest mappings (source -> tests) into Crystalball format
spec/frontend/scripts/frontend/merge_e2e_frontend_test_mapping.spec.js Unit tests for the merge script

CI changes

File Change
.gitlab/ci/qa-common/main.gitlab-ci.yml Collect js-coverage-by-example-*.json files from E2E runs
.gitlab/ci/coverage.gitlab-ci.yml Run merge script and use merged mapping for export

How does the merge work?

  1. E2E mappings are in test -> sources format and get inverted to source -> tests
  2. Inverted mappings are converted to Crystalball nested format
  3. Jest mappings (already in Crystalball format) are deep-merged with E2E mappings
  4. Combined mapping is saved to jest-test-mapping/merged-source-to-test.json

Related: gitlab-org/quality/analytics/team#338 (closed)

References

Screenshots or screen recordings

Before After

How to set up and validate locally

I created a test branch (!214758 (closed)) to test the implementation to ensure the merge script works as expected. This pipeline ran the script successfully as can be seen in the test-coverage:export-jest-and-e2e job (line 3258). Also the low coverage in that job is because, in the interest of time, I didn't have it run the full jest test suite to get more coverage data.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Richard Chong

Merge request reports

Loading