Skip to content

Instantly share code, notes, and snippets.

Created April 2, 2020 21:56
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
# See
# And
export CI_NAME="heroku"
export GIT_COMMITTED_AT="$(date +%s)"
# Run the ruby test suite
bundle exec rake
# Dirty hack until this is fixed:
ruby scripts/transform.rb
# Format ruby coverage
./cc-test-reporter format-coverage "coverage/.resultset.json" --input-type simplecov # --output $ruby_filename
# Send to codeclimate
./cc-test-reporter upload-coverage
# Send status code of the test run
./cc-test-reporter after-build --exit-code $RETURN_VALUE --coverage-input-type simplecov
# download the codeclimate test reporter
curl -L > ./cc-test-reporter
chmod +x ./cc-test-reporter
./cc-test-reporter before-build
#! /bin/ruby
# Temporary hack to get CodeClimate to work with SimpleCov 0.18 JSON format until issue is fixed
# upstream:
require 'json'
filename = 'coverage/.resultset.json'
contents = JSON.parse(
def remove_lines_key(obj)
case obj
when Hash
obj.transform_values do |val|
val.is_a?(Hash) && val.key?('lines') ? val['lines'] : remove_lines_key(val)
# overwrite
File.write(filename, JSON.generate(remove_lines_key(contents)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment