mongoid / mongoid-rspec

RSpec matchers and macros for Mongoid.
MIT License
498 stars 177 forks source link

Mongoid 6 conflicts #197

Closed saumyamehta17 closed 6 years ago

dblock commented 7 years ago

The check should really run once. Maybe take a dependency on https://github.com/mongoid/mongoid-compatibility and fix using that? We also really need mongoid versions in the test matrix - that repo has a good example on how to do that.

saumyamehta17 commented 6 years ago

@dblock added mongoid versions test using mongoid-compatibility. Please Let me know if I missed something.

dblock commented 6 years ago

More importantly we/you want to update the .travis.yml configuration here to run against multiple versions of mongoid.

dblock commented 6 years ago

Bump @saumyamehta17

saumyamehta17 commented 6 years ago

@dblock Hi Daniel

Sorry for delay in reply, I am bit occupied with my office work. Honestly, I am new to open source contribution and might be asking obvious (dumb) questions/doubts :)

What I understood:

  1. I need to add for support mongoid 6
  2. Also mongoid-compatibility can be added to check multiple versions of mongoid, which adds method to check versions. So, version_spec.rb does not required.
  3. rspec.rb module Mongoid code not needed now.
  4. I need to add all versions of mongoid in travis.yml which will do depenedency tests.

Please let me know if there is any gap. Thank you for being patient.

dblock commented 6 years ago

No worries, I'm here to help!

You got it right. Just keep iterating and I'll try to make things clearer as we make progress. Hang in there.

dblock commented 6 years ago

Looks like there're real failures with Mongoid 5, trying to use classes that don't exist in that version.

I think instead of creating separate gemfiles you want something like what we do in https://github.com/mongoid/mongoid-compatibility. Maybe copy from there?

dblock commented 6 years ago

I've added the Danger token to Travis-CI, so that should be working now.

mongoid-bot commented 6 years ago
1 Error
:no_entry_sign: The CHANGELOG.md file does not exist.
1 Warning
:warning: Unless you’re refactoring existing code, please update CHANGELOG.md.

Here's an example of a CHANGELOG.md entry:

* [#197](https://github.com/mongoid/mongoid-rspec/pull/197): Mongoid 6 conflicts - [@saumyamehta17](https://github.com/saumyamehta17).

Generated by :no_entry_sign: danger

dblock commented 6 years ago

Danger is now working, if you want to enable it as part of this PR it needs a CHANGELOG file. Usually I got back a little and try to dig up history from Rubygems, but you can also do this later. Otherwise this build is green, see my comments above. Lets finish it?

dblock commented 6 years ago

Merged. Thanks for your excellent work @saumyamehta17 and for hanging in there.

You can/should tackle the following next if you want that weren't blockers:

saumyamehta17 commented 6 years ago

Thanks. I will be working.

Regards, Saumya Mehta

On Fri, Jan 5, 2018 at 12:34 AM, Daniel Doubrovkine (dB.) @dblockdotorg < notifications@github.com> wrote:

Merged. Thanks for your excellent work @saumyamehta17 https://github.com/saumyamehta17 and for hanging in there.

You can/should tackle the following next if you want that weren't blockers:

  • Compatibility section needs to be updated in README. This gem now works for all the versions out of the box.
  • There's still code that says this gem is compatible with Mongoid 2 (Gemfile, .gemspec), however we no longer test against mongoid 2. Either put it back and have a passing build or remove it from everywhere.
  • Links to badges/Travis-CI/codeclimate look wrong in README.
  • Writing a CHANGELOG and re-adding Danger.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mongoid/mongoid-rspec/pull/197#issuecomment-355369384, or mute the thread https://github.com/notifications/unsubscribe-auth/AD169LK2RW_iZudUcfhgrRDjmk62CjUTks5tHSCggaJpZM4QTf7e .

khaight commented 6 years ago

Nice fix. FYI - I noticed that I needed to add the mongoid-compatibility gem to my Gemfile with this change.

  gem 'mongoid-compatibility', '~> 0.5.1'
  gem 'mongoid-rspec', github: 'mongoid-rspec/mongoid-rspec'

I see that it is included in the .gemspec file as a dependency, but my rails project did not pick it up. Maybe has something to do with including gem 'mongoid-rspec', github: 'mongoid-rspec/mongoid-rspec' in my group :test do block?

dblock commented 6 years ago

@khaight What happens without? You should raise a bug. We include that dependency in https://github.com/mongoid/mongoid-rspec/blob/master/mongoid-rspec.gemspec#L24 and it shouldn't be required.

aptx4869 commented 6 years ago

@dblock without adding mongoid-compatibility gem to Gemfile before mongoid-rspec will raise an uninitialized constant Mongoid::Compatibility error.

~/.rvm/gems/ruby-2.4.1/gems/bundler-1.16.1/lib/bundler/runtime.rb:84:in `rescue in block (2 levels) in require': There was an error
while trying to load the gem 'mongoid-rspec'.
Gem Load Error is: uninitialized constant Mongoid::Compatibility
Backtrace for gem load error is:
~/.rvm/gems/ruby-2.4.1/bundler/gems/mongoid-rspec-472f1460c23d/lib/mongoid/rspec.rb:8:in `<top (required)>'
~/.rvm/gems/ruby-2.4.1/bundler/gems/mongoid-rspec-472f1460c23d/lib/mongoid-rspec.rb:1:in `<top (required)>'
~/.rvm/gems/ruby-2.4.1/gems/bundler-1.16.1/lib/bundler/runtime.rb:81:in `require'
~/.rvm/gems/ruby-2.4.1/gems/bundler-1.16.1/lib/bundler/runtime.rb:81:in `block (2 levels) in require'
~/.rvm/gems/ruby-2.4.1/gems/bundler-1.16.1/lib/bundler/runtime.rb:76:in `each'
~/.rvm/gems/ruby-2.4.1/gems/bundler-1.16.1/lib/bundler/runtime.rb:76:in `block in require'
~/.rvm/gems/ruby-2.4.1/gems/bundler-1.16.1/lib/bundler/runtime.rb:65:in `each'
~/.rvm/gems/ruby-2.4.1/gems/bundler-1.16.1/lib/bundler/runtime.rb:65:in `require'
~/.rvm/gems/ruby-2.4.1/gems/bundler-1.16.1/lib/bundler.rb:114:in `require'
./config/application.rb:17:in `<top (required)>'
~/.rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/application.rb:92:in `require'
~/.rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/application.rb:92:in `preload'
~/.rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/application.rb:153:in `serve'
~/.rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/application.rb:141:in `block in run'
~/.rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/application.rb:135:in `loop'
~/.rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/application.rb:135:in `run'
~/.rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/application/boot.rb:19:in `<top (required)>'
~/.rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
~/.rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
-e:1:in `<main>'
Bundler Error Backtrace:
 (Bundler::GemRequireError)
        from ~/.rvm/gems/ruby-2.4.1/gems/bundler-1.16.1/lib/bundler/runtime.rb:80:in `block (2 levels) in require'
        from ~/.rvm/gems/ruby-2.4.1/gems/bundler-1.16.1/lib/bundler/runtime.rb:76:in `each'
        from ~/.rvm/gems/ruby-2.4.1/gems/bundler-1.16.1/lib/bundler/runtime.rb:76:in `block in require'
        from ~/.rvm/gems/ruby-2.4.1/gems/bundler-1.16.1/lib/bundler/runtime.rb:65:in `each'
        from ~/.rvm/gems/ruby-2.4.1/gems/bundler-1.16.1/lib/bundler/runtime.rb:65:in `require'
        from ~/.rvm/gems/ruby-2.4.1/gems/bundler-1.16.1/lib/bundler.rb:114:in `require'
        from ./config/application.rb:17:in `<top (required)>'
        from ~/.rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/application.rb:92:in `require'
        from ~/.rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/application.rb:92:in `preload'
        from ~/.rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/application.rb:153:in `serve'
        from ~/.rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/application.rb:141:in `block in run'
        from ~/.rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/application.rb:135:in `loop'
        from ~/.rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/application.rb:135:in `run'
        from ~/.rvm/gems/ruby-2.4.1/gems/spring-2.0.2/lib/spring/application/boot.rb:19:in `<top (required)>'
        from ~/.rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from ~/.rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from -e:1:in `<main>'
dblock commented 6 years ago

Looks legit. I opened https://github.com/mongoid/mongoid-rspec/issues/203. Would love some help with a fix @aptx4869. Also there're a few other open issues before we can release v. next like #201 #202, etc., any help appreciated.