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

test reporter broke #418

Closed
coding-bunny opened this issue Jan 28, 2020 · 24 comments
Closed

test reporter broke #418

coding-bunny opened this issue Jan 28, 2020 · 24 comments
Assignees

Comments

@coding-bunny
Copy link

I have no idea what changed, because I'm always pulling the latest version from the net, but since today my tests are failing because of a problem with the cc-test-reporter:

#!/bin/bash -eo pipefail
./cc-test-reporter before-build
bundle exec rspec \
--profile 10 \
--require rspec_junit_formatter \
--out tmp/test-results/rspec/rspec.xml \
--format progress
./cc-test-reporter format-coverage -t simplecov -o tmp/test-results/codeclimate.inkycop.json coverage/.resultset.json

........................

Top 10 slowest examples (0.04535 seconds, 56.0% of total time):
  Inkycop::InstallGenerator without arguments #create_root_codeclimate_yml excludes the coverage path
    0.00546 seconds ./spec/lib/generators/inkycop/install_generator_spec.rb:90
  Inkycop::InstallGenerator without arguments #create_root_codeclimate_yml excludes the doc path
    0.00487 seconds ./spec/lib/generators/inkycop/install_generator_spec.rb:98
  Inkycop::InstallGenerator without arguments #create_root_codeclimate_yml excludes the tmp path
    0.00481 seconds ./spec/lib/generators/inkycop/install_generator_spec.rb:114
  Inkycop::InstallGenerator without arguments #create_root_codeclimate_yml excludes the log path
    0.00471 seconds ./spec/lib/generators/inkycop/install_generator_spec.rb:102
  Inkycop::InstallGenerator without arguments #create_root_codeclimate_yml enables csslint
    0.00445 seconds ./spec/lib/generators/inkycop/install_generator_spec.rb:47
  Inkycop::InstallGenerator without arguments #create_root_codeclimate_yml excludes the script path
    0.00439 seconds ./spec/lib/generators/inkycop/install_generator_spec.rb:110
  Inkycop::InstallGenerator without arguments #create_root_codeclimate_yml targets the right rubocop version
    0.00433 seconds ./spec/lib/generators/inkycop/install_generator_spec.rb:85
  Inkycop::InstallGenerator without arguments #create_root_codeclimate_yml excludes the public path
    0.00428 seconds ./spec/lib/generators/inkycop/install_generator_spec.rb:106
  Inkycop::InstallGenerator without arguments #create_root_codeclimate_yml excludes the vendor path
    0.00417 seconds ./spec/lib/generators/inkycop/install_generator_spec.rb:118
  Inkycop::InstallGenerator without arguments #create_root_codeclimate_yml excludes the db path
    0.00389 seconds ./spec/lib/generators/inkycop/install_generator_spec.rb:94

Top 2 slowest example groups:
  Inkycop::InstallGenerator
    0.00343 seconds average (0.07881 seconds / 23 examples) ./spec/lib/generators/inkycop/install_generator_spec.rb:8
  Inkycop
    0.00093 seconds average (0.00093 seconds / 1 example) ./spec/inkycop_spec.rb:3

Finished in 0.08104 seconds (files took 0.49564 seconds to load)
24 examples, 0 failures

Coverage report generated for RSpec to /home/circleci/inkycop/coverage. 82 / 82 LOC (100.0%) covered.
Error: json: cannot unmarshal object into Go struct field input.coverage of type []formatters.NullInt
Usage:
  cc-test-reporter format-coverage [coverage file] [flags]

Flags:
      --add-prefix string   add this prefix to file paths
  -t, --input-type string   type of input source to use [clover, cobertura, coverage.py, excoveralls, gcov, gocov, jacoco, lcov, simplecov, xccov]
  -o, --output string       output path (default "coverage/codeclimate.json")
  -p, --prefix string       the root directory where the coverage analysis was performed (default "/home/circleci/inkycop")

Global Flags:
  -d, --debug   run in debug mode


Exited with code exit status 255

This was working fine on previous runs, but all of a sudden this is now broken on our circle-ci

@coding-bunny
Copy link
Author

This seems to be related to the new simplecov 0.18 release.
Will a fix be made to keep supporting this framework?

@steveh
Copy link

steveh commented Jan 28, 2020

Same issue for me - crops up with a PR to upgrade SimpleCov to 0.18.

Changelog

@steveh
Copy link

steveh commented Jan 28, 2020

oops, duplicate of #413 probably

@coding-bunny
Copy link
Author

yes, it's the 0.18 release that's causing it with the changes in the file.
The test-runner simply cannot seem to handle this and crashes completely with some parsing error.
Since this blocks all our builds at the moment on Circle that are using SimpleCov, we either need to freeze to v0.17 in the meanwhile or live with broken builds till the cc-test-runner works.

koic added a commit to koic/rubocop that referenced this issue Jan 29, 2020
This PR fixes the following build error when using
cc-test-reporter with SimpleCov 0.18.

```console
$ #!/bin/bash -eo pipefail
./tmp/cc-test-reporter before-build
COVERAGE=true bundle exec rake spec
./tmp/cc-test-reporter format-coverage --output
tmp/codeclimate.$CIRCLE_JOB.json
Starting test-queue master (/tmp/test_queue_228_47138309905180.sock)

==> Summary (2 workers in 36.1115s)

    [ 1]                         8753 examples, 0 failures, 9 pending
    254 suites in 36.1034s      (pid 160 exit 0 )
    [ 2]                         6772 examples, 0 failures, 2 pending
    239 suites in 36.1054s      (pid 161 exit 0 )

Coverage report generated for RSpec, rspec-1, rspec-2, rspec-fork-163,
rspec-fork-164, rspec-fork-165 to /home/circleci/project/coverage. 21266
/ 21459 LOC (99.1%) covered.
Error: json: cannot unmarshal object into Go struct field input.coverage
of type []formatters.NullInt
Usage:
  cc-test-reporter format-coverage [coverage file] [flags]

Flags:
      --add-prefix string   add this prefix to file paths
  -t, --input-type string   type of input source to use [clover,
cobertura, coverage.py, excoveralls, gcov, gocov, jacoco, lcov,
simplecov, xccov]
  -o, --output string       output path (default "coverage/codeclimate.json")
  -p, --prefix string       the root directory where the
    coverage analysis was performed (default "/home/circleci/project")

Global Flags:
  -d, --debug   run in debug mode

Exited with code exit status 255
```

https://circleci.com/gh/rubocop-hq/rubocop/83619

This patch is a workaround until the following issue will be resolved.
codeclimate/test-reporter#418
Cruikshanks added a commit to DEFRA/defra-ruby-address that referenced this issue Jan 29, 2020
codeclimate/test-reporter#418

On 28 Jan 2020 [SimpleCov 0.18.0](https://github.com/colszowka/simplecov/releases/tag/v0.18.0) was released. Though it's generating code coverage for us, its changed the JSON format of the `/coverage/.resultset.json` CodeClimate's [cc-test-reporter](https://github.com/codeclimate/test-reporter) appears to rely on.

<details>
  <summary>Format before</summary>

  ```json
  {
    "RSpec": {
      "coverage": {
        "/path/to/my/file.rb": [
          null,
          null,
          1
        ]
      },
      "timestamp": 1580226312
    }
  }
  ```
</details>

<details>
  <summary>Format after</summary>

  ```json
  {
    "RSpec": {
      "coverage": {
        "/path/to/my/file.rb": {
          "lines": [
            null,
            null,
            1,
            null
          ],
          "branches": {
          }
        }
      },
      "timestamp": 1580299988
    }
  }
  ```
</details>

When **cc-test-reporter** is called in the `after_script` hook in Travis-CI we are seeing the following error

```bash
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT; fi
Error: json: cannot unmarshal object into Go struct field input.coverage of type []formatters.NullInt
Usage:
  cc-test-reporter after-build [flags]
Flags:
  -s, --batch-size int               batch size for source files (default 500)
  -e, --coverage-endpoint string     endpoint to upload coverage information to (default "https://api.codeclimate.com/v1/test_reports")
  -t, --coverage-input-type string   type of input source to use [clover, cobertura, coverage.py, excoveralls, gcov, gocov, jacoco, lcov, simplecov, xccov]
      --exit-code int                exit code of the test run
  -r, --id string                    reporter identifier (default "463a251defaae85271bff85ea8b1e58aa06cc9322157aa3ad7ee2a986aa13612")
      --insecure                     send coverage insecurely (without HTTPS)
  -p, --prefix string                the root directory where the coverage analysis was performed (default "/home/travis/build/DEFRA/waste-carriers-front-office")
Global Flags:
  -d, --debug   run in debug mode
```

As the CodeClimate integration is important to our CI process, we chosen to temporarily set the version of SimpleCov as 0.17.1 until the issue is resolved.
Cruikshanks added a commit to DEFRA/defra-ruby-alert that referenced this issue Jan 29, 2020
codeclimate/test-reporter#418

On 28 Jan 2020 [SimpleCov 0.18.0](https://github.com/colszowka/simplecov/releases/tag/v0.18.0) was released. Though it's generating code coverage for us, its changed the JSON format of the `/coverage/.resultset.json` CodeClimate's [cc-test-reporter](https://github.com/codeclimate/test-reporter) appears to rely on.

<details>
  <summary>Format before</summary>

  ```json
  {
    "RSpec": {
      "coverage": {
        "/path/to/my/file.rb": [
          null,
          null,
          1
        ]
      },
      "timestamp": 1580226312
    }
  }
  ```
</details>

<details>
  <summary>Format after</summary>

  ```json
  {
    "RSpec": {
      "coverage": {
        "/path/to/my/file.rb": {
          "lines": [
            null,
            null,
            1,
            null
          ],
          "branches": {
          }
        }
      },
      "timestamp": 1580299988
    }
  }
  ```
</details>

When **cc-test-reporter** is called in the `after_script` hook in Travis-CI we are seeing the following error

```bash
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT; fi
Error: json: cannot unmarshal object into Go struct field input.coverage of type []formatters.NullInt
Usage:
  cc-test-reporter after-build [flags]
Flags:
  -s, --batch-size int               batch size for source files (default 500)
  -e, --coverage-endpoint string     endpoint to upload coverage information to (default "https://api.codeclimate.com/v1/test_reports")
  -t, --coverage-input-type string   type of input source to use [clover, cobertura, coverage.py, excoveralls, gcov, gocov, jacoco, lcov, simplecov, xccov]
      --exit-code int                exit code of the test run
  -r, --id string                    reporter identifier (default "463a251defaae85271bff85ea8b1e58aa06cc9322157aa3ad7ee2a986aa13612")
      --insecure                     send coverage insecurely (without HTTPS)
  -p, --prefix string                the root directory where the coverage analysis was performed (default "/home/travis/build/DEFRA/waste-carriers-front-office")
Global Flags:
  -d, --debug   run in debug mode
```

As the CodeClimate integration is important to our CI process, we chosen to temporarily set the version of SimpleCov as 0.17.1 until the issue is resolved.
Cruikshanks added a commit to DEFRA/defra-ruby-address that referenced this issue Jan 29, 2020
codeclimate/test-reporter#418

On 28 Jan 2020 [SimpleCov 0.18.0](https://github.com/colszowka/simplecov/releases/tag/v0.18.0) was released. Though it's generating code coverage for us, its changed the JSON format of the `/coverage/.resultset.json` CodeClimate's [cc-test-reporter](https://github.com/codeclimate/test-reporter) appears to rely on.

<details>
  <summary>Format before</summary>

  ```json
  {
    "RSpec": {
      "coverage": {
        "/path/to/my/file.rb": [
          null,
          null,
          1
        ]
      },
      "timestamp": 1580226312
    }
  }
  ```
</details>

<details>
  <summary>Format after</summary>

  ```json
  {
    "RSpec": {
      "coverage": {
        "/path/to/my/file.rb": {
          "lines": [
            null,
            null,
            1,
            null
          ],
          "branches": {
          }
        }
      },
      "timestamp": 1580299988
    }
  }
  ```
</details>

When **cc-test-reporter** is called in the `after_script` hook in Travis-CI we are seeing the following error

```bash
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT; fi
Error: json: cannot unmarshal object into Go struct field input.coverage of type []formatters.NullInt
Usage:
  cc-test-reporter after-build [flags]
Flags:
  -s, --batch-size int               batch size for source files (default 500)
  -e, --coverage-endpoint string     endpoint to upload coverage information to (default "https://api.codeclimate.com/v1/test_reports")
  -t, --coverage-input-type string   type of input source to use [clover, cobertura, coverage.py, excoveralls, gcov, gocov, jacoco, lcov, simplecov, xccov]
      --exit-code int                exit code of the test run
  -r, --id string                    reporter identifier (default "463a251defaae85271bff85ea8b1e58aa06cc9322157aa3ad7ee2a986aa13612")
      --insecure                     send coverage insecurely (without HTTPS)
  -p, --prefix string                the root directory where the coverage analysis was performed (default "/home/travis/build/DEFRA/waste-carriers-front-office")
Global Flags:
  -d, --debug   run in debug mode
```

As the CodeClimate integration is important to our CI process, we chosen to temporarily set the version of SimpleCov as 0.17.1 until the issue is resolved.
Cruikshanks added a commit to DEFRA/defra-ruby-area that referenced this issue Jan 29, 2020
codeclimate/test-reporter#418

On 28 Jan 2020 [SimpleCov 0.18.0](https://github.com/colszowka/simplecov/releases/tag/v0.18.0) was released. Though it's generating code coverage for us, its changed the JSON format of the `/coverage/.resultset.json` CodeClimate's [cc-test-reporter](https://github.com/codeclimate/test-reporter) appears to rely on.

<details>
  <summary>Format before</summary>

  ```json
  {
    "RSpec": {
      "coverage": {
        "/path/to/my/file.rb": [
          null,
          null,
          1
        ]
      },
      "timestamp": 1580226312
    }
  }
  ```
</details>

<details>
  <summary>Format after</summary>

  ```json
  {
    "RSpec": {
      "coverage": {
        "/path/to/my/file.rb": {
          "lines": [
            null,
            null,
            1,
            null
          ],
          "branches": {
          }
        }
      },
      "timestamp": 1580299988
    }
  }
  ```
</details>

When **cc-test-reporter** is called in the `after_script` hook in Travis-CI we are seeing the following error

```bash
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT; fi
Error: json: cannot unmarshal object into Go struct field input.coverage of type []formatters.NullInt
Usage:
  cc-test-reporter after-build [flags]
Flags:
  -s, --batch-size int               batch size for source files (default 500)
  -e, --coverage-endpoint string     endpoint to upload coverage information to (default "https://api.codeclimate.com/v1/test_reports")
  -t, --coverage-input-type string   type of input source to use [clover, cobertura, coverage.py, excoveralls, gcov, gocov, jacoco, lcov, simplecov, xccov]
      --exit-code int                exit code of the test run
  -r, --id string                    reporter identifier (default "463a251defaae85271bff85ea8b1e58aa06cc9322157aa3ad7ee2a986aa13612")
      --insecure                     send coverage insecurely (without HTTPS)
  -p, --prefix string                the root directory where the coverage analysis was performed (default "/home/travis/build/DEFRA/waste-carriers-front-office")
Global Flags:
  -d, --debug   run in debug mode
```

As the CodeClimate integration is important to our CI process, we have chosen to temporarily set the version of SimpleCov as 0.17.1 until the issue is resolved.
Cruikshanks added a commit to DEFRA/defra-ruby-alert that referenced this issue Jan 29, 2020
codeclimate/test-reporter#418

On 28 Jan 2020 [SimpleCov 0.18.0](https://github.com/colszowka/simplecov/releases/tag/v0.18.0) was released. Though it's generating code coverage for us, its changed the JSON format of the `/coverage/.resultset.json` CodeClimate's [cc-test-reporter](https://github.com/codeclimate/test-reporter) appears to rely on.

<details>
  <summary>Format before</summary>

  ```json
  {
    "RSpec": {
      "coverage": {
        "/path/to/my/file.rb": [
          null,
          null,
          1
        ]
      },
      "timestamp": 1580226312
    }
  }
  ```
</details>

<details>
  <summary>Format after</summary>

  ```json
  {
    "RSpec": {
      "coverage": {
        "/path/to/my/file.rb": {
          "lines": [
            null,
            null,
            1,
            null
          ],
          "branches": {
          }
        }
      },
      "timestamp": 1580299988
    }
  }
  ```
</details>

When **cc-test-reporter** is called in the `after_script` hook in Travis-CI we are seeing the following error

```bash
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT; fi
Error: json: cannot unmarshal object into Go struct field input.coverage of type []formatters.NullInt
Usage:
  cc-test-reporter after-build [flags]
Flags:
  -s, --batch-size int               batch size for source files (default 500)
  -e, --coverage-endpoint string     endpoint to upload coverage information to (default "https://api.codeclimate.com/v1/test_reports")
  -t, --coverage-input-type string   type of input source to use [clover, cobertura, coverage.py, excoveralls, gcov, gocov, jacoco, lcov, simplecov, xccov]
      --exit-code int                exit code of the test run
  -r, --id string                    reporter identifier (default "463a251defaae85271bff85ea8b1e58aa06cc9322157aa3ad7ee2a986aa13612")
      --insecure                     send coverage insecurely (without HTTPS)
  -p, --prefix string                the root directory where the coverage analysis was performed (default "/home/travis/build/DEFRA/waste-carriers-front-office")
Global Flags:
  -d, --debug   run in debug mode
```

As the CodeClimate integration is important to our CI process, we chosen to temporarily set the version of SimpleCov as 0.17.1 until the issue is resolved.
Cruikshanks added a commit to DEFRA/defra-ruby-aws that referenced this issue Jan 29, 2020
codeclimate/test-reporter#418

On 28 Jan 2020 [SimpleCov 0.18.0](https://github.com/colszowka/simplecov/releases/tag/v0.18.0) was released. Though it's generating code coverage for us, its changed the JSON format of the `/coverage/.resultset.json` CodeClimate's [cc-test-reporter](https://github.com/codeclimate/test-reporter) appears to rely on.

<details>
  <summary>Format before</summary>

  ```json
  {
    "RSpec": {
      "coverage": {
        "/path/to/my/file.rb": [
          null,
          null,
          1
        ]
      },
      "timestamp": 1580226312
    }
  }
  ```
</details>

<details>
  <summary>Format after</summary>

  ```json
  {
    "RSpec": {
      "coverage": {
        "/path/to/my/file.rb": {
          "lines": [
            null,
            null,
            1,
            null
          ],
          "branches": {
          }
        }
      },
      "timestamp": 1580299988
    }
  }
  ```
</details>

When **cc-test-reporter** is called in the `after_script` hook in Travis-CI we are seeing the following error

```bash
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT; fi
Error: json: cannot unmarshal object into Go struct field input.coverage of type []formatters.NullInt
Usage:
  cc-test-reporter after-build [flags]
Flags:
  -s, --batch-size int               batch size for source files (default 500)
  -e, --coverage-endpoint string     endpoint to upload coverage information to (default "https://api.codeclimate.com/v1/test_reports")
  -t, --coverage-input-type string   type of input source to use [clover, cobertura, coverage.py, excoveralls, gcov, gocov, jacoco, lcov, simplecov, xccov]
      --exit-code int                exit code of the test run
  -r, --id string                    reporter identifier (default "463a251defaae85271bff85ea8b1e58aa06cc9322157aa3ad7ee2a986aa13612")
      --insecure                     send coverage insecurely (without HTTPS)
  -p, --prefix string                the root directory where the coverage analysis was performed (default "/home/travis/build/DEFRA/waste-carriers-front-office")
Global Flags:
  -d, --debug   run in debug mode
```

As the CodeClimate integration is important to our CI process, we have chosen to temporarily set the version of SimpleCov as 0.17.1 until the issue is resolved.
Cruikshanks added a commit to DEFRA/defra-ruby-mocks that referenced this issue Jan 29, 2020
codeclimate/test-reporter#418

On 28 Jan 2020 [SimpleCov 0.18.0](https://github.com/colszowka/simplecov/releases/tag/v0.18.0) was released. Though it's generating code coverage for us, its changed the JSON format of the `/coverage/.resultset.json` CodeClimate's [cc-test-reporter](https://github.com/codeclimate/test-reporter) appears to rely on.

<details>
  <summary>Format before</summary>

  ```json
  {
    "RSpec": {
      "coverage": {
        "/path/to/my/file.rb": [
          null,
          null,
          1
        ]
      },
      "timestamp": 1580226312
    }
  }
  ```
</details>

<details>
  <summary>Format after</summary>

  ```json
  {
    "RSpec": {
      "coverage": {
        "/path/to/my/file.rb": {
          "lines": [
            null,
            null,
            1,
            null
          ],
          "branches": {
          }
        }
      },
      "timestamp": 1580299988
    }
  }
  ```
</details>

When **cc-test-reporter** is called in the `after_script` hook in Travis-CI we are seeing the following error

```bash
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT; fi
Error: json: cannot unmarshal object into Go struct field input.coverage of type []formatters.NullInt
Usage:
  cc-test-reporter after-build [flags]
Flags:
  -s, --batch-size int               batch size for source files (default 500)
  -e, --coverage-endpoint string     endpoint to upload coverage information to (default "https://api.codeclimate.com/v1/test_reports")
  -t, --coverage-input-type string   type of input source to use [clover, cobertura, coverage.py, excoveralls, gcov, gocov, jacoco, lcov, simplecov, xccov]
      --exit-code int                exit code of the test run
  -r, --id string                    reporter identifier (default "463a251defaae85271bff85ea8b1e58aa06cc9322157aa3ad7ee2a986aa13612")
      --insecure                     send coverage insecurely (without HTTPS)
  -p, --prefix string                the root directory where the coverage analysis was performed (default "/home/travis/build/DEFRA/waste-carriers-front-office")
Global Flags:
  -d, --debug   run in debug mode
```

As the CodeClimate integration is important to our CI process, we have chosen to temporarily set the version of SimpleCov as 0.17.1 until the issue is resolved.
Cruikshanks added a commit to DEFRA/defra-ruby-mocks that referenced this issue Jan 29, 2020
codeclimate/test-reporter#418

On 28 Jan 2020 [SimpleCov 0.18.0](https://github.com/colszowka/simplecov/releases/tag/v0.18.0) was released. Though it's generating code coverage for us, its changed the JSON format of the `/coverage/.resultset.json` CodeClimate's [cc-test-reporter](https://github.com/codeclimate/test-reporter) appears to rely on.

<details>
  <summary>Format before</summary>

  ```json
  {
    "RSpec": {
      "coverage": {
        "/path/to/my/file.rb": [
          null,
          null,
          1
        ]
      },
      "timestamp": 1580226312
    }
  }
  ```
</details>

<details>
  <summary>Format after</summary>

  ```json
  {
    "RSpec": {
      "coverage": {
        "/path/to/my/file.rb": {
          "lines": [
            null,
            null,
            1,
            null
          ],
          "branches": {
          }
        }
      },
      "timestamp": 1580299988
    }
  }
  ```
</details>

When **cc-test-reporter** is called in the `after_script` hook in Travis-CI we are seeing the following error

```bash
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT; fi
Error: json: cannot unmarshal object into Go struct field input.coverage of type []formatters.NullInt
Usage:
  cc-test-reporter after-build [flags]
Flags:
  -s, --batch-size int               batch size for source files (default 500)
  -e, --coverage-endpoint string     endpoint to upload coverage information to (default "https://api.codeclimate.com/v1/test_reports")
  -t, --coverage-input-type string   type of input source to use [clover, cobertura, coverage.py, excoveralls, gcov, gocov, jacoco, lcov, simplecov, xccov]
      --exit-code int                exit code of the test run
  -r, --id string                    reporter identifier (default "463a251defaae85271bff85ea8b1e58aa06cc9322157aa3ad7ee2a986aa13612")
      --insecure                     send coverage insecurely (without HTTPS)
  -p, --prefix string                the root directory where the coverage analysis was performed (default "/home/travis/build/DEFRA/waste-carriers-front-office")
Global Flags:
  -d, --debug   run in debug mode
```

As the CodeClimate integration is important to our CI process, we have chosen to temporarily set the version of SimpleCov as 0.17.1 until the issue is resolved.
Cruikshanks added a commit to DEFRA/defra-ruby-aws that referenced this issue Jan 29, 2020
codeclimate/test-reporter#418

On 28 Jan 2020 [SimpleCov 0.18.0](https://github.com/colszowka/simplecov/releases/tag/v0.18.0) was released. Though it's generating code coverage for us, its changed the JSON format of the `/coverage/.resultset.json` CodeClimate's [cc-test-reporter](https://github.com/codeclimate/test-reporter) appears to rely on.

<details>
  <summary>Format before</summary>

  ```json
  {
    "RSpec": {
      "coverage": {
        "/path/to/my/file.rb": [
          null,
          null,
          1
        ]
      },
      "timestamp": 1580226312
    }
  }
  ```
</details>

<details>
  <summary>Format after</summary>

  ```json
  {
    "RSpec": {
      "coverage": {
        "/path/to/my/file.rb": {
          "lines": [
            null,
            null,
            1,
            null
          ],
          "branches": {
          }
        }
      },
      "timestamp": 1580299988
    }
  }
  ```
</details>

When **cc-test-reporter** is called in the `after_script` hook in Travis-CI we are seeing the following error

```bash
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT; fi
Error: json: cannot unmarshal object into Go struct field input.coverage of type []formatters.NullInt
Usage:
  cc-test-reporter after-build [flags]
Flags:
  -s, --batch-size int               batch size for source files (default 500)
  -e, --coverage-endpoint string     endpoint to upload coverage information to (default "https://api.codeclimate.com/v1/test_reports")
  -t, --coverage-input-type string   type of input source to use [clover, cobertura, coverage.py, excoveralls, gcov, gocov, jacoco, lcov, simplecov, xccov]
      --exit-code int                exit code of the test run
  -r, --id string                    reporter identifier (default "463a251defaae85271bff85ea8b1e58aa06cc9322157aa3ad7ee2a986aa13612")
      --insecure                     send coverage insecurely (without HTTPS)
  -p, --prefix string                the root directory where the coverage analysis was performed (default "/home/travis/build/DEFRA/waste-carriers-front-office")
Global Flags:
  -d, --debug   run in debug mode
```

As the CodeClimate integration is important to our CI process, we have chosen to temporarily set the version of SimpleCov as 0.17.1 until the issue is resolved.
Cruikshanks added a commit to DEFRA/defra-ruby-validators that referenced this issue Jan 29, 2020
codeclimate/test-reporter#418

On 28 Jan 2020 [SimpleCov 0.18.0](https://github.com/colszowka/simplecov/releases/tag/v0.18.0) was released. Though it's generating code coverage for us, its changed the JSON format of the `/coverage/.resultset.json` CodeClimate's [cc-test-reporter](https://github.com/codeclimate/test-reporter) appears to rely on.

<details>
  <summary>Format before</summary>

  ```json
  {
    "RSpec": {
      "coverage": {
        "/path/to/my/file.rb": [
          null,
          null,
          1
        ]
      },
      "timestamp": 1580226312
    }
  }
  ```
</details>

<details>
  <summary>Format after</summary>

  ```json
  {
    "RSpec": {
      "coverage": {
        "/path/to/my/file.rb": {
          "lines": [
            null,
            null,
            1,
            null
          ],
          "branches": {
          }
        }
      },
      "timestamp": 1580299988
    }
  }
  ```
</details>

When **cc-test-reporter** is called in the `after_script` hook in Travis-CI we are seeing the following error

```bash
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT; fi
Error: json: cannot unmarshal object into Go struct field input.coverage of type []formatters.NullInt
Usage:
  cc-test-reporter after-build [flags]
Flags:
  -s, --batch-size int               batch size for source files (default 500)
  -e, --coverage-endpoint string     endpoint to upload coverage information to (default "https://api.codeclimate.com/v1/test_reports")
  -t, --coverage-input-type string   type of input source to use [clover, cobertura, coverage.py, excoveralls, gcov, gocov, jacoco, lcov, simplecov, xccov]
      --exit-code int                exit code of the test run
  -r, --id string                    reporter identifier (default "463a251defaae85271bff85ea8b1e58aa06cc9322157aa3ad7ee2a986aa13612")
      --insecure                     send coverage insecurely (without HTTPS)
  -p, --prefix string                the root directory where the coverage analysis was performed (default "/home/travis/build/DEFRA/waste-carriers-front-office")
Global Flags:
  -d, --debug   run in debug mode
```

As the CodeClimate integration is important to our CI process, we have chosen to temporarily set the version of SimpleCov as 0.17.1 until the issue is resolved.
Cruikshanks added a commit to DEFRA/defra-ruby-mocks that referenced this issue Jan 29, 2020
codeclimate/test-reporter#418

On 28 Jan 2020 [SimpleCov 0.18.0](https://github.com/colszowka/simplecov/releases/tag/v0.18.0) was released. Though it's generating code coverage for us, its changed the JSON format of the `/coverage/.resultset.json` CodeClimate's [cc-test-reporter](https://github.com/codeclimate/test-reporter) appears to rely on.

<details>
  <summary>Format before</summary>

  ```json
  {
    "RSpec": {
      "coverage": {
        "/path/to/my/file.rb": [
          null,
          null,
          1
        ]
      },
      "timestamp": 1580226312
    }
  }
  ```
</details>

<details>
  <summary>Format after</summary>

  ```json
  {
    "RSpec": {
      "coverage": {
        "/path/to/my/file.rb": {
          "lines": [
            null,
            null,
            1,
            null
          ],
          "branches": {
          }
        }
      },
      "timestamp": 1580299988
    }
  }
  ```
</details>

When **cc-test-reporter** is called in the `after_script` hook in Travis-CI we are seeing the following error

```bash
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT; fi
Error: json: cannot unmarshal object into Go struct field input.coverage of type []formatters.NullInt
Usage:
  cc-test-reporter after-build [flags]
Flags:
  -s, --batch-size int               batch size for source files (default 500)
  -e, --coverage-endpoint string     endpoint to upload coverage information to (default "https://api.codeclimate.com/v1/test_reports")
  -t, --coverage-input-type string   type of input source to use [clover, cobertura, coverage.py, excoveralls, gcov, gocov, jacoco, lcov, simplecov, xccov]
      --exit-code int                exit code of the test run
  -r, --id string                    reporter identifier (default "463a251defaae85271bff85ea8b1e58aa06cc9322157aa3ad7ee2a986aa13612")
      --insecure                     send coverage insecurely (without HTTPS)
  -p, --prefix string                the root directory where the coverage analysis was performed (default "/home/travis/build/DEFRA/waste-carriers-front-office")
Global Flags:
  -d, --debug   run in debug mode
```

As the CodeClimate integration is important to our CI process, we have chosen to temporarily set the version of SimpleCov as 0.17.1 until the issue is resolved.
Cruikshanks added a commit to DEFRA/defra-ruby-area that referenced this issue Jan 29, 2020
* Temp. fix for cc-test-reporter & SimpleCov 0.18

codeclimate/test-reporter#418

On 28 Jan 2020 [SimpleCov 0.18.0](https://github.com/colszowka/simplecov/releases/tag/v0.18.0) was released. Though it's generating code coverage for us, its changed the JSON format of the `/coverage/.resultset.json` CodeClimate's [cc-test-reporter](https://github.com/codeclimate/test-reporter) appears to rely on.

<details>
  <summary>Format before</summary>

  ```json
  {
    "RSpec": {
      "coverage": {
        "/path/to/my/file.rb": [
          null,
          null,
          1
        ]
      },
      "timestamp": 1580226312
    }
  }
  ```
</details>

<details>
  <summary>Format after</summary>

  ```json
  {
    "RSpec": {
      "coverage": {
        "/path/to/my/file.rb": {
          "lines": [
            null,
            null,
            1,
            null
          ],
          "branches": {
          }
        }
      },
      "timestamp": 1580299988
    }
  }
  ```
</details>

When **cc-test-reporter** is called in the `after_script` hook in Travis-CI we are seeing the following error

```bash
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT; fi
Error: json: cannot unmarshal object into Go struct field input.coverage of type []formatters.NullInt
Usage:
  cc-test-reporter after-build [flags]
Flags:
  -s, --batch-size int               batch size for source files (default 500)
  -e, --coverage-endpoint string     endpoint to upload coverage information to (default "https://api.codeclimate.com/v1/test_reports")
  -t, --coverage-input-type string   type of input source to use [clover, cobertura, coverage.py, excoveralls, gcov, gocov, jacoco, lcov, simplecov, xccov]
      --exit-code int                exit code of the test run
  -r, --id string                    reporter identifier (default "463a251defaae85271bff85ea8b1e58aa06cc9322157aa3ad7ee2a986aa13612")
      --insecure                     send coverage insecurely (without HTTPS)
  -p, --prefix string                the root directory where the coverage analysis was performed (default "/home/travis/build/DEFRA/waste-carriers-front-office")
Global Flags:
  -d, --debug   run in debug mode
```

As the CodeClimate integration is important to our CI process, we have chosen to temporarily set the version of SimpleCov as 0.17.1 until the issue is resolved.

* WAKEUP CODECLIMATE
vtamara added a commit to pasosdeJesus/cor1440_pdJ that referenced this issue Oct 12, 2020
vtamara added a commit to pasosdeJesus/cor1440_pdJ that referenced this issue Oct 12, 2020
ochaochaocha3 added a commit to cre-ne-jp/log-archiver that referenced this issue Nov 15, 2020
ochaochaocha3 added a commit to cre-ne-jp/log-archiver that referenced this issue Nov 15, 2020
koic added a commit to koic/faker that referenced this issue Mar 1, 2021
Closes faker-ruby#2043.

This PR fixes the following build error when using cc-test-reporter with
SimpleCov 0.18.

```console
Run export GIT_BRANCH="${GITHUB_REF/refs\/heads\//}"
Error: json: cannot unmarshal object into Go struct field input.coverage
of type []formatters.NullInt
Usage:
  cc-test-reporter after-build [flags]

(snip)

Global Flags:
  -d, --debug   run in debug mode

##[error]Process completed with exit code 255.
```

https://github.com/faker-ruby/faker/pull/2043/checks?check_run_id=750522010

This patch is a workaround until the following issue will be resolved.
codeclimate/test-reporter#418
koic added a commit to koic/faker that referenced this issue Mar 14, 2021
Closes faker-ruby#2241.

This PR fixes the following build error when using cc-test-reporter with
SimpleCov 0.18.

```console
Run export GIT_BRANCH="${GITHUB_REF/refs\/heads\//}"
Error: json: cannot unmarshal object into Go struct field input.coverage
of type []formatters.NullInt
Usage:
  cc-test-reporter after-build [flags]

(snip)

Global Flags:
  -d, --debug   run in debug mode

##[error]Process completed with exit code 255.
```

https://github.com/faker-ruby/faker/pull/2043/checks?check_run_id=750522010

This patch is a workaround until the following issue will be resolved.
codeclimate/test-reporter#418
@fedegl
Copy link

fedegl commented Jul 24, 2021

I am using the latest version of cc-test-reporter and Simplecov 0.21.2 and still experiencing the issue. Anyone else experiencing this?

@maurolscla
Copy link

Same for me. The Simplecov (0.21.2) + Rspec doesn't seem to work with codeclimate test reporter. @fedegl Have you found a workaround for that?

@Mehonoshin
Copy link

Still an issue for me(simplecov-0.21.2)

cs0511 added a commit to HeadsUpHealth/devise_token_auth that referenced this issue Nov 9, 2021
commit c922580
Author: ‮Artem Kozaev <artemkozaev@gmail.com>
Date:   Tue Dec 8 22:58:00 2020 +0300

    Add email validation errors via add (lynndylanhurley#1445)

commit 72ccd90
Author: Hu Hailin <tony.hu.hailin@gmail.com>
Date:   Wed Dec 9 04:57:39 2020 +0900

    rc causes issue for namespaced class, use mapping directly to keep behavior consistency with devise (lynndylanhurley#1440)

commit 8dba30b
Author: Maicol Bentancor <maicol.bentancor@gmail.com>
Date:   Tue Dec 8 16:57:19 2020 -0300

    Enable rails 6.1 (lynndylanhurley#1446)

commit 575272a
Author: Ali Deishidi <sizief@gmail.com>
Date:   Fri Dec 4 19:20:56 2020 +0330

    Update faq.md (lynndylanhurley#1439)

    Type was missing

commit 2a83ef9
Author: dominikdarnel <dominik.darnel@gmail.com>
Date:   Sun Nov 8 21:51:36 2020 +0100

    Update overrides.md (lynndylanhurley#1437)

    Overrideable methods RegistrationsController#render_destroy_success and RegistrationsController#render_destroy_error were missing from docs.

commit 5ef7197
Author: Avrohom Katz <iambpentameter@gmail.com>
Date:   Sun Nov 1 10:40:30 2020 -0500

    make DTA respect controller overrides it doesn't kow about (lynndylanhurley#1435)

commit 24da31e
Author: Paulo Ribeiro <plribeiro3000@gmail.com>
Date:   Sun Nov 1 12:39:35 2020 -0300

    feat(Route): Accept override (lynndylanhurley#1432)

commit 530b4ba
Author: JP Rosevear <jprosevear@gmail.com>
Date:   Mon Oct 19 17:32:04 2020 -0400

    Remove unnecessary require_relative the file should be autoloaded (lynndylanhurley#1433)

commit 576d0b0
Author: Martin Jaime <50113670+martinjaimem@users.noreply.github.com>
Date:   Mon Oct 19 18:31:44 2020 -0300

    Enhancement: remove unnecessary statement in destroy session (lynndylanhurley#1431)

commit 0c369d6
Author: Maicol Bentancor <maicol.bentancor@gmail.com>
Date:   Sun Oct 4 17:34:44 2020 -0300

    Serialize updated at without to s (lynndylanhurley#1423)

    * working 4.2 version

    * cleanup

    * Lock simplecov to last supported cc version

    codeclimate/test-reporter#413

    Co-authored-by: Brian Dunn <brianpatrickdunn@gmail.com>

commit bb3e3f0
Author: Brent Dearth <brent.dearth@gmail.com>
Date:   Tue Sep 1 11:05:33 2020 -0600

    chore(deps): remove Sprockets requirement (lynndylanhurley#1428)

commit bef1b0b
Author: ngouy <nathangouy@free.fr>
Date:   Sat Jul 25 14:43:00 2020 -0400

    missing space in migration generator (lynndylanhurley#1422)

    So everything is nicely aligned if you uncomment this

commit b409997
Author: Maicol Bentancor <maicol.bentancor@gmail.com>
Date:   Sun Jun 21 21:53:29 2020 -0300

    Avoid failing on undefined variable for invalid record (lynndylanhurley#1416)

commit 30a1aff
Author: Maicol Bentancor <maicol.bentancor@gmail.com>
Date:   Sun Jun 21 21:52:43 2020 -0300

    Avoid nullyfing token when current_user is called before (lynndylanhurley#1417)

commit ae3547c
Author: Charlie Hua <compassion.wisdom@gmail.com>
Date:   Sun Jun 21 04:37:15 2020 +0800

    Memorize current_#{group_name} to avoid error (lynndylanhurley#722)

    Currently current_#{group_name} (ex. current_member) is not memorized as current_#{mapping} (ex. current_user) is.
    Instead, it calls set_user_by_token every time, and this could cause error if current_member is called after token is changed (maybe by some other request) and return nil

commit 849c244
Author: Maicol Bentancor <maicol.bentancor@gmail.com>
Date:   Sat Jun 20 00:39:42 2020 -0300

    Fix parent class name generator for rails 6 (lynndylanhurley#1414)

commit 449a0be
Author: Maicol Bentancor <maicol.bentancor@gmail.com>
Date:   Fri Jun 19 20:09:26 2020 -0300

    Reduce config variables doc table width (lynndylanhurley#1413)

commit 4461a09
Author: Hai Phan Nguyen <pnghai@gmail.com>
Date:   Sat Jun 20 05:27:45 2020 +0700

    Fix crash on devise 4.7.2+ (lynndylanhurley#1412)

    * Ignore sync uid in case confirmable mail changed

    * Update user_omniauth_callbacks.rb

    * Update user_omniauth_callbacks.rb

    * fix crash on devise 4.7.2+

commit bb09616
Author: Hai Phan Nguyen <pnghai@gmail.com>
Date:   Wed Jun 10 20:56:28 2020 +0700

    Ignore sync uid in case confirmable mail changed (lynndylanhurley#1407)

    * Ignore sync uid in case confirmable mail changed

    * Update user_omniauth_callbacks.rb

    * Update user_omniauth_callbacks.rb

commit b3d53b6
Author: Maicol Bentancor <maicol.bentancor@gmail.com>
Date:   Tue Jun 2 15:07:22 2020 -0300

    Bump version to 1.1.4 (lynndylanhurley#1406)

commit 2a01f4f
Author: Jamal Mohammed <jamal@mdjamal.com>
Date:   Tue Jun 2 22:07:49 2020 +0530

    Update faq.md (lynndylanhurley#1401)

    Updated FAQ to add **allow_password_change** column if not already added in existing User model.

commit 387306a
Author: Sai Chander <saichander17@gmail.com>
Date:   Wed Apr 29 08:43:10 2020 +0800

    Issue - 1358 Argument error when converting token updated_at using to_time fixed (lynndylanhurley#1388)

commit a3595f4
Author: David Loukidelis <david@loukidelis.com>
Date:   Tue Apr 28 20:41:32 2020 -0400

    Update omniauth_callbacks_controller.rb (lynndylanhurley#1398)

commit ef965d7
Author: Arun Kumar Mohan <arunmohandm@gmail.com>
Date:   Tue Apr 28 19:39:44 2020 -0500

    Fix grammar (lynndylanhurley#1396)

commit ea697f1
Author: H.Sada <47932189+h-sada@users.noreply.github.com>
Date:   Wed Apr 29 09:39:27 2020 +0900

    fixed not_email in ja.yml (lynndylanhurley#1395)

commit 275da3c
Author: Gabriel Bursztein <gabrielbursztein94@gmail.com>
Date:   Mon Mar 30 08:23:22 2020 -0300

    Fix: Save user authentication token after email confirmation (lynndylanhurley#1391)

commit 4a103ed
Author: Ahmed Magdy <ahmedmagdy711@users.noreply.github.com>
Date:   Mon Mar 30 13:19:16 2020 +0200

    Validate that token is valid for patch request last token (lynndylanhurley#1386)

commit 4d2d702
Author: Leo Kiiski <goalaleo@gmail.com>
Date:   Mon Mar 30 14:18:54 2020 +0300

    Fix token-type header key in testing example (lynndylanhurley#1390)

commit ab050c2
Author: Dylan Lederle-Ensign <dylan.lederle.ensign@gmail.com>
Date:   Mon Mar 30 07:17:57 2020 -0400

    Fix broken link (lynndylanhurley#1392)

commit 8c6ea5a
Author: Olle Jonsson <olle.jonsson@gmail.com>
Date:   Mon Mar 30 13:16:53 2020 +0200

    CI build fix: Pin to pry < 0.13 for 2.3 support, workaround CodeClimate reporter issue (lynndylanhurley#1393)

    * gemfiles: Pin to < 0.13 for 2.3 support

    * Workaround: CodeClimate not supporting SimpleCov

      - 0.18 gives us issues
      - see codeclimate/test-reporter#418

commit 49e7203
Author: K-Sato <32632542+K-Sato1995@users.noreply.github.com>
Date:   Sat Feb 29 08:17:59 2020 +0900

    Fix docs/usage/reset_password.md (lynndylanhurley#1382)

commit 55fcd11
Author: Bartek Fijałkowski <brateq@gmail.com>
Date:   Thu Jan 30 21:35:50 2020 +0100

    Add docs for confirmation endpoint (lynndylanhurley#1365)

commit e0d8dfa
Author: sugiken <ynmk1995@gmail.com>
Date:   Fri Jan 31 05:35:31 2020 +0900

    Remove Trackable option from generator (lynndylanhurley#1362)

commit 8326cc7
Author: Bartek Fijałkowski <brateq@gmail.com>
Date:   Thu Jan 30 21:33:45 2020 +0100

    Add rails 6.0 config to travis (lynndylanhurley#1366)

    * Add rails 6.0 config to travis

    * Exclude Travis Rails 6.0 checks for Ruby below 2.5

    * Updates tests to be compatible with Rails 6

    Rails 6 no longer generates migration with id: :uuid, so I changed the range of two ifs in tests and everything goes well now.

    * Add Ruby 2.7.0 to Travis

    * Exclude travis test for Ruby 2.7.0 with Rails 4.2

    Ruby 2.7 comes with Bundler 2 which is not compatible with Rails 4

    * Add to Travis test for rails 6 + mongoid 7

    * Downgrade mongoid-locker for rails 6 gemfile

    * Allow to change primary key type for Rails 6

commit 880a249
Author: Paweł Łuczak <woochaq@gmail.com>
Date:   Thu Jan 30 21:32:47 2020 +0100

    Fix missing polish and portugese translation errors (lynndylanhurley#1377)

commit 3680fd3
Author: Clément Prod'homme <prodhomme.clement@hotmail.fr>
Date:   Wed Jan 29 05:42:35 2020 +0100

    chore(docs): write complete path for authentication_test_spec (lynndylanhurley#1376)

commit 00d7abc
Author: Nicholas Martin <nicholas.martin@marketdojo.com>
Date:   Thu Jan 9 13:23:36 2020 +0000

    Add case sensitive option required to prevent deprecation warning in rails 6 (lynndylanhurley#1368)
@niclas-ahden
Copy link

@fedegl @Mehonoshin @maurolscla 0.21.2 is working for us. However, we did get this issue before setting CC_TEST_REPORTER_ID, so I'd look into that 👌

https://github.com/simplecov-ruby/simplecov/#json-formatter says:

Note: In case you plan to report your coverage results to CodeClimate services, know that SimpleCov will automatically use the JSON formatter along with the HTML formatter when the CC_TEST_REPORTER_ID variable is present in the environment.

Here's how to find your reporter ID: https://docs.codeclimate.com/docs/finding-your-test-coverage-token

Hope it works out!

@gregorw
Copy link

gregorw commented Apr 6, 2022

Slight different error message that I am getting (with all the latest versions):

Error: json: cannot unmarshal object into Go struct field resultSet.coverage of type []formatters.NullInt

@BobbyMcWho
Copy link

If anyone comes across this via Google, and you're using the paambaati/codeclimate-action GitHub Action to upload your coverage, make sure you set CC_TEST_REPORTER_ID in both the action, as well as the ENV for the test run, and make sure you update your coverageLocations (your paths may vary)

coverageLocations: |
-  ${{github.workspace}}/coverage/coverage-report-*/.resultset.json:simplecov
+  ${{github.workspace}}/coverage/coverage-report-*/coverage.json:simplecov

pirj pushed a commit to rubocop/rubocop-capybara that referenced this issue Dec 29, 2022
This PR fixes the following build error when using cc-test-reporter with
SimpleCov 0.18.

```consle
% #!/bin/bash -eo pipefail
  ./cc-test-reporter before-build
  rake coverage
  ./cc-test-reporter after-build --exit-code $?

(snip)

Coverage report generated for RSpec to
/home/circleci/project/coverage. 5051 / 5064 LOC (99.74%) covered.
Error: json: cannot unmarshal object into Go struct field input.coverage
of type []formatters.NullInt
```

https://circleci.com/gh/rubocop-hq/rubocop-rspec/10604

This patch is a workaround until the following issue will be resolved.
codeclimate/test-reporter#418
dblock added a commit to dblock/mongoid-locker that referenced this issue Mar 5, 2023
dblock added a commit to dblock/mongoid-locker that referenced this issue Mar 5, 2023
ydah pushed a commit to rubocop/rubocop-factory_bot that referenced this issue Apr 13, 2023
This PR fixes the following build error when using cc-test-reporter with
SimpleCov 0.18.

```consle
% #!/bin/bash -eo pipefail
  ./cc-test-reporter before-build
  rake coverage
  ./cc-test-reporter after-build --exit-code $?

(snip)

Coverage report generated for RSpec to
/home/circleci/project/coverage. 5051 / 5064 LOC (99.74%) covered.
Error: json: cannot unmarshal object into Go struct field input.coverage
of type []formatters.NullInt
```

https://circleci.com/gh/rubocop-hq/rubocop-rspec/10604

This patch is a workaround until the following issue will be resolved.
codeclimate/test-reporter#418
@Zeneixe
Copy link

Zeneixe commented Apr 20, 2023

We have this error with simplecov 0.22

Error: json: cannot unmarshal object into Go struct field resultSet.coverage of type []formatters.NullInt

@ldlgds2
Copy link

ldlgds2 commented Aug 22, 2023

From: https://docs.codeclimate.com/docs/test-coverage-troubleshooting-tips#section-specific-error-messages-from-the-reporter
Take a look at this:
This error happens when using SimpleCov newer versions (simplecov >= 0.19) and the reporter is not able to parse the default SimpleCov formatter, you need to set up the JSON one.

Ensure that the CC_TEST_REPORTER_ID variable is present in the environment when you run the test suite. This will force SimpleCov to automatically use the JSON formatter along with the HTML formatter.

References:

kpumuk added a commit to kpumuk/meta-tags that referenced this issue Oct 5, 2023
kpumuk added a commit to kpumuk/meta-tags that referenced this issue Oct 5, 2023
ydah pushed a commit to rubocop/rubocop-rspec_rails that referenced this issue Mar 27, 2024
This PR fixes the following build error when using cc-test-reporter with
SimpleCov 0.18.

```consle
% #!/bin/bash -eo pipefail
  ./cc-test-reporter before-build
  rake coverage
  ./cc-test-reporter after-build --exit-code $?

(snip)

Coverage report generated for RSpec to
/home/circleci/project/coverage. 5051 / 5064 LOC (99.74%) covered.
Error: json: cannot unmarshal object into Go struct field input.coverage
of type []formatters.NullInt
```

https://circleci.com/gh/rubocop-hq/rubocop-rspec/10604

This patch is a workaround until the following issue will be resolved.
codeclimate/test-reporter#418
ydah pushed a commit to rubocop/rubocop-rspec_rails that referenced this issue Mar 27, 2024
This PR fixes the following build error when using cc-test-reporter with
SimpleCov 0.18.

```consle
% #!/bin/bash -eo pipefail
  ./cc-test-reporter before-build
  rake coverage
  ./cc-test-reporter after-build --exit-code $?

(snip)

Coverage report generated for RSpec to
/home/circleci/project/coverage. 5051 / 5064 LOC (99.74%) covered.
Error: json: cannot unmarshal object into Go struct field input.coverage
of type []formatters.NullInt
```

https://circleci.com/gh/rubocop-hq/rubocop-rspec/10604

This patch is a workaround until the following issue will be resolved.
codeclimate/test-reporter#418
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests