btm / minitest-handler-cookbook

Apache License 2.0
59 stars 36 forks source link

too short control escape #77

Closed ghost closed 8 years ago

ghost commented 8 years ago

I had Chef 12 working with Windows 2008 R2 the other week, but when I tried it again today, I receive this error while using test kitchen on two separate cookbooks:

       Recipe: minitest-handler::default
         * chef_gem[ci_reporter] action nothing (skipped due to action :nothing)
         * chef_gem[minitest] action nothing (skipped due to action :nothing)
         * chef_gem[minitest-chef-handler] action nothing (skipped due to action :nothing)
         * directory[delete minitest test location] action delete (up to date)

           - create new directory /var/chef/minitest

           ================================================================================
           Error executing action `run` on resource 'ruby_block[load_tests_and_register_handler]'
           ================================================================================

           RegexpError
           -----------
           too short control escape: /[A-Za-z]?:?C:\Users\CLOUD-~1\AppData\Local\Temp\kitchen\cache\/cookbooks\/icberg7_patch\//

           Resource Declaration:
           ---------------------
           # In C:/Users/CLOUD-~1/AppData/Local/Temp/kitchen/cache/cookbooks/minitest-handler/recipes/default.rb

            47: ruby_block 'load_tests_and_register_handler' do
            48:   block do
            49:     load_tests
            50:     register_handler
            51:   end
            52: end

           Compiled Resource:
           ------------------
           # Declared in C:/Users/CLOUD-~1/AppData/Local/Temp/kitchen/cache/cookbooks/minitest-handler/recipes/default.rb:47:in `from_file'

           ruby_block("load_tests_and_register_handler") do
             action [:run]
             retries 0
             retry_delay 2
             default_guard_interpreter :default
             block_name "load_tests_and_register_handler"
             declared_type :ruby_block
             cookbook_name "minitest-handler"
             recipe_name "default"
             block #<Proc:0x1ef9ae0@C:/Users/CLOUD-~1/AppData/Local/Temp/kitchen/cache/cookbooks/minitest-handler/recipes/default.rb:48>
           end

It looks like only part of the path is being escaped. This is using both chef 12.5.1 and 12.4.3.

dpetzel commented 8 years ago

I'm able to repro this under 12.5.1 as well.

ghost commented 8 years ago

OK, so at least I'm not crazy. Maybe a ruby version thing?

dpetzel commented 8 years ago

Doesn't appear to be the case, as I can repro on 11.x as well. It seems to be the way TK is constructing the cookbook path. Should have a fix a little later after a little more testing

dpetzel commented 8 years ago

1.5.0 (just released) should take care of this.