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

Unable to get working w/ Simplecov + Semaphore #472

Closed
bradherman opened this issue Jun 15, 2021 · 1 comment
Closed

Unable to get working w/ Simplecov + Semaphore #472

bradherman opened this issue Jun 15, 2021 · 1 comment
Assignees

Comments

@bradherman
Copy link

Using simplecov (0.21.2)

When running the following semaphore pipeline, I am unable to get reporting to Codeclimate. semaphore.yml and output included below:

- name: Rspec tests
    task:
      env_vars:
        - name: TEST_DB_USER
          value: postgres
      prologue:
        commands:
          - checkout
          - cache restore
          - sem-service start redis
          - sem-service start postgres
          - sem-version ruby 3.0.1
          - bundle install -j 4 --path vendor/bundle
          - 'RAILS_ENV=test bundle exec rails db:create db:migrate'
          - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
          - chmod +x ./cc-test-reporter
          - ./cc-test-reporter before-build
      jobs:
        - name: Rspec
          commands:
            - bundle exec rspec
      epilogue:
        always:
          commands:
            - 'exitcode=$(if [ "$SEMAPHORE_JOB_RESULT" == "passed" ]; then echo 0; else echo 1; fi)'
            - ./cc-test-reporter after-build --exit-code $exitcode

Coverage report generated for RSpec to /home/semaphore/jeevz-api/coverage. 4123 / 7489 LOC (55.05%) covered.
export SEMAPHORE_JOB_RESULT=passed
exitcode=$(if [ "$SEMAPHORE_JOB_RESULT" == "passed" ]; then echo 0; else echo 1; fi)
./cc-test-reporter after-build --exit-code $exitcode
Error: json: cannot unmarshal object into Go struct field resultSet.coverage of type []formatters.NullInt
@bradherman
Copy link
Author

Figured it out... It was a configuration issue on my end, nothing on yours. Sorry!

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

2 participants