Skip to content

My branch.md #202

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

Closed
wants to merge 51 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
0e9ba89
Update README with new version caveats
mrb Sep 28, 2016
78d7b87
Merge pull request #127 from codeclimate/readme_updates
mrb Sep 28, 2016
0dd3458
Fix README numbering
mrb Sep 28, 2016
f78a0f9
Reformat README
pbrisbin Sep 28, 2016
a34fb71
Ruby 1.9 probable fix (#132)
1v Oct 14, 2016
ccbc87a
test on both 1.9.3 and 2.2.2 (#133)
wfleming Oct 14, 2016
bbd9b44
Stop sending the test framework
maxjacobson Nov 3, 2016
7addc1b
Cut 1.0.0
maxjacobson Nov 3, 2016
3ee2a9a
Clarify upgrade instructions
Fryguy Nov 4, 2016
ce96fe5
Update warning wording
maxjacobson Nov 5, 2016
a0e5d03
Lock addressable for 1.9.3 compatibility
maxjacobson Nov 5, 2016
274d50e
Bump version number
maxjacobson Nov 6, 2016
276a241
Inline the SimpleCov.start to README
maxjacobson Nov 6, 2016
865169a
Escape SimpleCov.root to allow folders with parens
maxjacobson Nov 8, 2016
3d77234
Bump version to 1.0.2
maxjacobson Nov 8, 2016
3252bb7
Audit and organize dependencies (#148)
maxjacobson Nov 9, 2016
b3279e2
Cut 1.0.3 release
maxjacobson Nov 9, 2016
59b4668
Link to docs (#151)
gdiggs Nov 10, 2016
91a30e5
Update Bryan references to make them more general
maxjacobson Nov 28, 2016
f68b7bb
Add a changelog
maxjacobson Nov 28, 2016
58e7158
refactor start script and add option for custom coverage result path
Nov 24, 2016
8cc5a0e
Mention coverage results argument in CHANGELOG
pbrisbin Nov 30, 2016
d362347
Split out spec/support
pbrisbin Dec 27, 2016
6fc3902
Make formatter spec easier to extend
pbrisbin Dec 27, 2016
a3ab246
Handle multi-command resultsets
pbrisbin Dec 27, 2016
96d7f6c
Fix build for ruby 1.9
maxjacobson Dec 27, 2016
912457c
Update changelog for next release
maxjacobson Dec 29, 2016
651e903
Bump version number
maxjacobson Dec 29, 2016
129ecc5
Move specs into a namespace directory
maxjacobson Jan 5, 2017
a0dfb6d
Decrease verbosity of tar extract in specs
maxjacobson Jan 5, 2017
9ec1b66
Hard-code CODECLIMATE_REPO_TOKEN
maxjacobson Jan 18, 2017
925d5b2
Add support for env variable for `committed_at` for Codeship (#168)
antoniobg Jan 19, 2017
1d7778d
Only use committed_at from CI when it is set
maxjacobson Jan 19, 2017
2e662bf
Update changelog
maxjacobson Jan 19, 2017
e0ab42f
Prep v1.0.5 release
maxjacobson Jan 19, 2017
1d92d9c
Update README.md
efueger Feb 16, 2017
7b087b6
Wire committed_at to ci_timestamp for codeship (#172)
c-knowles Feb 22, 2017
1ec10f6
Prep v1.0.6 release
maxjacobson Feb 22, 2017
ca459d9
Get git hash from CI first and fall back to Git
sullerandras Mar 6, 2017
314826c
Take hash from from git first and fallback to CI
sullerandras Mar 6, 2017
d402336
Cover #177 with a test
maxjacobson Mar 9, 2017
4bfe8f6
Prep v1.0.7 release
maxjacobson Mar 9, 2017
97c658b
Add execution example and mention optional env
Feb 3, 2017
9971c7e
Lock simplecov to compatibile version range (#181)
bliof Mar 20, 2017
d6a9469
Prep v1.0.8 release
maxjacobson Mar 20, 2017
96f4dcc
Update usage instructions
dblandin Apr 4, 2017
7ca8313
update readme (#195)
davehenton Oct 3, 2017
1cf6de6
Update README.md (#198)
davehenton Apr 11, 2018
20c6d43
Fix rake for 1.93
Apr 11, 2018
8066a8f
Display a deprecation notice on installation
wfleming Oct 8, 2018
faa99c6
update changelog
wfleming Oct 8, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
.yardoc
*.DS_Store
Gemfile.lock
Gemfile.ruby-19.lock
InstalledFiles
_yardoc
coverage
Expand Down
122 changes: 122 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
# Change log

## master (unreleased)

### New features

### Bug fixes

### Changes

### v1.0.9 (2018-10-08)

* Add deprecation notice to post-install gem message.

### v1.0.8 (2017-03-20)

### Bug fixes

* Lock simplecov to `<= 0.13`, so we can safely use an internal-to-simplecov
method.
([@bliof](https://github.com/codeclimate/ruby-test-reporter/pull/181))

Note: you may need to run `bundle update codeclimate-test-reporter simplecov`
to resolve your bundle.

### v1.0.7 (2017-03-08)

### Bug fixes

* Continue improving our support for sending payloads in contexts where git is
not available.
([@sullerandras](https://github.com/codeclimate/ruby-test-reporter/pull/177))

### v1.0.6 (2017-02-22)

### Bug fixes

* Allow Codeship users to send a test coverage report without mounting their
`.git` directory within the docker container where they run their tests
_without_ manually exposing an environment variable. Instead, use an
environment variable already exposed by the CI environment.
([@c-knowles](https://github.com/codeclimate/ruby-test-reporter/pull/172))

### v1.0.5 (2017-01-19)

### Bug fixes

* Allow Codeship users to send a test coverage report without mounting their
`.git` directory within the docker container where they run their tests.
([@antoniobg](https://github.com/codeclimate/ruby-test-reporter/pull/168))

### v1.0.4 (2016-12-29)

### New features

* Accept path to coverage results as optional first argument ([@jreinert](https://github.com/codeclimate/ruby-test-reporter/pull/158))

### Bug fixes

* Handle multi-command resultsets ([@pbrisbin](https://github.com/codeclimate/ruby-test-reporter/pull/163))

## v1.0.3 (2016-11-09)

### Bug fixes

* Improve strategy for Ruby 1.9.3 compatibility testing

## v1.0.2 (2016-11-08)

### Bug fixes

* Fixed crashing error when the path to a file in the coverage report
contains a parenthesis.

## v1.0.1 (2016-11-06)

### Bug fixes

* Made sure the gem can be built while running Ruby 1.9.3

## v1.0.0 (2016-11-03)

### Changes

* Previously, this gem extended `Simplecov` with a custom formatter which posted
results to Code Climate. Now, you are responsible for executing `Simplecov`
yourself.

* If you already have the following in your test/test_helper.rb
(or spec_helper.rb, cucumber env.rb, etc)

```ruby
require 'codeclimate-test-reporter'
CodeClimate::TestReporter.start
```

then you should replace it with

```ruby
require 'simplecov'
SimpleCov.start
```

* Previously, the `codeclimate-test-reporter` automatically uploaded results at
the end of your test suite. Now, you are responsible for running
`codeclimate-test-reporter` as a separate step in your build.
* Previously, this gem added some exclusion rules tuned according to feedback
from its users, and now these no longer happen automatically. *If you are
experiencing a discrepancy in test coverage % after switching to the new gem
version, it may be due to missing exclusions. Filtering `vendor`, `spec`, or
`test` directories may fix this issue.*
* Previously, during the execution of multiple test suites, this gem would send
results from the first suite completed. You are now expected to run an
executable packaged with this gem as a separate build step, which means that
whatever results are there (likely the results from the last suite) will be
posted to Code Climate.

## v0.6.0 (2016-06-27)

### New features

* Support `ENV["SSL_CERT_PATH"]` for custom SSL certificates
9 changes: 0 additions & 9 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
source "https://rubygems.org"

# Specify your gem's dependencies in codeclimate-test-reporter.gemspec
gemspec

platform :ruby_19 do
gem "pry-debugger", group: :development
end

platform :ruby_21 do
gem "pry-byebug", group: :development
end
8 changes: 8 additions & 0 deletions Gemfile.ruby-19
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
source "https://rubygems.org"

gem "addressable", "< 2.5"
gem "json", "~> 1.8", "< 2"
gem "rake", "< 12.3.0"
gem "webmock", "< 2.3.1"

gemspec
57 changes: 43 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,67 @@
# codeclimate-test-reporter
# codeclimate-test-reporter - [DEPRECATED]

These configuration instructions refer to a language-specific test reporter who is now deprecated in favor of our new unified test reporter client. The [new test reporter](https://docs.codeclimate.com/v1.0/docs/configuring-test-coverage) is faster, distributed as a static binary, has support for parallelized CI builds, and will receive ongoing support by the team here. The existing test reporters for Ruby, Python, PHP, and Javascript are now deprecated.

[![Code Climate](https://codeclimate.com/github/codeclimate/ruby-test-reporter/badges/gpa.svg)](https://codeclimate.com/github/codeclimate/ruby-test-reporter)

Posts SimpleCov test coverage data from your Ruby test suite to Code Climate's hosted, automated code review service.
Posts SimpleCov test coverage data from your Ruby test suite to Code Climate's
hosted, automated code review service.

Code Climate - [https://codeclimate.com](https://codeclimate.com)

## Installation

This gem requires a user, but not necessarily a paid account, on Code Climate, so if you don't have one the
first step is to signup at: [https://codeclimate.com](https://codeclimate.com). Then:
This gem requires a user, but not necessarily a paid account, on Code Climate,
so if you don't have one the first step is to signup at:
[https://codeclimate.com](https://codeclimate.com). Then follow the
instructions on our [documentation site](https://docs.codeclimate.com/docs/test-coverage-ruby).

1. Add this to your Gemfile:
Please contact hello@codeclimate.com if you need any assistance setting this up.

gem "codeclimate-test-reporter", group: :test
## Usage

1. Start SimpleCov as you normally would (more information here: https://github.com/colszowka/simplecov)
```console
bundle exec rspec && CODECLIMATE_REPO_TOKEN=my_token bundle exec codeclimate-test-reporter
```

1. Set the `CODECLIMATE_REPO_TOKEN` environment variable (provided after you add your repo to your Code Climate account by clicking on "Setup Test Coverage" on the right hand side of your feed)
**Optional**: configure `CODECLIMATE_API_HOST` to point to a self-hosted version of Code Climate.

1. Run the `codeclimate-test-reporter` executable at the end of your test suite
## Troubleshooting / FYIs

Please contact hello@codeclimate.com if you need any assistance setting this up.
Across the many different testing frameworks, setups, and environments, there
are lots of variables at play. If you're having any trouble with your test
coverage reporting or the results are confusing, please see our full
documentation here: https://docs.codeclimate.com/docs/setting-up-test-coverage

## Troubleshooting / FYIs
## Upgrading from pre-1.0 Versions

Across the many different testing frameworks, setups, and environments, there are lots of variables at play. If you're having any trouble with your test coverage reporting or the results are confusing, please see our full documentation here: https://docs.codeclimate.com/docs/setting-up-test-coverage
Version `1.0` of this gem introduced new, breaking changes to the way the
test reporter is meant to be executed. The following list summarizes the major
differences:

See [the changelog entry for v1.0.0](CHANGELOG.md#v100-2016-11-03) for details.

## Contributions

Patches, bug fixes, feature requests, and pull requests are welcome on the
GitHub page for this project: [https://github.com/codeclimate/ruby-test-reporter](https://github.com/codeclimate/ruby-test-reporter)
GitHub page for this project:
[https://github.com/codeclimate/ruby-test-reporter](https://github.com/codeclimate/ruby-test-reporter)

When making a pull request, please update the [changelog](CHANGELOG.md).

This gem is maintained by Code Climate (hello@codeclimate.com).

### Release Process

This gem is maintained by Bryan Helmkamp (bryan@codeclimate.com).
* Update the changelog to mark the unreleased changes as part of the new release.
* Update the version.rb with the new version number
* Make a pull request with those changes
* Merge those changes to master
* Check out and pull down the latest master locally
* `rake release` which will
* tag the latest commit based on version.rb
* push to github
* push to rubygems

## Copyright

Expand Down
15 changes: 15 additions & 0 deletions bin/ci
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash --login

set -e

rvm use 1.9.3
ruby -v
bundle install --gemfile Gemfile.ruby-19
bundle exec rake

rvm use 2.2.2
ruby -v
bundle install
bundle exec rake

CODECLIMATE_REPO_TOKEN=c4881e09870b0fac1291c93339b36ffe36210a2645c1ad25e52d8fda3943fb4d bundle exec codeclimate-test-reporter
31 changes: 14 additions & 17 deletions bin/codeclimate-test-reporter
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,20 @@

require "codeclimate-test-reporter"

COVERAGE_FILE = "coverage/.resultset.json".freeze
repo_token = ENV["CODECLIMATE_REPO_TOKEN"]
if repo_token.nil? || repo_token.empty?
STDERR.puts "Cannot post results: environment variable CODECLIMATE_REPO_TOKEN must be set."
exit
end

COVERAGE_FILE = ARGV.first || "coverage/.resultset.json"

if (repo_token = ENV["CODECLIMATE_REPO_TOKEN"]) && !repo_token.empty?
if File.exist?(COVERAGE_FILE)
begin
results = JSON.parse(File.read(COVERAGE_FILE))
rescue JSON::ParserError => e
$stderr.puts "Error encountered while parsing #{COVERAGE_FILE}: #{e}"
exit(1)
end
abort "Coverage results not found" unless File.exist?(COVERAGE_FILE)

CodeClimate::TestReporter.run(results)
else
$stderr.puts "Coverage results not found"
exit(1)
end
else
$stderr.puts "Cannot post results: environment variable CODECLIMATE_REPO_TOKEN must be set."
exit(0)
begin
results = JSON.parse(File.read(COVERAGE_FILE))
rescue JSON::ParserError => e
abort "Error encountered while parsing #{COVERAGE_FILE}: #{e}"
end

CodeClimate::TestReporter.run(results)
8 changes: 3 additions & 5 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
machine:
ruby:
version: 2.2.2
dependencies:
pre:
- git config --global user.email "ci@codeclimate.com"
- git config --global user.name "Code Climate CI"
override:
- echo "skip"

test:
override:
- bundle exec rake
- bundle exec bin/codeclimate-test-reporter
- bin/ci
22 changes: 16 additions & 6 deletions codeclimate-test-reporter.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,32 @@ require "./lib/code_climate/test_reporter/version"
Gem::Specification.new do |spec|
spec.name = "codeclimate-test-reporter"
spec.version = CodeClimate::TestReporter::VERSION
spec.authors = ["Bryan Helmkamp"]
spec.email = ["bryan@brynary.com"]
spec.authors = ["Bryan Helmkamp", "Code Climate"]
spec.email = ["bryan@brynary.com", "hello@codeclimate.com"]
spec.description = "Collects test coverage data from your Ruby test suite and sends it to Code Climate's hosted, automated code review service. Based on SimpleCov."
spec.summary = "Uploads Ruby test coverage data to Code Climate."
spec.homepage = "https://github.com/codeclimate/ruby-test-reporter"
spec.license = "MIT"

spec.files = `git ls-files bin lib config LICENSE.txt README.md`.split($/)
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }.reject { |f| f == "ci" }

spec.required_ruby_version = ">= 1.9"
spec.add_runtime_dependency "simplecov", "<= 0.13"

spec.add_development_dependency "simplecov"
spec.add_development_dependency "bundler", "~> 1.3"
spec.add_development_dependency "bundler"
spec.add_development_dependency "pry"
spec.add_development_dependency "rake"
spec.add_development_dependency "rspec"
spec.add_development_dependency "webmock"
spec.add_development_dependency "pry"

spec.post_install_message = %q(
Code Climate's codeclimate-test-reporter gem has been deprecated in favor of
our language-agnostic unified test reporter. The new test reporter is faster,
distributed as a static binary so dependency conflicts never occur, and
supports parallelized CI builds & multi-language CI configurations.

Please visit https://docs.codeclimate.com/v1.0/docs/configuring-test-coverage
for help setting up your CI process with our new test reporter.
)
end
4 changes: 2 additions & 2 deletions lib/code_climate/test_reporter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ module TestReporter
WARNING_MESSAGE = <<-EOS.freeze
This usage of the Code Climate Test Reporter is now deprecated. Since version
1.0, we now require you to run `SimpleCov` in your test/spec helper, and then
run the provided `codeclimate-ruby` binary separately to report your results
to Code Climate.
run the provided `codeclimate-test-reporter` binary separately to report your
results to Code Climate.

More information here: https://github.com/codeclimate/ruby-test-reporter/blob/master/README.md
EOS
Expand Down
Loading