-
-
Notifications
You must be signed in to change notification settings - Fork 235
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
RSpec 4 plan #61
Comments
The main thing I want from RSpec 4 is dropping old Ruby support. My plan is for us to release with Ruby 3, which is slated for Christmas 2020, it will make it so much easier to support if we don't have to support non keyword argument Ruby. |
Removing monkey patching mode (extracting it with Extra features can be added in point releases easily so anything thats ready can be shipped in 4 but I'm not going to gate them to hold out to make it "special". |
For the differ I didn't work on it that much. I am still following the work on @mcmire on https://github.com/mcmire/super_diff and I am wondering if telling to user that they can use super_diff easily or with rspec/rspec-expectations#1096 could be a good idea. 🤔 |
Updated the plan:
@benoittgt @JonRowe do you think we should fix kwargs delegation in 4.0, or can do it later? |
This has to be in a major version |
Sorry, I obviously wasn't clear. By "keep bundled" I mean that if we happen to extract Do you foresee any issues with this approach? |
In kwargs delegation. Is this rspec/rspec-mocks#1306 included? |
I've switched to the noisy 2.7.1 for everything, and have never seen this. 2.7.2 muted deprecation warnings. There are no build failures on 3.0 previews (apart from the missing warning on access to |
@JonRowe do you have a preference on how
is called, we make an attempt to require Should we consider The same applies to Mocks and its I can take a stab at extracting it. One (very minor) thing is the current non-additive behaviour of |
@pirj take my suggestion with a grain of salt (since I'm no longer working on RSpec!) but one idea is to remove the syntax option entirely. Instead:
In general, I think it's ideal for the core rspec gems to be blissfully unaware that |
Myron's approach is basically what I was going to recommend. If people requested it we could probably add an opt in config for I'd have one gem |
I want to fix the keyword argument issues we have before releasing 4.0, with Ruby 3 coming up in ... 10 days? It's an essential item for me. The problem we have is lack of specs using them. |
I also want to remove the monkey patching mode in 4.0. It's worth noting we could (to get 4.0 out quickly) remove things and maintain 3.x whilst building the extracted gems? |
@JonRowe How do you feel about (as the next chance might only be in a couple of years from now) of:
I can take care of those two. |
I'd say yes except they needs to use public APIs to be extracted, that might be difficult? |
@JonRowe I'd love to get a progress bar formatter included in RSpec 4 by default (ie Fuubar) I think that with with 10 years under its belt and 18.8 million downloads, it's proven itself a useful, general formatter rather than something bespoke. I think it would be a net positive for RSpec, especially considering the increased awareness (eg in I'm happy to continue supporting it but I'd love to get it into RSpec proper. The only thing it depends on is Also open to opening a dedicated issue to this if you think it's warranted. |
@jfelchner We are glad that Fuubar is part of the ecosystem for RSpec, and its a great example of how RSpec is extensible for such needs, but we are trying not to inflate RSpec too much, our goal is empower others to build things they want rather than offer them ourselves. (For the record 18.8 million downloads is fantastic, but its also at the time of writing around 3% of the downloads for rspec-core). |
I think my point was more that, if it were a part of core, it would be used by far more people as I would argue it is a much more information-dense outputter than the current built-in versions. But I understand where you're coming from. :) Thanks for all the work you all do! |
@jfelchner I was under the impression that we mention Fuubar in our configuration documentation, but I was wrong. Side note: It's a lesser-known feature, but RSpec is configurable with |
@pirj thank you so much! |
I agree (Thank you Myron for explaining better than I could until I've had ☕ 😂 ) |
You'll also be fighting against RuboCop's understanding of what's valid syntax and its check for the Ruby version being set properly in the gemspec. Not insurmountable, but it means you can't rely on RuboCop to get those right. Another thing: Dropping support for Ruby 2.3 would allow RSpec to start using Aruba 1.0 as well as some newer version of Cucumber for its Cucumber suites. |
I'm curious whats in Aruba that wouldn't work on Ruby 2.3? As long as you're not using the esoteric syntax operators (which theres plain ruby alternatives for) 2.3 was the start of the "2.x" period of stability and I've never seen something break on 2.3 that works on 2.4 etc. |
Nothing, really, although by now there would probably be a few syntax issues. I basically drew the line at some point before the 1.0 release. Note that Cucumber 5.2.0, mentioned in the roadmap above, even requires Ruby 2.5. |
Well that rules it out for us then. As a testing library we should support the highest amount of Rubyists we can. Dropping 30% to support 2.5+ is too many people left behind for my tastes. |
I agree in principle, but since those numbers are from a Ruby-on-Rails survey, perhaps those people are already left behind by Rails, and hence already used to using old versions of their dependencies? Perhaps something can be done to make the cucumber scenarios run with Aruba 1.0 + Cucumber 2, 3 or 4? That would allow supporting at least down to 2.4. I'm not fundamentally against adding support for 2.3 back for Aruba, but that does have two practical downsides:
|
@mvz Thanks for bringing this up. I've added Aruba update to post-4.0 plan 👍 |
Alternately, couldn't you just choose to not install and run rubocop on your 2.3 build? |
Indeed, as Myron implies thats what we do, we only install and run Rubocop on supported platforms. Potentially controversial suggestion, we could run Cucumber only on 2.5 or higher? Its main purpose is self executing documentation, so we could run it only on the newer Rubies... |
I could, but RuboCop will try to 'fix' things in a way that works with Ruby 2.4 and up. This means having to disable potentially useful cops, and more hand-holding when upgrading RuboCop dependencies. Because of this, I prefer downgrading RuboCop. By the way, I'm now working on a pull request to bring back Ruby 2.3 support to Aruba. I've solved the problem of getting Ruby 2.3 to install locally by updating Aruba's old Dockerfile. See cucumber/aruba#787. |
I'm a big fan of implicit block syntax and believe it makes for very readable tests, while also encouraging testing against one single subject as much as possible. If it can be extracted out to a gem, that'd be great. I was digging through this repo when helping a friend out with their issue and stumbled upon this one, so it was a slight shock to the system to know that the syntax I've been leaning on quite heavily is being deprecated. |
@boardfish Deprecated in 3.99, and restricted in 4.0. Check rspec/rspec-expectations#1285 and especially an attempt to restrict it in 3.8.5 for details and reasoning. |
See changes in rspec/rspec-metagem#61
See changes in rspec/rspec-metagem#61
It's been in the air and mostly in sparse @JonRowe's comments (1, 2). This is an attempt to gather the ideas and start the discussion.
Release step-by-step plan
pre-4.0:
expect_warn_deprecation
matches any message when there'sfail
in the example rspec-support#451should
(monkey and non-monkey), syntax config optionsshared_context_metadata_behavior
(discussion in Reconsidershared_context_metadata_behavior
rspec-core#2832)run_all_when_everything_filtered
should
Mocks syntaxallow_message_expectations_on_nil
example methodis_expected.to be
is a replacement forshould
, not justis_expected.to
)include_chain_clauses_in_custom_matcher_descriptions
[ ] deprecatecurrently_executing_a_context_hook
and recommend usingcurrent_scope
instead (Add RSpec.current_scope method to replacecurrently_executing_a_context_hook?
andself.inspect
hack rspec-core#2895)[ ] ?AnyInstance
[ ] ? DRb4.0.0:
EOLRuby versions 1.8.7 - 2.2 (Drop Ruby < 2.3 support rspec-core#2787 Drop Ruby < 2.3 support rspec-support#436 Drop Ruby < 2.3 support rspec-mocks#1349 Drop Ruby < 2.3 support rspec-expectations#1231).should
) (Scrape out monkey patching rspec-core#2803 et al., all interlinked)run_all_when_everything_filtered
(Removerun_all_when_everything_filtered
configuration option rspec-core#2845)shared_context_metadata_behavior
(Remove shared_context_metadata_behavior config option and make apply_to_host_groups the default rspec-core#2834)include_chain_clauses_in_custom_matcher_descriptions
(Removeinclude_chain_clauses_in_custom_matcher_descriptions
option rspec-expectations#1279):example_group
example metadata sub-hash (Remove deprecated:example_group
example metadata sub-hash rspec-core#2851)allow_message_expectations_on_nil
example method (Remove deprecatedallow_message_expectations_on_nil
example method rspec-mocks#1410)match_regex
matcher andStartAndEndWith
matcher base class from Expectations (Remove a couple of remaining deprecations rspec-expectations#1288)[ ] Removecurrently_executing_a_context_hook?
(Remove deprecatedcurrently_executing_a_context_hook?
rspec-core#2911)strict_predicate_matchers
(Turn strict_predicate_matchers on by default rspec-expectations#1277)verify_partial_doubles = true
(Verify partial doubles by default rspec-mocks#1409)[ ] Remove DRb runner (Remove DRb client runner rspec-core#2866)post-4.0
rspec-rails
/rspec-collection_matchers
/rspec-its
to support RSpec 4.should
to a gemdescribe
- >RSpec.describe
?)--no-document
forgem
unindent
/dedent
-><<~
rubocop
passes while there are offences inlib
(core, probably others too)TargetRubyVersion
for RuboCop, and bump to latest (that supports parsing 2.4, which even the edge should)minimum_coverage
diff-lcs
)Ruby support
EOL Ruby means we support 2.5+, since 2.4 is EOL in April 2020
However, according to 2020 RoR community survey
70% use 2.5+
81% use 2.4+
89% use 2.3+
Do 2.3 and 2.4 cause any trouble? I could only find this:
I can only think of RuboCop's
TargetRubyVersion
setting that has a minimum of 2.4. That means we won't be able to runrubocop
on 2.3 CI build.More on this in https://github.com/rspec/rspec/issues/25
Remove deprecated features/Introduce new defaults
shared_context_metadata_behavior
should
syntax (with implicit receiver only, whereshould
can be backed byis_expected.to
. extract to a gem?)Consider deprecating long-hanging/obscure features
[ ] DRb runner. I only know of Spork that was using it, but its 2.0.0-rc is years old now with no signs of lifeCleanup
rspec-core
: "Ruby 1.9 has a bug that can lead to infinite recursion and a"Drafted in commits: ce2f4a0b 123e6ee7
Drop Ruby < 2.3 support rspec-core#2787 (review)
for all repos
~> 5.2.0
, cucumber-ruby (undefined methodwith_filtered_backtrace') + fix deprec
titleto
name`[]' for nil:NilClass (NoMethodError) /Users/pirj/.rvm/gems/ruby-2.7.1@rspec-core/gems/cucumber-1.3.20/lib/cucumber/core_ext/proc.rb:17:in
file_colon_line'diff-lcs (< 1.4, >= 1.3, ~> 1.3)
, while we depend on= 1.4.4
Found tags option '~@wip'. '~@tag' is no longer supported, use 'not @tag' instead
yes | gem update --system --no-document
yes | gem install bundler --no-document
also on sub-builds?
e.g. core: simplecov, test-unit, aruba, rake
To my best knowledge, add_development_dependency only affects local bundling. I've moved it over from the Gemfile.
As far as I understand we can shuffle those dependencies between add_development_dependency and Gemfile without affecting anything.
To me, it's better to keep those gems that we directly depend on here, while reserving the Gemfile to add version constraints for third-party dependencies like ffi and those that require a conditional, e.g.
if RUBY_VERSION >= '2.4'
frozen string literal - run with --only Style/FrozenStringLiteralComment, why it doesn't detect offences without --only?
lib/rspec/core/backport_random.rb excluded
kwargs delegation
The text was updated successfully, but these errors were encountered: