Skip to content

Commit

Permalink
try to get coverage upload working
Browse files Browse the repository at this point in the history
foo
  • Loading branch information
mpw5 committed Jul 27, 2023
1 parent 5c969d0 commit 90d495b
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,11 @@ commands:
steps:
- *attach-tmp-workspace
- precompile-assets

# For a rerun that succeeds, restore the coverage files from the failed run
- restore_cache:
key: coverage-{{.Revision}}-{{.Environment.CIRCLE_NODE_INDEX}}

- run:
name: Run rspec tests
command: |
Expand All @@ -198,6 +203,13 @@ commands:
circleci tests glob "spec/**/*_spec.rb" | circleci tests run --command="xargs bundle exec rspec --format progress --format RspecJunitFormatter -o /tmp/test-results/rspec/rspec.xml" --split-by=timings --timings-type=filename
tmp/cc-test-reporter format-coverage -t simplecov -o "tmp/coverage/codeclimate.$CIRCLE_NODE_INDEX.json"
# Save the coverage for rerunning failed tests. CircleCI will skip saving if this revision key has already been saved.
- save_cache:
key: coverage-{{.Revision}}-{{.Environment.CIRCLE_NODE_INDEX}}
paths:
- tmp/coverage/codeclimate.$CIRCLE_NODE_INDEX.json
when: always
- persist_to_workspace:
root: tmp
paths:
Expand Down Expand Up @@ -417,13 +429,13 @@ jobs:
parallelism: 6
steps:
- checkout
- run:
name: Halt if no tests to run
command: |
mkdir -p ./tmp && \
>./tmp/tests.txt && \
circleci tests glob "spec/**/*_spec.rb" | circleci tests run --command ">./tmp/tests.txt xargs echo" --split-by=timings
[ -s tmp/tests.txt ] || circleci-agent step halt
# - run:
# name: Halt if no tests to run
# command: |
# mkdir -p ./tmp && \
# >./tmp/tests.txt && \
# circleci tests glob "spec/**/*_spec.rb" | circleci tests run --command ">./tmp/tests.txt xargs echo" --split-by=timings
# [ -s tmp/tests.txt ] || circleci-agent step halt
- build-base
- *wait-for-db
- *load-db
Expand Down Expand Up @@ -460,7 +472,7 @@ jobs:
- run:
name: Upload coverage results to Code Climate
command: |
tmp/cc-test-reporter sum-coverage --output - --parts 6 tmp/coverage/codeclimate.*.json | tmp/cc-test-reporter upload-coverage --input -
tmp/cc-test-reporter sum-coverage --output - --parts 6 tmp/coverage/codeclimate.*.json | tmp/cc-test-reporter upload-coverage --debug --input -
build-app-container:
executor: cloud-platform-executor
Expand Down

0 comments on commit 90d495b

Please sign in to comment.