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

Doesn't work for debugging the bake test suite #1

Closed
Apteryks opened this issue Jan 9, 2023 · 7 comments
Closed

Doesn't work for debugging the bake test suite #1

Apteryks opened this issue Jan 9, 2023 · 7 comments

Comments

@Apteryks
Copy link

Apteryks commented Jan 9, 2023

Hello and thank you for this project!

I tried using it like so, to debug 4 test failures in the bake gem:

$ export RSPEC_DEBUG=1
$ rspec

Bake::Base
  has a path
  formats nicely

Bake::Command::Call
  can invoke task
  with arguments
    can invoke task
  with mixed arguments
    can invoke task
  with = options
    can invoke task
  with -- options
    can invoke task
  with test_argument_normalized
    can accept --foo_bar
    can accept --foo-bar
  with value generating task
    with json output format
      can print the value (FAILED - 1)
    with raw output format
      can print the value (FAILED - 2)
    with pp output format
      can print the value (FAILED - 3)
    with yaml output format
      can print the value (FAILED - 4)

Bake::Command::List
  can list tasks
  with pattern
    lists only matching tasks

Bake::Context
  can invoke root task
  #invoke
    can invoke another task
    can invoke task with required argument
  #lookup
    can lookup method on parent instance
    can lookup method on child instance
    can lookup method on sibling instance

Bake::Types::Boolean
  true
    should be a kind of TrueClass
    should be == true
  false
    should be a kind of FalseClass
    should be == false

Bake::Types::Input
  -
    should be a kind of IO
    should be == #<IO:0x0000000000b1f918>
  /tmp/guix-build-ruby-bake-0.18.2.drv-0/source/spec/bake/types/input.txt
    should be a kind of IO

Bake::Types::Nil
  nil
    should be a kind of NilClass
    should be ==
  null
    should be a kind of NilClass
    should be ==

Bake::Types::Output
  -
    should be a kind of IO
    should be == #<IO:0x0000000000b1f878>
  /tmp/guix-build-ruby-bake-0.18.2.drv-0/source/spec/bake/types/output.txt
    should be a kind of IO

Bake::Types
  can use | operator
  Array(Any)
    should be a kind of Bake::Types::Array

Bake::Context
  should parse integer
  should parse an array of integers
  should parse a symbol and a hash
  should parse a JSON string
  should parse a URI string

Bake
  has a version number

Failures:

  1) Bake::Command::Call with value generating task with json output format can print the value
     Failure/Error: raise ArgumentError, "Could not find recipe for #{command}!"
     
     ArgumentError:
       Could not find recipe for output!
     # ./lib/bake/context.rb:124:in `call'
     # ./lib/bake/command/call.rb:50:in `call'
     # ./spec/bake/command/call_spec.rb:83:in `block (5 levels) in <top (required)>'
     # ./spec/bake/command/call_spec.rb:83:in `block (4 levels) in <top (required)>'

  2) Bake::Command::Call with value generating task with raw output format can print the value
     Failure/Error: raise ArgumentError, "Could not find recipe for #{command}!"
     
     ArgumentError:
       Could not find recipe for output!
     # ./lib/bake/context.rb:124:in `call'
     # ./lib/bake/command/call.rb:50:in `call'
     # ./spec/bake/command/call_spec.rb:95:in `block (5 levels) in <top (required)>'
     # ./spec/bake/command/call_spec.rb:95:in `block (4 levels) in <top (required)>'

  3) Bake::Command::Call with value generating task with pp output format can print the value
     Failure/Error: raise ArgumentError, "Could not find recipe for #{command}!"
     
     ArgumentError:
       Could not find recipe for output!
     # ./lib/bake/context.rb:124:in `call'
     # ./lib/bake/command/call.rb:50:in `call'
     # ./spec/bake/command/call_spec.rb:101:in `block (5 levels) in <top (required)>'
     # ./spec/bake/command/call_spec.rb:101:in `block (4 levels) in <top (required)>'

  4) Bake::Command::Call with value generating task with yaml output format can print the value
     Failure/Error: raise ArgumentError, "Could not find recipe for #{command}!"
     
     ArgumentError:
       Could not find recipe for output!
     # ./lib/bake/context.rb:124:in `call'
     # ./lib/bake/command/call.rb:50:in `call'
     # ./spec/bake/command/call_spec.rb:107:in `block (5 levels) in <top (required)>'
     # ./spec/bake/command/call_spec.rb:107:in `block (4 levels) in <top (required)>'

Finished in 0.06846 seconds (files took 0.51041 seconds to load)
43 examples, 4 failures

Failed examples:

rspec ./spec/bake/command/call_spec.rb:82 # Bake::Command::Call with value generating task with json output format can print the value
rspec ./spec/bake/command/call_spec.rb:94 # Bake::Command::Call with value generating task with raw output format can print the value
rspec ./spec/bake/command/call_spec.rb:100 # Bake::Command::Call with value generating task with pp output format can print the value
rspec ./spec/bake/command/call_spec.rb:106 # Bake::Command::Call with value generating task with yaml output format can print the value

But as you can see, it doesn't abort to the Ruby debugger.

Did I miss something, or is it expected to not work everywhere?

Thank you!

@ko1
Copy link
Owner

ko1 commented Jan 10, 2023

Did you require this gem?

@Apteryks
Copy link
Author

I didn't! Per the README, I thought that simply installing the gem (having it on my GEM_PATH) and exporting the RSPEC_DEBUG environment variable to 1 before running rspec should be enough?

@Apteryks
Copy link
Author

I confirm that after adding require 'rspec/debug' to the spec/spec_helper.rb file of the project I'm trying to debug, it works. It seems like a documentation issue to me :-).

@ko1
Copy link
Owner

ko1 commented Jan 10, 2023

I see. I assume adding it in Gemfile is enough.

@Apteryks
Copy link
Author

"Installation" in my case (GNU Guix) means making the library available in my GEM_PATH. Does adding the requirement in Gemfile does something different?

@ko1
Copy link
Owner

ko1 commented Jan 11, 2023

274332d

added! Thank you!

@ko1 ko1 closed this as completed Jan 11, 2023
@Apteryks
Copy link
Author

Thanks to you!

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

No branches or pull requests

2 participants