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

Rake Task doesn't work with Rspec 3.6.0 #4

Open
schneems opened this issue Jun 25, 2018 · 0 comments
Open

Rake Task doesn't work with Rspec 3.6.0 #4

schneems opened this issue Jun 25, 2018 · 0 comments

Comments

@schneems
Copy link

I'm getting this error:

$ bundle exec rake spec:part[$(($CI_NODE_INDEX + 1)),$CI_NODE_TOTAL]
Running part 1 of 16 groups
rake aborted!
ArgumentError: unknown keywords: glob, groups, part
/Users/rschneeman/.gem/ruby/2.5.1/gems/rspec-parts-0.2.1/lib/rspec/parts/file_list.rb:36:in `from'
/Users/rschneeman/Documents/projects/heroku-buildpack-ruby/Rakefile:329:in `block (2 levels) in <top (required)>'
/Users/rschneeman/.gem/ruby/2.5.1/gems/rspec-core-3.6.0/lib/rspec/core/rake_task.rb:95:in `block (2 levels) in define'
/Users/rschneeman/.gem/ruby/2.5.1/gems/rspec-core-3.6.0/lib/rspec/core/rake_task.rb:94:in `block in define'
/Users/rschneeman/.gem/ruby/2.5.1/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
/Users/rschneeman/.gem/ruby/2.5.1/gems/bundler-1.16.2/lib/bundler/cli/exec.rb:74:in `load'
/Users/rschneeman/.gem/ruby/2.5.1/gems/bundler-1.16.2/lib/bundler/cli/exec.rb:74:in `kernel_load'
/Users/rschneeman/.gem/ruby/2.5.1/gems/bundler-1.16.2/lib/bundler/cli/exec.rb:28:in `run'
/Users/rschneeman/.gem/ruby/2.5.1/gems/bundler-1.16.2/lib/bundler/cli.rb:424:in `exec'
/Users/rschneeman/.gem/ruby/2.5.1/gems/bundler-1.16.2/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/Users/rschneeman/.gem/ruby/2.5.1/gems/bundler-1.16.2/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/Users/rschneeman/.gem/ruby/2.5.1/gems/bundler-1.16.2/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
/Users/rschneeman/.gem/ruby/2.5.1/gems/bundler-1.16.2/lib/bundler/cli.rb:27:in `dispatch'
/Users/rschneeman/.gem/ruby/2.5.1/gems/bundler-1.16.2/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
/Users/rschneeman/.gem/ruby/2.5.1/gems/bundler-1.16.2/lib/bundler/cli.rb:18:in `start'
/Users/rschneeman/.gem/ruby/2.5.1/gems/bundler-1.16.2/exe/bundle:30:in `block in <top (required)>'
/Users/rschneeman/.gem/ruby/2.5.1/gems/bundler-1.16.2/lib/bundler/friendly_errors.rb:124:in `with_friendly_errors'
/Users/rschneeman/.gem/ruby/2.5.1/gems/bundler-1.16.2/exe/bundle:22:in `<top (required)>'
/Users/rschneeman/.gem/ruby/2.5.1/bin/bundle:23:in `load'
/Users/rschneeman/.gem/ruby/2.5.1/bin/bundle:23:in `<main>'
Tasks: TOP => spec:part
(See full trace by running task with --trace)

Based on #3 I copied and pasted the contents of the rake file into the bottom of my Rakefile.

require 'rspec/core/rake_task'
require 'rspec/parts'

if defined?(RSpec)
  namespace :spec do
    desc 'Run part M of N specs'
    RSpec::Core::RakeTask.new(:part, :part, :groups) do |task, task_args|
      config = Rspec::Parts.config

      groups = task_args[:groups].to_i == 0 ? config.default_number_of_parts : task_args[:groups].to_i
      part = (task_args[:part].to_i == 0 ? 1 : task_args[:part].to_i)
      part_index = part - 1

      puts "Running part #{part} of #{groups} groups"

      file_list = Rspec::Parts::FileList.from(glob: config.spec_directory_glob, groups: groups, part: part_index)
      config.file_list_exclusions.each do |exclusion|
        file_list.exclude(exclusion)
      end

      task.rspec_opts = config.rspec_opts
      task.pattern = file_list
    end
  end
end

When I try to execute a test I get the error at top. I'm guessing this has to do with a compatability issue with certain versions of rspec.

schneems added a commit to heroku/heroku-buildpack-ruby that referenced this issue Jun 26, 2018
Rspec-parts doesn’t seem to work currently: hjhart/rspec-parts#4
schneems added a commit to heroku/heroku-buildpack-ruby that referenced this issue Jul 24, 2018
Rspec-parts doesn’t seem to work currently: hjhart/rspec-parts#4
schneems added a commit to heroku/heroku-buildpack-ruby that referenced this issue Aug 15, 2018
Rspec-parts doesn’t seem to work currently: hjhart/rspec-parts#4
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

1 participant