[ruby-core:111485] [Ruby master Bug#19279] Allow `Coverage.supported?` to recognize oneshot lines mode

Issue #19279 has been reported by kevin-j-m (Kevin Murphy). ---------------------------------------- Bug #19279: Allow `Coverage.supported?` to recognize oneshot lines mode https://bugs.ruby-lang.org/issues/19279 * Author: kevin-j-m (Kevin Murphy) * Status: Open * Priority: Normal * ruby -v: ruby 3.2.0 (2022-12-25 revision a528908271) [x86_64-darwin22] * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN ---------------------------------------- Currently in Ruby 3.2.0, Coverage's new `supported?` method (introduced in https://bugs.ruby-lang.org/issues/19026) does not recognize support for oneshot lines. Given that it is an available mode of coverage, I'm proposing that `Coverage.supported?` report that oneshot lines is supported. Current behavior: ``` bash ~|⇒ ruby -v ruby 3.2.0 (2022-12-25 revision a528908271) [x86_64-darwin22] ~|⇒ irb irb(main):001:0> require "coverage" => true irb(main):002:0> Coverage.supported?(:lines) => true irb(main):003:0> Coverage.supported?(:oneshot_lines) => false ``` -- https://bugs.ruby-lang.org/

Issue #19279 has been updated by kevin-j-m (Kevin Murphy). kevin-j-m (Kevin Murphy) wrote:
Currently in Ruby 3.2.0, Coverage's new `supported?` method (introduced in https://bugs.ruby-lang.org/issues/19026) does not recognize support for oneshot lines. Given that it is an available mode of coverage, I'm proposing that `Coverage.supported?` report that oneshot lines is supported.
Current behavior: ``` bash ~|⇒ ruby -v ruby 3.2.0 (2022-12-25 revision a528908271) [x86_64-darwin22] ~|⇒ irb irb(main):001:0> require "coverage" => true irb(main):002:0> Coverage.supported?(:lines) => true irb(main):003:0> Coverage.supported?(:oneshot_lines) => false ```
I have a commit to support this that I'd like to contribute as a PR, but am waiting on doing so until the process here plays out. Thanks! ---------------------------------------- Bug #19279: Allow `Coverage.supported?` to recognize oneshot lines mode https://bugs.ruby-lang.org/issues/19279#change-100852 * Author: kevin-j-m (Kevin Murphy) * Status: Open * Priority: Normal * ruby -v: ruby 3.2.0 (2022-12-25 revision a528908271) [x86_64-darwin22] * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN ---------------------------------------- Currently in Ruby 3.2.0, Coverage's new `supported?` method (introduced in https://bugs.ruby-lang.org/issues/19026) does not recognize support for oneshot lines. Given that it is an available mode of coverage, I'm proposing that `Coverage.supported?` report that oneshot lines is supported. Current behavior: ``` bash ~|⇒ ruby -v ruby 3.2.0 (2022-12-25 revision a528908271) [x86_64-darwin22] ~|⇒ irb irb(main):001:0> require "coverage" => true irb(main):002:0> Coverage.supported?(:lines) => true irb(main):003:0> Coverage.supported?(:oneshot_lines) => false ``` -- https://bugs.ruby-lang.org/

Issue #19279 has been updated by ioquatix (Samuel Williams). I basically agree with fixing this - can you link the PR? The only feedback I have is that `:lines` and `:oneshot_lines` are basically the same from a compatibility POV. I wonder if the flags should actually be `:lines | :oneshot`. Because other forms of coverage might also want to be oneshot? ---------------------------------------- Bug #19279: Allow `Coverage.supported?` to recognize oneshot lines mode https://bugs.ruby-lang.org/issues/19279#change-100853 * Author: kevin-j-m (Kevin Murphy) * Status: Open * Priority: Normal * ruby -v: ruby 3.2.0 (2022-12-25 revision a528908271) [x86_64-darwin22] * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN ---------------------------------------- Currently in Ruby 3.2.0, Coverage's new `supported?` method (introduced in https://bugs.ruby-lang.org/issues/19026) does not recognize support for oneshot lines. Given that it is an available mode of coverage, I'm proposing that `Coverage.supported?` report that oneshot lines is supported. Current behavior: ``` bash ~|⇒ ruby -v ruby 3.2.0 (2022-12-25 revision a528908271) [x86_64-darwin22] ~|⇒ irb irb(main):001:0> require "coverage" => true irb(main):002:0> Coverage.supported?(:lines) => true irb(main):003:0> Coverage.supported?(:oneshot_lines) => false ``` -- https://bugs.ruby-lang.org/

Issue #19279 has been updated by kevin-j-m (Kevin Murphy). I just created the PR here: https://github.com/ruby/ruby/pull/7040 ---------------------------------------- Bug #19279: Allow `Coverage.supported?` to recognize oneshot lines mode https://bugs.ruby-lang.org/issues/19279#change-100854 * Author: kevin-j-m (Kevin Murphy) * Status: Open * Priority: Normal * ruby -v: ruby 3.2.0 (2022-12-25 revision a528908271) [x86_64-darwin22] * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN ---------------------------------------- Currently in Ruby 3.2.0, Coverage's new `supported?` method (introduced in https://bugs.ruby-lang.org/issues/19026) does not recognize support for oneshot lines. Given that it is an available mode of coverage, I'm proposing that `Coverage.supported?` report that oneshot lines is supported. Current behavior: ``` bash ~|⇒ ruby -v ruby 3.2.0 (2022-12-25 revision a528908271) [x86_64-darwin22] ~|⇒ irb irb(main):001:0> require "coverage" => true irb(main):002:0> Coverage.supported?(:lines) => true irb(main):003:0> Coverage.supported?(:oneshot_lines) => false ``` -- https://bugs.ruby-lang.org/

Issue #19279 has been updated by mame (Yusuke Endoh). TBH, I don't fully understand the need for `Coverage.supported?`. (I thought `RUBY_VERSION > "3.1"` was good enough as I said in https://bugs.ruby-lang.org/issues/19026#note-6.) So I am not sure of the need for `Coverage.supported?(:oneshot_lines)` either. In any case, since it is already in place, I don't see a problem with introducing more `Coverage.supported?(:oneshot_lines)`. ---------------------------------------- Bug #19279: Allow `Coverage.supported?` to recognize oneshot lines mode https://bugs.ruby-lang.org/issues/19279#change-100860 * Author: kevin-j-m (Kevin Murphy) * Status: Open * Priority: Normal * ruby -v: ruby 3.2.0 (2022-12-25 revision a528908271) [x86_64-darwin22] * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN ---------------------------------------- Currently in Ruby 3.2.0, Coverage's new `supported?` method (introduced in https://bugs.ruby-lang.org/issues/19026) does not recognize support for oneshot lines. Given that it is an available mode of coverage, I'm proposing that `Coverage.supported?` report that oneshot lines is supported. Current behavior: ``` bash ~|⇒ ruby -v ruby 3.2.0 (2022-12-25 revision a528908271) [x86_64-darwin22] ~|⇒ irb irb(main):001:0> require "coverage" => true irb(main):002:0> Coverage.supported?(:lines) => true irb(main):003:0> Coverage.supported?(:oneshot_lines) => false ``` -- https://bugs.ruby-lang.org/

Issue #19279 has been updated by ioquatix (Samuel Williams). Okay, I merged it. If you think this should be backported you need to ask @nagachika :) ---------------------------------------- Bug #19279: Allow `Coverage.supported?` to recognize oneshot lines mode https://bugs.ruby-lang.org/issues/19279#change-100865 * Author: kevin-j-m (Kevin Murphy) * Status: Open * Priority: Normal * ruby -v: ruby 3.2.0 (2022-12-25 revision a528908271) [x86_64-darwin22] * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN ---------------------------------------- Currently in Ruby 3.2.0, Coverage's new `supported?` method (introduced in https://bugs.ruby-lang.org/issues/19026) does not recognize support for oneshot lines. Given that it is an available mode of coverage, I'm proposing that `Coverage.supported?` report that oneshot lines is supported. Current behavior: ``` bash ~|⇒ ruby -v ruby 3.2.0 (2022-12-25 revision a528908271) [x86_64-darwin22] ~|⇒ irb irb(main):001:0> require "coverage" => true irb(main):002:0> Coverage.supported?(:lines) => true irb(main):003:0> Coverage.supported?(:oneshot_lines) => false ``` -- https://bugs.ruby-lang.org/

Issue #19279 has been updated by Eregon (Benoit Daloze). @mame https://bugs.ruby-lang.org/issues/19026#note-7 should be a good enough reason on its own IMHO. And as we have seen with recent simplecov issues, it's always a bad idea to use a version check for checking if a feature is available. ---------------------------------------- Bug #19279: Allow `Coverage.supported?` to recognize oneshot lines mode https://bugs.ruby-lang.org/issues/19279#change-100885 * Author: kevin-j-m (Kevin Murphy) * Status: Closed * Priority: Normal * ruby -v: ruby 3.2.0 (2022-12-25 revision a528908271) [x86_64-darwin22] * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN ---------------------------------------- Currently in Ruby 3.2.0, Coverage's new `supported?` method (introduced in https://bugs.ruby-lang.org/issues/19026) does not recognize support for oneshot lines. Given that it is an available mode of coverage, I'm proposing that `Coverage.supported?` report that oneshot lines is supported. Current behavior: ``` bash ~|⇒ ruby -v ruby 3.2.0 (2022-12-25 revision a528908271) [x86_64-darwin22] ~|⇒ irb irb(main):001:0> require "coverage" => true irb(main):002:0> Coverage.supported?(:lines) => true irb(main):003:0> Coverage.supported?(:oneshot_lines) => false ``` -- https://bugs.ruby-lang.org/
participants (4)
-
Eregon (Benoit Daloze)
-
ioquatix (Samuel Williams)
-
kevin-j-m (Kevin Murphy)
-
mame (Yusuke Endoh)