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

Rebase master to 4-0-dev and fix build #2160

Merged
merged 18 commits into from
Aug 28, 2019
Merged

Conversation

benoittgt
Copy link
Member

Address merge conflict in #2071

@benoittgt
Copy link
Member Author

benoittgt commented Aug 21, 2019

Waiting for #2158

@benoittgt benoittgt force-pushed the rebase_4-0-dev branch 2 times, most recently from 57866e3 to eb919ba Compare August 24, 2019 12:16
@benoittgt benoittgt changed the title Rebase master to 4-0-dev Rebase master to 4-0-dev and fix build Aug 24, 2019
@benoittgt benoittgt force-pushed the rebase_4-0-dev branch 2 times, most recently from 5ffd287 to 1915025 Compare August 24, 2019 14:59
@benoittgt
Copy link
Member Author

benoittgt commented Aug 24, 2019

I will fix the Rubocop offenses tonight if I have time.

This will change 955a99c a little bit. Maybe @samphippen you do not agree?

@benoittgt
Copy link
Member Author

benoittgt commented Aug 26, 2019

Ok... I think we should maybe unsync rubocop from the rest of RSpec...

At the moment if we jump back to 0.52

 rubocop lib                                         [22:45:09]
/Users/bti/code/rspec-dev/repos/rspec-rails/Gemfile:23: warning: already initialized constant Bundler::Dsl::RAILS_VERSION
/Users/bti/code/rspec-dev/repos/rspec-rails/Gemfile:3: warning: previous definition of RAILS_VERSION was here
Warning: unrecognized cop Style/TrailingCommaInArrayLiteral found in .rubocop_rspec_base.yml
Warning: unrecognized cop Style/TrailingCommaInHashLiteral found in .rubocop_rspec_base.yml
Warning: unrecognized cop Layout/IndentFirstArgument found in .rubocop_rspec_base.yml
Warning: unrecognized cop Style/MethodMissingSuper found in .rubocop_rspec_base.yml
Warning: unrecognized cop Style/MissingRespondToMissing found in .rubocop_rspec_base.yml
Warning: unrecognized cop Layout/IndentFirstArrayElement found in .rubocop_rspec_base.yml
Warning: unrecognized cop Style/AccessModifierDeclarations found in .rubocop.yml
Warning: unrecognized cop Naming/MemoizedInstanceVariableName found in .rubocop.yml
Warning: unrecognized cop Naming/UncommunicativeMethodParamName found in .rubocop.yml
Warning: unrecognized cop Naming/RescuedExceptionsVariableName found in .rubocop.yml
Warning: unrecognized cop Style/TrailingCommaInArrayLiteral found in .rubocop.yml
Warning: unrecognized cop Style/TrailingCommaInHashLiteral found in .rubocop.yml
Warning: unrecognized cop Layout/IndentFirstArgument found in .rubocop.yml
Warning: unrecognized cop Style/MethodMissingSuper found in .rubocop.yml
Warning: unrecognized cop Style/MissingRespondToMissing found in .rubocop.yml
Warning: unrecognized cop Layout/IndentFirstArrayElement found in .rubocop.yml
Inspecting 65 files
...................C.............C.C.E...........................

Offenses:

Way too many cops have changed. I think the goal of RSpec 4 will be also to jump to the last rubocop like rspec_rails.

I lock Rubocop to version 0.74

@benoittgt
Copy link
Member Author

benoittgt commented Aug 26, 2019

CI looks better. For Rails version below 5 it was looking similar to what you fixed Jon. I removed the restriction to is_ruby_23.
BTW I saw some interesting doc on travis documentation. https://docs.travis-ci.com/user/languages/ruby/

Capture d’écran 2019-08-26 à 23 50 34

On jruby-head and Rails 6 I commented on an open issue: jruby/activerecord-jdbc-adapter#980 and the super team there help me identifying a wrong version on activerecord-jdbcsqlite3. Jumping to last version nearly fixed it. It seems my check doesn't work... https://travis-ci.org/rspec/rspec-rails/jobs/577080522

@benoittgt benoittgt force-pushed the rebase_4-0-dev branch 2 times, most recently from 193dc0d to 3a345bb Compare August 27, 2019 10:11
@benoittgt benoittgt requested a review from JonRowe August 27, 2019 12:04
@@ -33,5 +33,10 @@ else
if version >= '5-1-stable' && RUBY_VERSION >= "2.3"
gem "puma"
end
gem 'activerecord-jdbcsqlite3-adapter', platforms: [:jruby]

if /(\d+)/.match(ENV['RAILS_VERSION'])[1].to_i >= 6
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not super fan about this. Maybe you have better idea @JonRowe

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We usually do ENV['RAILS_VERSION'].to_f >= 6.0 etc but you do sometimes have to stripe the other chars, I'd probably use .gsub(/[^\d\.]/,'').to_f or similar

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Applied in fe90da4

Happy to merge the PR if you are ok.

…ase'

On Rails 6 we add error in test suite like:
```
LoadError: cannot load such file -- selenium/webdriver System test integration requires Rails >= 5.1 and has a hard dependency on a webserver and `capybara`, please add capybara to your Gemfile and configure a webserver (e.g. `Capybara.server = :webrick`) before attempting to use system specs.
```

Thoses errors come from
`lib/rspec/rails/example/system_example_group.rb#L51`:

```
2.6.3 :002 > require 'action_dispatch/system_test_case'
Traceback (most recent call last):
       16: from /Users/bti/code/rspec-dev/repos/rspec-rails/spec/rspec/rails/example/system_example_group_spec.rb:11:in `block (4 levels) in <module:Rails>'
       15: from /Users/bti/code/rspec-dev/repos/rspec-rails/spec/rspec/rails/example/system_example_group_spec.rb:11:in `include'
       14: from /Users/bti/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.0/lib/active_support/concern.rb:122:in `append_features'
       13: from /Users/bti/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.0/lib/active_support/concern.rb:122:in `class_eval'
       12: from /Users/bti/code/rspec-dev/repos/rspec-rails/lib/rspec/rails/example/system_example_group.rb:50:in `block in <module:SystemExampleGroup>'
       11: from <internal:prelude>:145:in `irb'
       10: from (irb):2:in `block in <module:SystemExampleGroup>'
        9: from /Users/bti/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.0/lib/active_support/dependencies.rb:325:in `require'
        8: from /Users/bti/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.0/lib/active_support/dependencies.rb:291:in `load_dependency'
        7: from /Users/bti/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.0/lib/active_support/dependencies.rb:325:in `block in require'
        6: from /Users/bti/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.0/lib/active_support/dependencies.rb:325:in `require'
        5: from /Users/bti/.rvm/gems/ruby-2.6.3/gems/actionpack-6.0.0/lib/action_dispatch/system_test_case.rb:7:in `<top (required)>'
        4: from /Users/bti/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.0/lib/active_support/dependencies.rb:325:in `require'
        3: from /Users/bti/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.0/lib/active_support/dependencies.rb:291:in `load_dependency'
        2: from /Users/bti/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.0/lib/active_support/dependencies.rb:325:in `block in require'
        1: from /Users/bti/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.0/lib/active_support/dependencies.rb:325:in `require'
LoadError (cannot load such file -- selenium/webdriver)
```

This is probably related to:
> rails/rails#36592

We need to load selenium-driver if we are in Rails 6
@JonRowe JonRowe merged commit 1b47a5e into rspec:4-0-dev Aug 28, 2019
@benoittgt benoittgt deleted the rebase_4-0-dev branch August 28, 2019 15:54
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

Successfully merging this pull request may close these issues.

5 participants