Skip to content

Commit

Permalink
Use knapsack
Browse files Browse the repository at this point in the history
Rspec-parts doesn’t seem to work currently: hjhart/rspec-parts#4
  • Loading branch information
schneems committed Aug 15, 2018
1 parent 3a7e49e commit e05668c
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ source "https://rubygems.org"

group :development, :test do
gem "heroku_hatchet"
gem "rspec-parts" # another alternative is http://docs.knapsackpro.com/ruby/knapsack
gem "knapsack"
gem "rspec-core"
gem "rspec-expectations"
gem "excon"
Expand Down
6 changes: 3 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ GEM
i18n (1.0.1)
concurrent-ruby (~> 1.0)
json (2.0.4)
knapsack (1.16.0)
rake
minitest (5.11.3)
minitest-retry (0.1.9)
minitest (>= 5.0)
Expand All @@ -54,8 +56,6 @@ GEM
rspec-expectations (3.6.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.6.0)
rspec-parts (0.2.1)
rake
rspec-retry (0.5.4)
rspec-core (> 3.3, < 3.7)
rspec-support (3.6.0)
Expand All @@ -73,12 +73,12 @@ DEPENDENCIES
git!
heroku_hatchet
json (~> 2.0.2)
knapsack
netrc
parallel_tests
rake
rspec-core
rspec-expectations
rspec-parts
rspec-retry

BUNDLED WITH
Expand Down
4 changes: 2 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require "fileutils"
require "tmpdir"
require 'hatchet/tasks'

require 'knapsack'
ENV["BUILDPACK_LOG_FILE"] ||= "tmp/buildpack.log"

S3_BUCKET_NAME = "heroku-buildpack-ruby"
Expand Down Expand Up @@ -310,4 +310,4 @@ begin
rescue LoadError => e
end


Knapsack.load_tasks if defined?(Knapsack)
2 changes: 1 addition & 1 deletion app.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"scripts": {
"test-setup": "bundle exec rake hatchet:setup_ci",
"test": "bundle exec rake spec:part[($CI_NODE_INDEX + 1),$CI_NODE_TOTAL]"
"test": "bundle exec rake knapsack:rspec"
},
"buildpacks": [
{ "url": "heroku/ruby" }
Expand Down
4 changes: 4 additions & 0 deletions knapsack_rspec_report.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"spec/hatchet/bugs_spec.rb": 83.60694026947021,
"spec/hatchet/ci_spec.rb": 184.3626697063446
}
4 changes: 4 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
require 'rspec/retry'
require 'language_pack'

require 'knapsack'

Knapsack::Adapters::RSpecAdapter.bind

ENV['RACK_ENV'] = 'test'

RSpec.configure do |config|
Expand Down

0 comments on commit e05668c

Please sign in to comment.