-
Notifications
You must be signed in to change notification settings - Fork 369
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
Convert Rails tests to RSpec #846
Conversation
@@ -312,7 +312,6 @@ elsif Gem::Version.new('2.2.0') <= Gem::Version.new(RUBY_VERSION) \ | |||
appraise 'rails5-postgres-redis-activesupport' do | |||
gem 'rails', '~> 5.2.1' | |||
gem 'pg', '< 1.0', platform: :ruby | |||
gem 'redis-rails' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
redis-rails
functionality is now supported out of the box by Rails, since v5.2, effectively deprecating this gem since then: https://github.com/redis-store/redis-rails#a-quick-note-about-rails-52
@@ -12,7 +12,7 @@ desc 'Run RSpec' | |||
# rubocop:disable Metrics/BlockLength | |||
namespace :spec do | |||
task all: [:main, | |||
:rails, :railsredis, :railssidekiq, :railsactivejob, | |||
:rails, :railsredis, :railsactivejob, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:railssidekiq
had one file with no tests.
All relevant Rails+Sidekiq related tests have been merged with the :railsactivejob
task.
end | ||
end | ||
|
||
xcontext '#write' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's convert any xcontext
to context
.
|
||
# Re-configure the tracer with a new test writer | ||
# since priority sampling will wipe out the old test writer. | ||
unless @writer.is_a?(FauxWriter) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part of the code is super hairy; we'd like to get rid of it, probably with #879.
This PR converts most Rails tests from minitest to RSpec.
Also, added a few enhancements to
tracer_helpers.rb
to allow for easier assertions around tracer and span instances.Given this PR is already sizeable, I chose to defer the last couple large minitest files, to allow for easier reviewing.