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

support for parallel_tests #10

Closed
aaronjensen opened this issue Sep 12, 2013 · 19 comments
Closed

support for parallel_tests #10

aaronjensen opened this issue Sep 12, 2013 · 19 comments

Comments

@aaronjensen
Copy link
Contributor

I noticed there's support for tddium's parallel builds, is there also support for the parallel_tests gem? I haven't had a chance to try it yet, so feel free to consider this issue a request for documentation if there already is :)

@brynary
Copy link
Member

brynary commented Sep 17, 2013

We don't have support for parallel_tests yet but we'd like to support it in the future. I'll leave this open and we'll update when we start on it.

@jgarber
Copy link

jgarber commented Oct 29, 2013

👍

@mfrister
Copy link

I'm not sure how similar Travis works to parallel_tests, but support for split up tests on Travis would be great.

@schlenks
Copy link

I'm a big fan of CircleCI's parallel builds, I'm hoping this will be supported soon.

@oki
Copy link

oki commented Feb 11, 2014

👍

4 similar comments
@dpawliszko
Copy link

👍

@coryschires
Copy link

👍

@forrest
Copy link

forrest commented Jul 16, 2014

👍

@Tuxified
Copy link

👍

@aaronjensen
Copy link
Contributor Author

I was able to get this working. In your spec_helper.rb add:

require 'simplecov'
require 'codeclimate-test-reporter'
SimpleCov.add_filter 'vendor'
SimpleCov.formatters = []
SimpleCov.start CodeClimate::TestReporter.configuration.profile

Then after all your tests run, in a rake task do:

require 'simplecov'
require 'codeclimate-test-reporter'
CodeClimate::TestReporter::Formatter.new.format(SimpleCov.result)

That should send things to codeclimate aggregated. Be sure you're using simplecov >= 0.9.0

@calavera
Copy link
Contributor

Thanks for the information @aaronjensen, that looks like a good trick!

Do you mind to open a PR to modify the readme pointing to this solution? I can do it myself, but I don't want to take credit.

@aaronjensen
Copy link
Contributor Author

@calavera sure, done: #48 Thanks!

@calavera
Copy link
Contributor

Closing this as fixed. Thank you!

@sguha00
Copy link

sguha00 commented Mar 18, 2015

Does this fix work on CircleCI?

@aaronjensen
Copy link
Contributor Author

@sguha00 no, it wouldn't. CircleCI runs the tests on different machines. There may be another way to aggregate them, but I don't know it. You could probably model it after the tddium parallelized build support: 31432b8

@vanwhale
Copy link

Run this script as part of the circle ci build process. The script will merge the simplecov results, format to html and also post to codeclimate.

Add the following to circle.yml (assuming the script path is script/circle)

test:
  post:
    - bundle exec script/circle

@iamnader
Copy link

@evanwhalen what does your spec helper look like? are you using the codeclimate reporter:

  require "codeclimate-test-reporter"
  CodeClimate::TestReporter.start

or SimpleCov directly?

Thanks!

@vanwhale
Copy link

@iamnader the spec helper only reference simplecov and not code climate test reporter. The aforementioned script merges the results generated by simplecov and posts them to code climate.

require 'simplecov'

if ENV['CIRCLE_ARTIFACTS']
  dir = File.join("..", "..", "..", ENV['CIRCLE_ARTIFACTS'], "coverage")
  SimpleCov.coverage_dir(dir)
end

@iamnader
Copy link

Thanks @evanwhalen

Isn't ENV["CIRCLE_ARTIFACTS"] an absolute path? Why do you use: "..", "..", ".." ?

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