Skip to content

Commit

Permalink
Fix examples that uses simplecov
Browse files Browse the repository at this point in the history
As I mentioned in codeclimate#495 (comment),
`cc-test-reporter format-coverage --input-type=simplecov` needs the test
to have run with `CC_TEST_REPORTER_ID` is set, otherwise it parses
a coverage file in legacy format that crashes `cc-test-reporter`.
  • Loading branch information
manicmaniac committed Apr 9, 2023
1 parent 22de46a commit 894dcd0
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions examples/multiple_suites.md
Original file line number Diff line number Diff line change
@@ -54,6 +54,9 @@ jobs:
command: |
bundle exec rake
./tmp/cc-test-reporter format-coverage -t simplecov -o tmp/codeclimate.backend.json coverage/backend/.resultset.json
environment:
# Note that to make simplecov output in appropriate format, `CC_TEST_REPORTER_ID` environment variable should be set before testing
- CC_TEST_REPORTER_ID: 1acf55093f33b525eefdd9fb1e601d748e5d8b1267729176605edb4b5d82dc3d
- persist_to_workspace:
root: tmp
paths:
5 changes: 5 additions & 0 deletions examples/ruby_examples.md
Original file line number Diff line number Diff line change
@@ -37,6 +37,7 @@ before_script:
- ./cc-test-reporter before-build
script:
# Note that to make simplecov output in appropriate format, `CC_TEST_REPORTER_ID` environment variable should be set before testing

This comment has been minimized.

Copy link
@manicmaniac

manicmaniac Apr 9, 2023

Author Owner

In L52, it sets CC_TEST_REPORTER_ID globally.

- bundle exec rake $TASKS
after_script:
@@ -100,6 +101,7 @@ before_script: bundle exec rake db:create db:migrate
# Run the test suites
script:
- bundle exec rubocop -DESP # Backend linting
# Note that to make simplecov output in appropriate format, `CC_TEST_REPORTER_ID` environment variable should be set before testing
- bundle exec rake # Backend specs
#- npm test -- --browsers Firefox # Frontend specs
- npm test # Frontend linting & specs
@@ -204,6 +206,9 @@ jobs:
--out test-results/rspec/rspec.xml \
--format progress \
-- ${TESTFILES}
environment:
# Note that to make simplecov output in appropriate format, `CC_TEST_REPORTER_ID` environment variable should be set before testing
CC_TEST_REPORTER_ID: c3ff91e23ea0fea718bb62dae0a8a5440dc082d5d2bb508af6b33d0babac479a
- run:
name: Code Climate Test Coverage
command: |

0 comments on commit 894dcd0

Please sign in to comment.