Generate spec mapping with crystalball using test coverage
Generate spec mapping with crystalball and upload the mapping to S3 with other test metadata.
This MR contains a few changes:
- Add of crystalball to rspec, using a custom
CoverageLinesStrategy
. A custom strategy is needed because ofSimpleCov
's use ofCoverage.start(lines: true)
. - Add script to parse crystalball data, which is a yaml containing a list of files covered by each rspec example, into a JSON mapping of file to a list of rspec files.
- Add script to compress JSON mapping to be stored in S3
- Modify CI
update-tests-metadata
to generate and upload JSON test mapping in scheduled pipelines.
part of #263421 (closed), #222369 (closed)
Spike Findings
-
✅ does not work out of the box withSimpleCov
as both usesCoverage
. Throws error as shown in https://gitlab.com/gitlab-org/gitlab/-/jobs/787324441. This is due toSimpleCov
usingCoverage.start(lines: true)
andCrystalball
usingCoverage.start
. We'd need to customize Crystalball strategy withCoverage.start(lines: true)
- This is solved by overriding the strategy and detector to use
Coverage.start(lines: true)
- This is solved by overriding the strategy and detector to use
Edited by Albert Salim