test-kitchen / busser

Kitchen Busser - Runs tests for projects in test-kitchen
Other
45 stars 17 forks source link

Busser/Thor 0.19 incompatability? #7

Closed mal closed 10 years ago

mal commented 10 years ago

Got this when I just tried to use bats for the first time; apparently Thor 19 only got released in the last 20 minutes or so, so perhaps I'm just really unlucky.

I had a quick look at busser and thor to try and workout where the Pathname originated, but it's a lot of code to step through as both libs use pathname in some capacity.

Decided to make an issue now incase someone with more knowledge can see a trivial fix.

-----> Verifying <supervisor-program-enable-ubuntu-1204>...
       Suite path directory /tmp/busser/suites does not exist, skipping.
/tmp/busser/gems/gems/thor-0.19.0/lib/thor/shell/basic.rb:81:in `say': undefined method `end_with?' for #<Pathname:/tmp/busser/suites> (NoMethodError)
        from /tmp/busser/gems/gems/thor-0.19.0/lib/thor/shell.rb:63:in `say'
        from /tmp/busser/gems/gems/busser-0.6.0/lib/busser/command/suite_path.rb:34:in `path'
        from /tmp/busser/gems/gems/thor-0.19.0/lib/thor/command.rb:27:in `run'
        from /tmp/busser/gems/gems/thor-0.19.0/lib/thor/invocation.rb:126:in `invoke_command'
        from /tmp/busser/gems/gems/thor-0.19.0/lib/thor/invocation.rb:133:in `block in invoke_all'
        from /tmp/busser/gems/gems/thor-0.19.0/lib/thor/invocation.rb:133:in `each'
        from /tmp/busser/gems/gems/thor-0.19.0/lib/thor/invocation.rb:133:in `map'
        from /tmp/busser/gems/gems/thor-0.19.0/lib/thor/invocation.rb:133:in `invoke_all'
        from /tmp/busser/gems/gems/thor-0.19.0/lib/thor/group.rb:232:in `dispatch'
        from /tmp/busser/gems/gems/thor-0.19.0/lib/thor/invocation.rb:115:in `invoke'
        from /tmp/busser/gems/gems/thor-0.19.0/lib/thor.rb:40:in `block in register'
        from /tmp/busser/gems/gems/thor-0.19.0/lib/thor/command.rb:27:in `run'
        from /tmp/busser/gems/gems/thor-0.19.0/lib/thor/invocation.rb:126:in `invoke_command'
        from /tmp/busser/gems/gems/thor-0.19.0/lib/thor.rb:359:in `dispatch'
        from /tmp/busser/gems/gems/thor-0.19.0/lib/thor/invocation.rb:115:in `invoke'
        from /tmp/busser/gems/gems/thor-0.19.0/lib/thor.rb:235:in `block in subcommand'
        from /tmp/busser/gems/gems/thor-0.19.0/lib/thor/command.rb:27:in `run'
        from /tmp/busser/gems/gems/thor-0.19.0/lib/thor/invocation.rb:126:in `invoke_command'
        from /tmp/busser/gems/gems/thor-0.19.0/lib/thor.rb:359:in `dispatch'
        from /tmp/busser/gems/gems/thor-0.19.0/lib/thor/base.rb:440:in `start'
        from /tmp/busser/gems/gems/busser-0.6.0/bin/busser:8:in `<top (required)>'
        from /tmp/busser/gems/bin/busser:23:in `load'
        from /tmp/busser/gems/bin/busser:23:in `<main>'
Uploading /bats/check_program.bats (mode=0664)
mal commented 10 years ago

Looks like thor only uses Pathname for Thorfiles, so I'm guessing the issue lies with busser ;(

fnichol commented 10 years ago

Oh dear, I will check this out just as soon as I have an internet connection. Thank you for reporting!

mal commented 10 years ago

I had a look at the diff of the Thor release, and I think it's an unintentional regression on their end, I've filed an issue here (erikhuda/thor#404).

fabn commented 10 years ago

+1 Just got the same issue in the last 5 minutes. This happened as soon as thor 0.19.0 got released.

@fnichol is there any way to control busser installation with something like a local Gemfile?

fabn commented 10 years ago

Here's what I did to continue my work in the meantime:

Login to the VM with kitchen login and become root

$ sudo -i
root@default-ubuntu-1204 : ~
# /opt/chef/embedded/bin/gem uninstall thor

You have requested to uninstall the gem:
    thor-0.19.0
busser-0.6.0 depends on [thor (>= 0)]
If you remove this gems, one or more dependencies will not be met.
Continue with Uninstall? [Yn]  y
Remove executables:
    thor

in addition to the gem? [Yn]
Removing thor
Successfully uninstalled thor-0.19.0

root@default-ubuntu-1204 : ~
[0] # /opt/chef/embedded/bin/gem install thor -v=0.18.1
Fetching: thor-0.18.1.gem (100%)
Successfully installed thor-0.18.1
1 gem installed
Installing ri documentation for thor-0.18.1...
Installing RDoc documentation for thor-0.18.1...

In this way I'm still able to work locally, obviously this won't work in CI environment.

mal commented 10 years ago

It was slightly more work for me, but I got it working locally too;

vagrant@default-ubuntu-1204:~$ sudo -s
root@default-ubuntu-1204:~# BUSSER_ROOT="/tmp/busser" GEM_HOME="/tmp/busser/gems" GEM_PATH="/tmp/busser/gems" GEM_CACHE="/tmp/busser/gems/cache"
root@default-ubuntu-1204:~# export BUSSER_ROOT GEM_HOME GEM_PATH GEM_CACHE
root@default-ubuntu-1204:~# /opt/chef/embedded/bin/gem uninstall thor

You have requested to uninstall the gem:
        thor-0.19.0
busser-0.6.0 depends on [thor (>= 0)]
If you remove this gems, one or more dependencies will not be met.
Continue with Uninstall? [Yn]  y
Remove executables:
        thor

in addition to the gem? [Yn]  y
Removing thor
Successfully uninstalled thor-0.19.0
root@default-ubuntu-1204:~# /opt/chef/embedded/bin/gem install thor -v0.18.1 --no-rdoc --no-ri
Fetching: thor-0.18.1.gem (100%)
Successfully installed thor-0.18.1
1 gem installed
fnichol commented 10 years ago

Confirmed this is an issue, I should have a relatively simple fix incoming, namely explicitly coercing the Pathname to a string before passing the result to #say. I'm going to add the same sanity to the Busser::UI module as well for safety.

fnichol commented 10 years ago

Released in 0.6.1, thank you for your help!

mal commented 10 years ago

Cheers!