Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

[Possibly PEBCAK] Minitest-handler not copying all tests to local filesystem #23

Closed
bmhatfield opened this Issue · 7 comments

5 participants

@bmhatfield

I have downloaded the OpsCode community cookbook to manage Chef Client. In that cookbook are some minitest tests, in the following hierarchy:

[bhatfield@bhatfield-mac chef-client]$ tree files/
files/
└── [Oct  3 12:09]  default/
    └── [Oct  3 12:09]  tests/
        └── [Oct  3 12:09]  minitest/
            ├── [Oct  3 12:09]  config_test.rb
            ├── [Oct  3 12:09]  cron_test.rb
            ├── [Oct  3 12:09]  delete_validation_test.rb
            ├── [Oct  3 12:09]  helpers.rb
            └── [Oct  3 12:09]  service_test.rb

Within the given tests, there is a cross dependency on helpers.rb, like so:

[bhatfield@bhatfield-mac chef-client]$ cat files/default/tests/minitest/service_test.rb 
require File.expand_path('../helpers', __FILE__)

describe 'chef-client::service' do
  include Helpers::ChefClient
  it "starts the chef-client service" do
    service("chef-client").must_be_running
  end
end

However, when running chef-client with minitest handler enabled, I get the following error:

ERROR: Report handler MiniTest::Chef::Handler raised #<LoadError: cannot load such file -- /var/chef/minitest/chef-client/helpers>

This was confusing to me, so I troubleshooted the 'require' code above, and determined that the file was not actually there, which is confirmed on the host:

 vagrant@vagrant-ubuntu-oneric:/var/chef/minitest$ tree chef-client/
 chef-client/
 ├── config_test.rb
 ├── delete_validation_test.rb
 └── service_test.rb

I am having a hard time understanding how I am getting into this state. What can I do to provide more troubleshooting data? Is there something I am not understanding about minitest-handler?

@jimhopp

Brian, minitest-handler-cookbook copies the files to the host (defaulting to /var/chef/minitest). It looks like it expects support files to be in ../support, not ../helpers. See https://github.com/btm/minitest-handler-cookbook/blob/master/recipes/default.rb

@bryanwb
Collaborator
@jimhopp
@bscott

I would recommend using support/

@jimhopp
@bscott

Did get your issue resolved @jimhopp ?

@dpetzel
Collaborator

I believe there isn't an actionable task here. There has been no activity in a year, and I think the documentation covers where the acceptable places for support files are. If there is an actionable task here report back and we'll reopen this.

@dpetzel dpetzel closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.