I’m running a parallel test pass in CircleCI (RSpec, Ruby on Rails). This has been running fine, but now I want to also run a SonarCloud scan and get a coverage report (among other things). Right now I’m running SonarCloud as a part of this parallelized job:
rspec:
executor: rails
parallelism: 4
working_directory: ~/my_working_directory
steps:
- setup-project
- run:
bundle exec rspec --profile 10 \
--format RspecJunitFormatter \
--out test_results/rspec.xml \
--format progress \
$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)
# Save test results for timing analysis
- store_test_results:
path: test_results
- store_artifacts:
path: coverage
- sonarcloud/scan
And that is run as part of this workflow:
workflows:
test:
when: << pipeline.parameters.run-rails-job >> # This resolves to true in this case
jobs:
- rspec:
context: SonarCloud
- db
- rails-lint
The primary issue right now is that each of my 4 test splits get a sonarcloud scan, and their coverage reports are only based on what was run on that particular instance. They end up overwriting each other, so what I really need is a way of merging my coverage results and running only a single SonarCloud scan on the codebase with the merged results.
Anybody know of a solution to this?