在 Chef 配方运行后,运行 minitest 套件以检查系统状态。
Run minitest suites after your Chef recipes to check the status of your system.
This software is only very lightly maintained, if at all. The only bugfixes likely to be worked on will be for chef-client compatibility issues for major breakages (i.e. issues like fails to work at all on chef-client 12.0.0 because of API changes within chef-client).
Community submitted PRs can be merged and the software can still get released, but it is not under active maintainership.
Users are urged to consider switching to using Inspec: http://inspec.io/
gem install minitest-chef-handlerOption 1: Add the report handler to your client.rb or solo.rb file:
require 'minitest-chef-handler'
report_handlers where your test files are, './test/test_*.rb' by default
* :filter => filter test names on pattern
* :seed => set random seed
* :verbose => show progress processing files.
* :ci_reports => path to write out the result of each test in a JUnit-compatible XML file, parseable by many CI platforms.
Example:
```ruby
handler = MiniTest::Chef::Handler.new({
:path => './cookbooks/test/*_test.rb',
:filter => 'foo',
:seed => srand,
:verbose => true})
report_handlers << handlerMiniTest-chef-hander collects test paths based in the recipes ran. It loads the tests based on the name of the cookbook and the name of the recipe. The tests must be under the cookbooks directory.
Examples:
If the seen recipes includes the recipe "foo" we try to load tests from:
cookbooks/foo/tests/default_test.rb
cookbooks/foo/tests/default/*_test.rb
cookbooks/foo/specs/default_spec.rb
cookbooks/foo/specs/default/*_spec.rbIf the seen recipes includes the recipe "foo::install" we try to load tests from:
cookbooks/foo/tests/install_test.rb
cookbooks/foo/tests/install/*_test.rb
cookbooks/foo/specs/install_spec.rb
cookbooks/foo/specs/install/*_spec.rbIf the tests detect any failure, the handler raises an error to abort the Chef execution. This error can be captured by any other exception handler and be treated like any other error in the Chef execution.
The instructions above have described how to use it in a Chef solo installation. If you want to distribute the handler to your Chef server check either the chef_handler cookbooks in the examples or minitest-handler-cookbook.
bundle
bundle exec rake # unit tests
bundle exec vagrant up # integration tests (install virtualbox first and vagrant destroy -f afterwards to clean up)Copyright (c) 2012 David Calavera. See LICENSE for details.
暂无开放 Issues,或尚未同步最近议题。