Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
M

minitest-chef-handler

> 编程语言
Open source

Run minitest suites after your Chef recipes to check the status of your system.

162 stars0 likes0 views
WebsiteGitHub

About

Run minitest suites after your Chef recipes to check the status of your system.

Minitest Chef Handler

Run minitest suites after your Chef recipes to check the status of your system.

DEPRECATION NOTICE

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/

Installation

bash
gem install minitest-chef-handler

Usage

Option 1: Add the report handler to your client.rb or solo.rb file:

ruby
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 << handler

Automatic tests detection

MiniTest-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.rb

If 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.rb

Automatic chef failure

If 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.

Chef server distribution

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.

Development

ruby
bundle
bundle exec rake # unit tests
bundle exec vagrant up # integration tests (install virtualbox first and vagrant destroy -f afterwards to clean up)

Copyright

Copyright (c) 2012 David Calavera. See LICENSE for details.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Ruby

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言