Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot unmarshal object into Go struct field resultSet.coverage #609

Closed
msxavi opened this issue Sep 25, 2022 · 1 comment
Closed

Cannot unmarshal object into Go struct field resultSet.coverage #609

msxavi opened this issue Sep 25, 2022 · 1 comment
Assignees
Labels
bug Something isn't working need-more-info Need additional information to debug/reproduce

Comments

@msxavi
Copy link

msxavi commented Sep 25, 2022

Describe the bug

Hello there, I am not quite sure what I am missing here. I'm running my tests with RSpec inside a container. Can you please help out? I tried many different things already.

    - name: Run tests
      run: docker-compose run --rm -e RAILS_ENV=test web bin/rails spec
      env:
        CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}

    - name: Publish code coverage
      uses: paambaati/codeclimate-action@v3.0.0
      env:
        CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
      with:
        debug: true
        coverageLocations: ${{github.workspace}}/coverage/coverage.json:simplecov

The error I am getting:

Run paambaati/codeclimate-action@v3.0.0
/home/runner/work/p/p/cc-reporter before-build
ℹ️ 'coverageCommand' not set, so skipping building coverage report!
/home/runner/work/p/p/cc-reporter after-build --exit-code 0 --debug
time="2022-09-25T07:00:19Z" level=debug msg="about to run format-coverage" 
time="2022-09-25T07:00:19Z" level=debug msg="searching for a formatter to use" 
time="2022-09-25T07:00:19Z" level=debug msg="checking coverage.py formatter" 
time="2022-09-25T07:00:19Z" level=debug msg="checking search path coverage.xml for coverage.py formatter" 
level=debug msg="checking gcov formatter" 
level=debug msg="checking search path ./ for GCov formatter" 
time="2022-09-25T07:00:19Z" level=debug msg="checking gocov formatter" 
level=debug msg="checking search path c.out for gocov formatter" 
time="2022-09-25T07:00:19Z" level=debug msg="checking lcov-json formatter" 
time="2022-09-25T07:00:19Z" level=debug msg="checking simplecov formatter" 
level=debug msg="checking search path coverage/coverage.json for simplecov formatter" 
time="2022-09-25T07:00:19Z" level=debug msg="checking search path coverage/.resultset.json for simplecov formatter" 
time="2022-09-25T07:00:19Z" level=debug msg="found file coverage/.resultset.json for simplecov formatter" 
time="2022-09-25T07:00:19Z" level=debug msg="couldn't load committed at from ENV, trying git..." 
time="2022-09-25T07:00:19Z" level=debug msg="Analyzing simplecov json output from latest format coverage/.resultset.json" 
time="2022-09-25T07:00:19Z" level=debug msg="Analyzing simplecov json output from legacy format coverage/.resultset.json" 
Error: json: cannot unmarshal object into Go struct field resultSet.coverage of type []formatters.NullInt
Usage:
(node:5636) UnhandledPromiseRejectionWarning: Error: The process '/home/runner/work/p/p/cc-reporter' failed with exit code 255

Version of codeclimate-action you're using
v3.0.0
With simplecov gem (0.21.2)

Expected behavior

  • Send coverage to CodeClimate

Additional context

Coverage report is automatically generated by bin/rails spec. The following debug lines suggest the process found the report files:

time="2022-09-25T07:00:19Z" level=debug msg="found file coverage/.resultset.json for simplecov formatter" 
time="2022-09-25T07:00:19Z" level=debug msg="couldn't load committed at from ENV, trying git..." 
time="2022-09-25T07:00:19Z" level=debug msg="Analyzing simplecov json output from latest format coverage/.resultset.json" 
time="2022-09-25T07:00:19Z" level=debug msg="Analyzing simplecov json output from legacy format coverage/.resultset.json" 
@msxavi msxavi added the bug Something isn't working label Sep 25, 2022
@paambaati paambaati added the need-more-info Need additional information to debug/reproduce label Sep 26, 2022
@msxavi
Copy link
Author

msxavi commented Sep 29, 2022

This is an issue between simplecov 0.18+ and codeclimate test reporter. codeclimate/test-reporter#495

@msxavi msxavi closed this as completed Sep 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working need-more-info Need additional information to debug/reproduce
Projects
None yet
Development

No branches or pull requests

2 participants