ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:102301] [Ruby master Bug#17591] Test frameworks and REPLs do not show deprecation warnings by default
@ 2021-01-29 12:57 eregontp
  2021-01-29 13:01 ` [ruby-core:102303] " eregontp
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: eregontp @ 2021-01-29 12:57 UTC (permalink / raw)
  To: ruby-core

Issue #17591 has been reported by Eregon (Benoit Daloze).

----------------------------------------
Bug #17591: Test frameworks and REPLs do not show deprecation warnings by default
https://bugs.ruby-lang.org/issues/17591

* Author: Eregon (Benoit Daloze)
* Status: Open
* Priority: Normal
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN
----------------------------------------
Various people in #16345 said that:
> The issue can be mitigated if all test frameworks enable all deprecation warnings.
> The developer's practice can be supported by tools, such as test frameworks enable deprecation warnings automatically.

And this was used as a base to disable deprecation warnings by default in Ruby 2.7.2.

However, it seems no test frameworks or REPLs actually show deprecation warnings by default!
So Ruby developers will typically never see deprecation warnings for keyword arguments, and it will just break when they try Ruby 3.0.

I think only MSpec does `Warning[:deprecated] = true`, whether or not `-w` is passed, which seems the right thing to do.

Currently, RSpec enables `Warning[:deprecated] = true` only for `rspec -w`.

Same for `test/unit` 3.3.4 shipped with 2.7.2.

IRB in 2.7.2 does not show deprecated warnings.
Same for `pry`.

I think ruby-core needs to have a clear message here, like:
> All test frameworks and REPLs should include this snippet and run it before running tests: `Warning[:deprecated] = true if Warning.respond_to?(:[]=)`.
> This is important so that developers see warnings in development, and that they see the warnings before updating to the next Ruby version.
> Developers can choose to disable deprecation warnings explicitly if they want with `Warning[:deprecated] = false`.

And I think it would be good that ruby-core makes a PR or an issue to the main test frameworks/REPLs to show examples.

P.S.: if someone wants to disable all warnings with `-W0` or `$VERBOSE = nil`, it will indeed disable them all, including deprecation warnings, so there is no need to check `$VERBOSE` for setting `Warning[:deprecated] = true`.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [ruby-core:102303] [Ruby master Bug#17591] Test frameworks and REPLs do not show deprecation warnings by default
  2021-01-29 12:57 [ruby-core:102301] [Ruby master Bug#17591] Test frameworks and REPLs do not show deprecation warnings by default eregontp
@ 2021-01-29 13:01 ` eregontp
  2021-01-29 21:59 ` [ruby-core:102312] " kou
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: eregontp @ 2021-01-29 13:01 UTC (permalink / raw)
  To: ruby-core

Issue #17591 has been updated by Eregon (Benoit Daloze).


One worrying issue is even if we fix the main test frameworks and REPLs, it won't apply for those shipped in the stdlib in 2.7.2.
But maybe 2.7.3 could pick such changes, so at least users updating to latest 2.7.x would get deprecation warnings in IRB and in test/unit?

----------------------------------------
Bug #17591: Test frameworks and REPLs do not show deprecation warnings by default
https://bugs.ruby-lang.org/issues/17591#change-90161

* Author: Eregon (Benoit Daloze)
* Status: Open
* Priority: Normal
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN
----------------------------------------
Various people in #16345 said that:
> The issue can be mitigated if all test frameworks enable all deprecation warnings.
> The developer's practice can be supported by tools, such as test frameworks enable deprecation warnings automatically.

And this was used as a base to disable deprecation warnings by default in Ruby 2.7.2.

However, it seems no test frameworks or REPLs actually show deprecation warnings by default!
So Ruby developers will typically never see deprecation warnings for keyword arguments, and it will just break when they try Ruby 3.0.

I think only MSpec does `Warning[:deprecated] = true`, whether or not `-w` is passed, which seems the right thing to do.

Currently, RSpec enables `Warning[:deprecated] = true` only for `rspec -w`.

Same for `test/unit` 3.3.4 shipped with 2.7.2.

IRB in 2.7.2 does not show deprecated warnings.
Same for `pry`.

I think ruby-core needs to have a clear message here, like:
> All test frameworks and REPLs should include this snippet and run it before running tests: `Warning[:deprecated] = true if Warning.respond_to?(:[]=)`.
> This is important so that developers see warnings in development, and that they see the warnings before updating to the next Ruby version.
> Developers can choose to disable deprecation warnings explicitly if they want with `Warning[:deprecated] = false`.

And I think it would be good that ruby-core makes a PR or an issue to the main test frameworks/REPLs to show examples.

P.S.: if someone wants to disable all warnings with `-W0` or `$VERBOSE = nil`, it will indeed disable them all, including deprecation warnings, so there is no need to check `$VERBOSE` for setting `Warning[:deprecated] = true`.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [ruby-core:102312] [Ruby master Bug#17591] Test frameworks and REPLs do not show deprecation warnings by default
  2021-01-29 12:57 [ruby-core:102301] [Ruby master Bug#17591] Test frameworks and REPLs do not show deprecation warnings by default eregontp
  2021-01-29 13:01 ` [ruby-core:102303] " eregontp
@ 2021-01-29 21:59 ` kou
  2021-02-16  6:56 ` [ruby-core:102521] [Ruby master Misc#17591] " aycabta
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: kou @ 2021-01-29 21:59 UTC (permalink / raw)
  To: ruby-core

Issue #17591 has been updated by kou (Kouhei Sutou).


test-unit 3.4.0 enables it by default.

----------------------------------------
Bug #17591: Test frameworks and REPLs do not show deprecation warnings by default
https://bugs.ruby-lang.org/issues/17591#change-90168

* Author: Eregon (Benoit Daloze)
* Status: Open
* Priority: Normal
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN
----------------------------------------
Various people in #16345 said that:
> The issue can be mitigated if all test frameworks enable all deprecation warnings.
> The developer's practice can be supported by tools, such as test frameworks enable deprecation warnings automatically.

And this was used as a base to disable deprecation warnings by default in Ruby 2.7.2.

However, it seems no test frameworks or REPLs actually show deprecation warnings by default!
So Ruby developers will typically never see deprecation warnings for keyword arguments, and it will just break when they try Ruby 3.0.

I think only MSpec does `Warning[:deprecated] = true`, whether or not `-w` is passed, which seems the right thing to do.

Currently, RSpec enables `Warning[:deprecated] = true` only for `rspec -w`.

Same for `test/unit` 3.3.4 shipped with 2.7.2.

IRB in 2.7.2 does not show deprecated warnings.
Same for `pry`.

I think ruby-core needs to have a clear message here, like:
> All test frameworks and REPLs should include this snippet and run it before running tests: `Warning[:deprecated] = true if Warning.respond_to?(:[]=)`.
> This is important so that developers see warnings in development, and that they see the warnings before updating to the next Ruby version.
> Developers can choose to disable deprecation warnings explicitly if they want with `Warning[:deprecated] = false`.

And I think it would be good that ruby-core makes a PR or an issue to the main test frameworks/REPLs to show examples.

P.S.: if someone wants to disable all warnings with `-W0` or `$VERBOSE = nil`, it will indeed disable them all, including deprecation warnings, so there is no need to check `$VERBOSE` for setting `Warning[:deprecated] = true`.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [ruby-core:102521] [Ruby master Misc#17591] Test frameworks and REPLs do not show deprecation warnings by default
  2021-01-29 12:57 [ruby-core:102301] [Ruby master Bug#17591] Test frameworks and REPLs do not show deprecation warnings by default eregontp
  2021-01-29 13:01 ` [ruby-core:102303] " eregontp
  2021-01-29 21:59 ` [ruby-core:102312] " kou
@ 2021-02-16  6:56 ` aycabta
  2021-02-16 12:19 ` [ruby-core:102534] " eregontp
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: aycabta @ 2021-02-16  6:56 UTC (permalink / raw)
  To: ruby-core

Issue #17591 has been updated by aycabta (aycabta .).


IRB is often used by beginners for learning purposes, so I disagree.

----------------------------------------
Misc #17591: Test frameworks and REPLs do not show deprecation warnings by default
https://bugs.ruby-lang.org/issues/17591#change-90417

* Author: Eregon (Benoit Daloze)
* Status: Open
* Priority: Normal
----------------------------------------
Various people in #16345 said that:
> The issue can be mitigated if all test frameworks enable all deprecation warnings.
> The developer's practice can be supported by tools, such as test frameworks enable deprecation warnings automatically.

And this was used as a base to disable deprecation warnings by default in Ruby 2.7.2.

However, it seems no test frameworks or REPLs actually show deprecation warnings by default!
So Ruby developers will typically never see deprecation warnings for keyword arguments, and it will just break when they try Ruby 3.0.

I think only MSpec does `Warning[:deprecated] = true`, whether or not `-w` is passed, which seems the right thing to do.

Currently, RSpec enables `Warning[:deprecated] = true` only for `rspec -w`.

Same for `test/unit` 3.3.4 shipped with 2.7.2.

IRB in 2.7.2 does not show deprecated warnings.
Same for `pry`.

I think ruby-core needs to have a clear message here, like:
> All test frameworks and REPLs should include this snippet and run it before running tests: `Warning[:deprecated] = true if Warning.respond_to?(:[]=)`.
> This is important so that developers see warnings in development, and that they see the warnings before updating to the next Ruby version.
> Developers can choose to disable deprecation warnings explicitly if they want with `Warning[:deprecated] = false`.

And I think it would be good that ruby-core makes a PR or an issue to the main test frameworks/REPLs to show examples.

P.S.: if someone wants to disable all warnings with `-W0` or `$VERBOSE = nil`, it will indeed disable them all, including deprecation warnings, so there is no need to check `$VERBOSE` for setting `Warning[:deprecated] = true`.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [ruby-core:102534] [Ruby master Misc#17591] Test frameworks and REPLs do not show deprecation warnings by default
  2021-01-29 12:57 [ruby-core:102301] [Ruby master Bug#17591] Test frameworks and REPLs do not show deprecation warnings by default eregontp
                   ` (2 preceding siblings ...)
  2021-02-16  6:56 ` [ruby-core:102521] [Ruby master Misc#17591] " aycabta
@ 2021-02-16 12:19 ` eregontp
  2021-02-16 12:26 ` [ruby-core:102535] " eregontp
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: eregontp @ 2021-02-16 12:19 UTC (permalink / raw)
  To: ruby-core

Issue #17591 has been updated by Eregon (Benoit Daloze).


kou (Kouhei Sutou) wrote in #note-4:
> test-unit 3.4.0 enables it by default.

Great to hear!

I wonder if it would make sense to include test-unit 3.4.0 in the next Ruby 2.7 release (e.g., 2.7.3)?
Do you know if test/unit users typically use the stdlib version or a newer version from the Gemfile?

---

I filed an issue for RSpec: https://github.com/rspec/rspec-core/issues/2867

----------------------------------------
Misc #17591: Test frameworks and REPLs do not show deprecation warnings by default
https://bugs.ruby-lang.org/issues/17591#change-90434

* Author: Eregon (Benoit Daloze)
* Status: Open
* Priority: Normal
----------------------------------------
Various people in #16345 said that:
> The issue can be mitigated if all test frameworks enable all deprecation warnings.
> The developer's practice can be supported by tools, such as test frameworks enable deprecation warnings automatically.

And this was used as a base to disable deprecation warnings by default in Ruby 2.7.2.

However, it seems no test frameworks or REPLs actually show deprecation warnings by default!
So Ruby developers will typically never see deprecation warnings for keyword arguments, and it will just break when they try Ruby 3.0.

I think only MSpec does `Warning[:deprecated] = true`, whether or not `-w` is passed, which seems the right thing to do.

Currently, RSpec enables `Warning[:deprecated] = true` only for `rspec -w`.

Same for `test/unit` 3.3.4 shipped with 2.7.2.

IRB in 2.7.2 does not show deprecated warnings.
Same for `pry`.

I think ruby-core needs to have a clear message here, like:
> All test frameworks and REPLs should include this snippet and run it before running tests: `Warning[:deprecated] = true if Warning.respond_to?(:[]=)`.
> This is important so that developers see warnings in development, and that they see the warnings before updating to the next Ruby version.
> Developers can choose to disable deprecation warnings explicitly if they want with `Warning[:deprecated] = false`.

And I think it would be good that ruby-core makes a PR or an issue to the main test frameworks/REPLs to show examples.

P.S.: if someone wants to disable all warnings with `-W0` or `$VERBOSE = nil`, it will indeed disable them all, including deprecation warnings, so there is no need to check `$VERBOSE` for setting `Warning[:deprecated] = true`.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [ruby-core:102535] [Ruby master Misc#17591] Test frameworks and REPLs do not show deprecation warnings by default
  2021-01-29 12:57 [ruby-core:102301] [Ruby master Bug#17591] Test frameworks and REPLs do not show deprecation warnings by default eregontp
                   ` (3 preceding siblings ...)
  2021-02-16 12:19 ` [ruby-core:102534] " eregontp
@ 2021-02-16 12:26 ` eregontp
  2021-02-16 12:31 ` [ruby-core:102536] " eregontp
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: eregontp @ 2021-02-16 12:26 UTC (permalink / raw)
  To: ruby-core

Issue #17591 has been updated by Eregon (Benoit Daloze).


aycabta (aycabta .) wrote in #note-6:
> IRB is often used by beginners for learning purposes, so I disagree.

I think a warning when using an experimental feature in IRB is a good thing.
For example, if one uses Ractor and that later leads to a SEGV, as least there is hint, vs not showing anything, which the user will likely blame on IRB.

IRB is also used by experienced Rubyists to see if a given approach works well.
In that case I think it is important to show deprecation warnings, as they might need to reconsider the approach based on that.

Maybe @akr can comment too, since he suggested irb/pry should show deprecation warnings? (in https://bugs.ruby-lang.org/issues/16345#note-31)

----------------------------------------
Misc #17591: Test frameworks and REPLs do not show deprecation warnings by default
https://bugs.ruby-lang.org/issues/17591#change-90435

* Author: Eregon (Benoit Daloze)
* Status: Open
* Priority: Normal
----------------------------------------
Various people in #16345 said that:
> The issue can be mitigated if all test frameworks enable all deprecation warnings.
> The developer's practice can be supported by tools, such as test frameworks enable deprecation warnings automatically.

And this was used as a base to disable deprecation warnings by default in Ruby 2.7.2.

However, it seems no test frameworks or REPLs actually show deprecation warnings by default!
So Ruby developers will typically never see deprecation warnings for keyword arguments, and it will just break when they try Ruby 3.0.

I think only MSpec does `Warning[:deprecated] = true`, whether or not `-w` is passed, which seems the right thing to do.

Currently, RSpec enables `Warning[:deprecated] = true` only for `rspec -w`.

Same for `test/unit` 3.3.4 shipped with 2.7.2.

IRB in 2.7.2 does not show deprecated warnings.
Same for `pry`.

I think ruby-core needs to have a clear message here, like:
> All test frameworks and REPLs should include this snippet and run it before running tests: `Warning[:deprecated] = true if Warning.respond_to?(:[]=)`.
> This is important so that developers see warnings in development, and that they see the warnings before updating to the next Ruby version.
> Developers can choose to disable deprecation warnings explicitly if they want with `Warning[:deprecated] = false`.

And I think it would be good that ruby-core makes a PR or an issue to the main test frameworks/REPLs to show examples.

P.S.: if someone wants to disable all warnings with `-W0` or `$VERBOSE = nil`, it will indeed disable them all, including deprecation warnings, so there is no need to check `$VERBOSE` for setting `Warning[:deprecated] = true`.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [ruby-core:102536] [Ruby master Misc#17591] Test frameworks and REPLs do not show deprecation warnings by default
  2021-01-29 12:57 [ruby-core:102301] [Ruby master Bug#17591] Test frameworks and REPLs do not show deprecation warnings by default eregontp
                   ` (4 preceding siblings ...)
  2021-02-16 12:26 ` [ruby-core:102535] " eregontp
@ 2021-02-16 12:31 ` eregontp
  2021-02-17  8:06 ` [ruby-core:102552] " kou
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: eregontp @ 2021-02-16 12:31 UTC (permalink / raw)
  To: ruby-core

Issue #17591 has been updated by Eregon (Benoit Daloze).


I mixed experimental and deprecation warnings in my comment just above, sorry for that.
Experimental warnings are already shown in IRB, as they should.

I think deprecation warnings should also be shown in IRB/REPLs in general, if a developer tries some code that is deprecated, they should know about it early, rather than having that code break on the next Ruby version.

----------------------------------------
Misc #17591: Test frameworks and REPLs do not show deprecation warnings by default
https://bugs.ruby-lang.org/issues/17591#change-90436

* Author: Eregon (Benoit Daloze)
* Status: Open
* Priority: Normal
----------------------------------------
Various people in #16345 said that:
> The issue can be mitigated if all test frameworks enable all deprecation warnings.
> The developer's practice can be supported by tools, such as test frameworks enable deprecation warnings automatically.

And this was used as a base to disable deprecation warnings by default in Ruby 2.7.2.

However, it seems no test frameworks or REPLs actually show deprecation warnings by default!
So Ruby developers will typically never see deprecation warnings for keyword arguments, and it will just break when they try Ruby 3.0.

I think only MSpec does `Warning[:deprecated] = true`, whether or not `-w` is passed, which seems the right thing to do.

Currently, RSpec enables `Warning[:deprecated] = true` only for `rspec -w`.

Same for `test/unit` 3.3.4 shipped with 2.7.2.

IRB in 2.7.2 does not show deprecated warnings.
Same for `pry`.

I think ruby-core needs to have a clear message here, like:
> All test frameworks and REPLs should include this snippet and run it before running tests: `Warning[:deprecated] = true if Warning.respond_to?(:[]=)`.
> This is important so that developers see warnings in development, and that they see the warnings before updating to the next Ruby version.
> Developers can choose to disable deprecation warnings explicitly if they want with `Warning[:deprecated] = false`.

And I think it would be good that ruby-core makes a PR or an issue to the main test frameworks/REPLs to show examples.

P.S.: if someone wants to disable all warnings with `-W0` or `$VERBOSE = nil`, it will indeed disable them all, including deprecation warnings, so there is no need to check `$VERBOSE` for setting `Warning[:deprecated] = true`.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [ruby-core:102552] [Ruby master Misc#17591] Test frameworks and REPLs do not show deprecation warnings by default
  2021-01-29 12:57 [ruby-core:102301] [Ruby master Bug#17591] Test frameworks and REPLs do not show deprecation warnings by default eregontp
                   ` (5 preceding siblings ...)
  2021-02-16 12:31 ` [ruby-core:102536] " eregontp
@ 2021-02-17  8:06 ` kou
  2021-02-17  8:47 ` [ruby-core:102554] " nagachika00
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: kou @ 2021-02-17  8:06 UTC (permalink / raw)
  To: ruby-core

Issue #17591 has been updated by kou (Kouhei Sutou).


> I wonder if it would make sense to include test-unit 3.4.0 in the next Ruby 2.7 release (e.g., 2.7.3)?

@nagachika What do you think about

> Do you know if test/unit users typically use the stdlib version or a newer version from the Gemfile?

Maybe most users specify `gem "test-unit"` in their Gemfile. If an user uses Gemfile, the user can't use test-unit without specifying `gem "test-unit"` in Gemfile. Maybe many users are using Gemfile.

----------------------------------------
Misc #17591: Test frameworks and REPLs do not show deprecation warnings by default
https://bugs.ruby-lang.org/issues/17591#change-90454

* Author: Eregon (Benoit Daloze)
* Status: Open
* Priority: Normal
----------------------------------------
Various people in #16345 said that:
> The issue can be mitigated if all test frameworks enable all deprecation warnings.
> The developer's practice can be supported by tools, such as test frameworks enable deprecation warnings automatically.

And this was used as a base to disable deprecation warnings by default in Ruby 2.7.2.

However, it seems no test frameworks or REPLs actually show deprecation warnings by default!
So Ruby developers will typically never see deprecation warnings for keyword arguments, and it will just break when they try Ruby 3.0.

I think only MSpec does `Warning[:deprecated] = true`, whether or not `-w` is passed, which seems the right thing to do.

Currently, RSpec enables `Warning[:deprecated] = true` only for `rspec -w`.

Same for `test/unit` 3.3.4 shipped with 2.7.2.

IRB in 2.7.2 does not show deprecated warnings.
Same for `pry`.

I think ruby-core needs to have a clear message here, like:
> All test frameworks and REPLs should include this snippet and run it before running tests: `Warning[:deprecated] = true if Warning.respond_to?(:[]=)`.
> This is important so that developers see warnings in development, and that they see the warnings before updating to the next Ruby version.
> Developers can choose to disable deprecation warnings explicitly if they want with `Warning[:deprecated] = false`.

And I think it would be good that ruby-core makes a PR or an issue to the main test frameworks/REPLs to show examples.

P.S.: if someone wants to disable all warnings with `-W0` or `$VERBOSE = nil`, it will indeed disable them all, including deprecation warnings, so there is no need to check `$VERBOSE` for setting `Warning[:deprecated] = true`.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [ruby-core:102554] [Ruby master Misc#17591] Test frameworks and REPLs do not show deprecation warnings by default
  2021-01-29 12:57 [ruby-core:102301] [Ruby master Bug#17591] Test frameworks and REPLs do not show deprecation warnings by default eregontp
                   ` (6 preceding siblings ...)
  2021-02-17  8:06 ` [ruby-core:102552] " kou
@ 2021-02-17  8:47 ` nagachika00
  2021-02-17  8:56 ` [ruby-core:102556] " nobu
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: nagachika00 @ 2021-02-17  8:47 UTC (permalink / raw)
  To: ruby-core

Issue #17591 has been updated by nagachika (Tomoyuki Chikanaga).


> > I wonder if it would make sense to include test-unit 3.4.0 in the next Ruby 2.7 release (e.g., 2.7.3)?
> 
> nagachika (Tomoyuki Chikanaga) What do you think about

In principle I bump up the version of bundle gems only for security fixes.
The users can specify test-unit in Gemfile if thier projects use it, and they should do so.
I don't think the bundled test-unit version is not critical in this context.

----------------------------------------
Misc #17591: Test frameworks and REPLs do not show deprecation warnings by default
https://bugs.ruby-lang.org/issues/17591#change-90456

* Author: Eregon (Benoit Daloze)
* Status: Open
* Priority: Normal
----------------------------------------
Various people in #16345 said that:
> The issue can be mitigated if all test frameworks enable all deprecation warnings.
> The developer's practice can be supported by tools, such as test frameworks enable deprecation warnings automatically.

And this was used as a base to disable deprecation warnings by default in Ruby 2.7.2.

However, it seems no test frameworks or REPLs actually show deprecation warnings by default!
So Ruby developers will typically never see deprecation warnings for keyword arguments, and it will just break when they try Ruby 3.0.

I think only MSpec does `Warning[:deprecated] = true`, whether or not `-w` is passed, which seems the right thing to do.

Currently, RSpec enables `Warning[:deprecated] = true` only for `rspec -w`.

Same for `test/unit` 3.3.4 shipped with 2.7.2.

IRB in 2.7.2 does not show deprecated warnings.
Same for `pry`.

I think ruby-core needs to have a clear message here, like:
> All test frameworks and REPLs should include this snippet and run it before running tests: `Warning[:deprecated] = true if Warning.respond_to?(:[]=)`.
> This is important so that developers see warnings in development, and that they see the warnings before updating to the next Ruby version.
> Developers can choose to disable deprecation warnings explicitly if they want with `Warning[:deprecated] = false`.

And I think it would be good that ruby-core makes a PR or an issue to the main test frameworks/REPLs to show examples.

P.S.: if someone wants to disable all warnings with `-W0` or `$VERBOSE = nil`, it will indeed disable them all, including deprecation warnings, so there is no need to check `$VERBOSE` for setting `Warning[:deprecated] = true`.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [ruby-core:102556] [Ruby master Misc#17591] Test frameworks and REPLs do not show deprecation warnings by default
  2021-01-29 12:57 [ruby-core:102301] [Ruby master Bug#17591] Test frameworks and REPLs do not show deprecation warnings by default eregontp
                   ` (7 preceding siblings ...)
  2021-02-17  8:47 ` [ruby-core:102554] " nagachika00
@ 2021-02-17  8:56 ` nobu
  2021-02-17  9:06 ` [ruby-core:102557] " kou
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: nobu @ 2021-02-17  8:56 UTC (permalink / raw)
  To: ruby-core

Issue #17591 has been updated by nobu (Nobuyoshi Nakada).


kou (Kouhei Sutou) wrote in #note-10:
> Maybe most users specify `gem "test-unit"` in their Gemfile. If an user uses Gemfile, the user can't use test-unit without specifying `gem "test-unit"` in Gemfile. Maybe many users are using Gemfile.

Off topic:
Bundler (rubygems?) ignores already installed gems (default/bundled/system/user) when Gemfile exists.
Is it the intentional behavior?

----------------------------------------
Misc #17591: Test frameworks and REPLs do not show deprecation warnings by default
https://bugs.ruby-lang.org/issues/17591#change-90458

* Author: Eregon (Benoit Daloze)
* Status: Open
* Priority: Normal
----------------------------------------
Various people in #16345 said that:
> The issue can be mitigated if all test frameworks enable all deprecation warnings.
> The developer's practice can be supported by tools, such as test frameworks enable deprecation warnings automatically.

And this was used as a base to disable deprecation warnings by default in Ruby 2.7.2.

However, it seems no test frameworks or REPLs actually show deprecation warnings by default!
So Ruby developers will typically never see deprecation warnings for keyword arguments, and it will just break when they try Ruby 3.0.

I think only MSpec does `Warning[:deprecated] = true`, whether or not `-w` is passed, which seems the right thing to do.

Currently, RSpec enables `Warning[:deprecated] = true` only for `rspec -w`.

Same for `test/unit` 3.3.4 shipped with 2.7.2.

IRB in 2.7.2 does not show deprecated warnings.
Same for `pry`.

I think ruby-core needs to have a clear message here, like:
> All test frameworks and REPLs should include this snippet and run it before running tests: `Warning[:deprecated] = true if Warning.respond_to?(:[]=)`.
> This is important so that developers see warnings in development, and that they see the warnings before updating to the next Ruby version.
> Developers can choose to disable deprecation warnings explicitly if they want with `Warning[:deprecated] = false`.

And I think it would be good that ruby-core makes a PR or an issue to the main test frameworks/REPLs to show examples.

P.S.: if someone wants to disable all warnings with `-W0` or `$VERBOSE = nil`, it will indeed disable them all, including deprecation warnings, so there is no need to check `$VERBOSE` for setting `Warning[:deprecated] = true`.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [ruby-core:102557] [Ruby master Misc#17591] Test frameworks and REPLs do not show deprecation warnings by default
  2021-01-29 12:57 [ruby-core:102301] [Ruby master Bug#17591] Test frameworks and REPLs do not show deprecation warnings by default eregontp
                   ` (8 preceding siblings ...)
  2021-02-17  8:56 ` [ruby-core:102556] " nobu
@ 2021-02-17  9:06 ` kou
  2022-09-03 13:57 ` [ruby-core:109832] " Eregon (Benoit Daloze)
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: kou @ 2021-02-17  9:06 UTC (permalink / raw)
  To: ruby-core

Issue #17591 has been updated by kou (Kouhei Sutou).


nobu (Nobuyoshi Nakada) wrote in #note-12:

> Off topic:
> Bundler (rubygems?) ignores already installed gems (default/bundled/system/user) when Gemfile exists.
> Is it the intentional behavior?

The ignored gems are not in the `Gemfile`?
If so, it's intentional. Bundler loads only listed gems.

----------------------------------------
Misc #17591: Test frameworks and REPLs do not show deprecation warnings by default
https://bugs.ruby-lang.org/issues/17591#change-90459

* Author: Eregon (Benoit Daloze)
* Status: Open
* Priority: Normal
----------------------------------------
Various people in #16345 said that:
> The issue can be mitigated if all test frameworks enable all deprecation warnings.
> The developer's practice can be supported by tools, such as test frameworks enable deprecation warnings automatically.

And this was used as a base to disable deprecation warnings by default in Ruby 2.7.2.

However, it seems no test frameworks or REPLs actually show deprecation warnings by default!
So Ruby developers will typically never see deprecation warnings for keyword arguments, and it will just break when they try Ruby 3.0.

I think only MSpec does `Warning[:deprecated] = true`, whether or not `-w` is passed, which seems the right thing to do.

Currently, RSpec enables `Warning[:deprecated] = true` only for `rspec -w`.

Same for `test/unit` 3.3.4 shipped with 2.7.2.

IRB in 2.7.2 does not show deprecated warnings.
Same for `pry`.

I think ruby-core needs to have a clear message here, like:
> All test frameworks and REPLs should include this snippet and run it before running tests: `Warning[:deprecated] = true if Warning.respond_to?(:[]=)`.
> This is important so that developers see warnings in development, and that they see the warnings before updating to the next Ruby version.
> Developers can choose to disable deprecation warnings explicitly if they want with `Warning[:deprecated] = false`.

And I think it would be good that ruby-core makes a PR or an issue to the main test frameworks/REPLs to show examples.

P.S.: if someone wants to disable all warnings with `-W0` or `$VERBOSE = nil`, it will indeed disable them all, including deprecation warnings, so there is no need to check `$VERBOSE` for setting `Warning[:deprecated] = true`.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [ruby-core:109832] [Ruby master Misc#17591] Test frameworks and REPLs do not show deprecation warnings by default
  2021-01-29 12:57 [ruby-core:102301] [Ruby master Bug#17591] Test frameworks and REPLs do not show deprecation warnings by default eregontp
                   ` (9 preceding siblings ...)
  2021-02-17  9:06 ` [ruby-core:102557] " kou
@ 2022-09-03 13:57 ` Eregon (Benoit Daloze)
  2023-05-27  9:55 ` [ruby-core:113679] " byroot (Jean Boussier) via ruby-core
  2023-05-27 10:12 ` [ruby-core:113682] " Eregon (Benoit Daloze) via ruby-core
  12 siblings, 0 replies; 14+ messages in thread
From: Eregon (Benoit Daloze) @ 2022-09-03 13:57 UTC (permalink / raw)
  To: ruby-core

Issue #17591 has been updated by Eregon (Benoit Daloze).

Status changed from Open to Closed

This is done, except for RSpec, which is tracked in https://github.com/rspec/rspec-core/issues/2867.

----------------------------------------
Misc #17591: Test frameworks and REPLs do not show deprecation warnings by default
https://bugs.ruby-lang.org/issues/17591#change-99070

* Author: Eregon (Benoit Daloze)
* Status: Closed
* Priority: Normal
----------------------------------------
Various people in #16345 said that:
> The issue can be mitigated if all test frameworks enable all deprecation warnings.
> The developer's practice can be supported by tools, such as test frameworks enable deprecation warnings automatically.

And this was used as a base to disable deprecation warnings by default in Ruby 2.7.2.

However, it seems no test frameworks or REPLs actually show deprecation warnings by default!
So Ruby developers will typically never see deprecation warnings for keyword arguments, and it will just break when they try Ruby 3.0.

I think only MSpec does `Warning[:deprecated] = true`, whether or not `-w` is passed, which seems the right thing to do.

Currently, RSpec enables `Warning[:deprecated] = true` only for `rspec -w`.

Same for `test/unit` 3.3.4 shipped with 2.7.2.

IRB in 2.7.2 does not show deprecated warnings.
Same for `pry`.

I think ruby-core needs to have a clear message here, like:
> All test frameworks and REPLs should include this snippet and run it before running tests: `Warning[:deprecated] = true if Warning.respond_to?(:[]=)`.
> This is important so that developers see warnings in development, and that they see the warnings before updating to the next Ruby version.
> Developers can choose to disable deprecation warnings explicitly if they want with `Warning[:deprecated] = false`.

And I think it would be good that ruby-core makes a PR or an issue to the main test frameworks/REPLs to show examples.

P.S.: if someone wants to disable all warnings with `-W0` or `$VERBOSE = nil`, it will indeed disable them all, including deprecation warnings, so there is no need to check `$VERBOSE` for setting `Warning[:deprecated] = true`.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [ruby-core:113679] [Ruby master Misc#17591] Test frameworks and REPLs do not show deprecation warnings by default
  2021-01-29 12:57 [ruby-core:102301] [Ruby master Bug#17591] Test frameworks and REPLs do not show deprecation warnings by default eregontp
                   ` (10 preceding siblings ...)
  2022-09-03 13:57 ` [ruby-core:109832] " Eregon (Benoit Daloze)
@ 2023-05-27  9:55 ` byroot (Jean Boussier) via ruby-core
  2023-05-27 10:12 ` [ruby-core:113682] " Eregon (Benoit Daloze) via ruby-core
  12 siblings, 0 replies; 14+ messages in thread
From: byroot (Jean Boussier) via ruby-core @ 2023-05-27  9:55 UTC (permalink / raw)
  To: ruby-core; +Cc: byroot (Jean Boussier)

Issue #17591 has been updated by byroot (Jean Boussier).


Given that RSpec doesn't want to enable deprecation warnings by default, and that they were turned off mostly because the keyword related deprecations were very verbose, should we reconsider enabling them by default?

I kinda feel it's pointless going through deprecation cycles if a large part of the community is never warned that their code will break in the future...

----------------------------------------
Misc #17591: Test frameworks and REPLs do not show deprecation warnings by default
https://bugs.ruby-lang.org/issues/17591#change-103323

* Author: Eregon (Benoit Daloze)
* Status: Closed
* Priority: Normal
----------------------------------------
Various people in #16345 said that:
> The issue can be mitigated if all test frameworks enable all deprecation warnings.
> The developer's practice can be supported by tools, such as test frameworks enable deprecation warnings automatically.

And this was used as a base to disable deprecation warnings by default in Ruby 2.7.2.

However, it seems no test frameworks or REPLs actually show deprecation warnings by default!
So Ruby developers will typically never see deprecation warnings for keyword arguments, and it will just break when they try Ruby 3.0.

I think only MSpec does `Warning[:deprecated] = true`, whether or not `-w` is passed, which seems the right thing to do.

Currently, RSpec enables `Warning[:deprecated] = true` only for `rspec -w`.

Same for `test/unit` 3.3.4 shipped with 2.7.2.

IRB in 2.7.2 does not show deprecated warnings.
Same for `pry`.

I think ruby-core needs to have a clear message here, like:
> All test frameworks and REPLs should include this snippet and run it before running tests: `Warning[:deprecated] = true if Warning.respond_to?(:[]=)`.
> This is important so that developers see warnings in development, and that they see the warnings before updating to the next Ruby version.
> Developers can choose to disable deprecation warnings explicitly if they want with `Warning[:deprecated] = false`.

And I think it would be good that ruby-core makes a PR or an issue to the main test frameworks/REPLs to show examples.

P.S.: if someone wants to disable all warnings with `-W0` or `$VERBOSE = nil`, it will indeed disable them all, including deprecation warnings, so there is no need to check `$VERBOSE` for setting `Warning[:deprecated] = true`.



-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [ruby-core:113682] [Ruby master Misc#17591] Test frameworks and REPLs do not show deprecation warnings by default
  2021-01-29 12:57 [ruby-core:102301] [Ruby master Bug#17591] Test frameworks and REPLs do not show deprecation warnings by default eregontp
                   ` (11 preceding siblings ...)
  2023-05-27  9:55 ` [ruby-core:113679] " byroot (Jean Boussier) via ruby-core
@ 2023-05-27 10:12 ` Eregon (Benoit Daloze) via ruby-core
  12 siblings, 0 replies; 14+ messages in thread
From: Eregon (Benoit Daloze) via ruby-core @ 2023-05-27 10:12 UTC (permalink / raw)
  To: ruby-core; +Cc: Eregon (Benoit Daloze)

Issue #17591 has been updated by Eregon (Benoit Daloze).


IMO we should find a way for RSpec to enable them by default, it is hurting RSpec users and destroying ruby-core's efforts to provide nice migration paths.
Maybe more voices on that RSpec issue could help to convince the RSpec devs (but probably not).
Or potentially workaround by enabling them e.g. when running tests of a rails app.

RSpec does have `-w` which enables them, so another potential way could be to teach rspec users about that, maybe via a gem-install-time message?
RSpec users will likely learn about it when something breaks without warning, but then they will probably think it's CRuby's fault when it's RSpec's fault.

I agree enabling deprecation warnings by default seems best, and then people who don't want to see it can just set `Warning[:deprecated] = false`.
Let's see what others think, but I suspect many would be reticent to change this again.

----------------------------------------
Misc #17591: Test frameworks and REPLs do not show deprecation warnings by default
https://bugs.ruby-lang.org/issues/17591#change-103326

* Author: Eregon (Benoit Daloze)
* Status: Closed
* Priority: Normal
----------------------------------------
Various people in #16345 said that:
> The issue can be mitigated if all test frameworks enable all deprecation warnings.
> The developer's practice can be supported by tools, such as test frameworks enable deprecation warnings automatically.

And this was used as a base to disable deprecation warnings by default in Ruby 2.7.2.

However, it seems no test frameworks or REPLs actually show deprecation warnings by default!
So Ruby developers will typically never see deprecation warnings for keyword arguments, and it will just break when they try Ruby 3.0.

I think only MSpec does `Warning[:deprecated] = true`, whether or not `-w` is passed, which seems the right thing to do.

Currently, RSpec enables `Warning[:deprecated] = true` only for `rspec -w`.

Same for `test/unit` 3.3.4 shipped with 2.7.2.

IRB in 2.7.2 does not show deprecated warnings.
Same for `pry`.

I think ruby-core needs to have a clear message here, like:
> All test frameworks and REPLs should include this snippet and run it before running tests: `Warning[:deprecated] = true if Warning.respond_to?(:[]=)`.
> This is important so that developers see warnings in development, and that they see the warnings before updating to the next Ruby version.
> Developers can choose to disable deprecation warnings explicitly if they want with `Warning[:deprecated] = false`.

And I think it would be good that ruby-core makes a PR or an issue to the main test frameworks/REPLs to show examples.

P.S.: if someone wants to disable all warnings with `-W0` or `$VERBOSE = nil`, it will indeed disable them all, including deprecation warnings, so there is no need to check `$VERBOSE` for setting `Warning[:deprecated] = true`.



-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2023-05-27 10:12 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-29 12:57 [ruby-core:102301] [Ruby master Bug#17591] Test frameworks and REPLs do not show deprecation warnings by default eregontp
2021-01-29 13:01 ` [ruby-core:102303] " eregontp
2021-01-29 21:59 ` [ruby-core:102312] " kou
2021-02-16  6:56 ` [ruby-core:102521] [Ruby master Misc#17591] " aycabta
2021-02-16 12:19 ` [ruby-core:102534] " eregontp
2021-02-16 12:26 ` [ruby-core:102535] " eregontp
2021-02-16 12:31 ` [ruby-core:102536] " eregontp
2021-02-17  8:06 ` [ruby-core:102552] " kou
2021-02-17  8:47 ` [ruby-core:102554] " nagachika00
2021-02-17  8:56 ` [ruby-core:102556] " nobu
2021-02-17  9:06 ` [ruby-core:102557] " kou
2022-09-03 13:57 ` [ruby-core:109832] " Eregon (Benoit Daloze)
2023-05-27  9:55 ` [ruby-core:113679] " byroot (Jean Boussier) via ruby-core
2023-05-27 10:12 ` [ruby-core:113682] " Eregon (Benoit Daloze) via ruby-core

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).