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

Update database_cleaner #125

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Update database_cleaner #125

wants to merge 7 commits into from

Conversation

ronaldtse
Copy link
Contributor

No description provided.

Copy link

@hound hound bot left a comment

Choose a reason for hiding this comment

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

Some files could not be reviewed due to errors:

Error: unrecognized cop Rails found in .rubocop.yml
Error: unrecognized cop Rails found in .rubocop.yml

@codecov
Copy link

codecov bot commented Dec 22, 2021

Codecov Report

Merging #125 (547118b) into master (05144a7) will not change coverage.
The diff coverage is 100.00%.

❗ Current head 547118b differs from pull request most recent head a69a497. Consider uploading reports for the commit a69a497 to get more accurate results
Impacted file tree graph

@@           Coverage Diff           @@
##           master     #125   +/-   ##
=======================================
  Coverage   99.48%   99.48%           
=======================================
  Files          26       26           
  Lines         388      388           
=======================================
  Hits          386      386           
  Misses          2        2           
Impacted Files Coverage Δ
spec/support/db_cleaner.rb 100.00% <100.00%> (ø)
lib/attr_masker/model.rb 94.73% <0.00%> (-0.27%) ⬇️
lib/attr_masker/attribute.rb 100.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 05144a7...a69a497. Read the comment docs.

Upgrading Database Cleaner to version 2.x required some configuration
changes:

- "Truncation" strategy for Mongoid has been renamed to "deletion".
- "Only" configuration option now requires an array.
Use DatabaseCleaner::clean rather than DatabaseCleaner::clean_with,
as it honors adapter configuration.
Copy link

@hound hound bot left a comment

Choose a reason for hiding this comment

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

Some files could not be reviewed due to errors:

Error: unrecognized cop Rails found in .rubocop.yml
Error: unrecognized cop Rails found in .rubocop.yml

@ronaldtse
Copy link
Contributor Author

There are issues that need resolving if we upgrade database_cleaner:

  Bundler could not find compatible versions for gem "activerecord":
    In Rails-4.2.gemfile:
      activerecord (~> 4.2.0)
  
  database_cleaner-active_record (~> 2.0) was resolved to 2.0.1, which depends
  on
        activerecord (>= 5.a)
  Took   2.70 seconds

This means we need to drop Rails 4 and Ruby 2.4. Which is fine? Ping @ribose-jeffreylau .

Copy link

@hound hound bot left a comment

Choose a reason for hiding this comment

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

Some files could not be reviewed due to errors:

Error: unrecognized cop Rails found in .rubocop.yml
Error: unrecognized cop Rails found in .rubocop.yml

Copy link

@hound hound bot left a comment

Choose a reason for hiding this comment

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

Some files could not be reviewed due to errors:

Error: unrecognized cop Rails found in .rubocop.yml
Error: unrecognized cop Rails found in .rubocop.yml

Copy link

@hound hound bot left a comment

Choose a reason for hiding this comment

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

Some files could not be reviewed due to errors:

Error: unrecognized cop Rails found in .rubocop.yml
Error: unrecognized cop Rails found in .rubocop.yml

Copy link

@hound hound bot left a comment

Choose a reason for hiding this comment

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

Some files could not be reviewed due to errors:

Error: unrecognized cop Rails found in .rubocop.yml
Error: unrecognized cop Rails found in .rubocop.yml

@ronaldtse
Copy link
Contributor Author

The remaining failures are all in w/o activerecord jobs, where ActiveRecord is not supposed to be loaded, but the spec doesn't skip the ActiveRecord-related specs.

e.g.

  1) Attr Masker gem when used with ActiveRecord Masking a single text attribute with default options
     Failure/Error:
       create_table(:users, force: true) do |t|
         t.string :first_name
         t.string :last_name
         t.string :email
         t.text :avatar
         t.timestamps null: false
       end

     ActiveRecord::ConnectionNotEstablished:
       No connection pool for 'ActiveRecord::Base' found.
     Shared Example Group: "Attr Masker gem feature specs" called from ./spec/features/active_record_spec.rb:95
     # ./vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:1125:in `retrieve_connection'

Seems related to: rspec/rspec-core#2603

@ronaldtse
Copy link
Contributor Author

#123 is dependent on this PR as DatabaseCleaner 2.0+ provides Rails 7 support.

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.

3 participants