百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
M

minitest-chef-handler

> 编程语言
开源

在 Chef 配方运行后,运行 minitest 套件以检查系统状态。

162 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

在 Chef 配方运行后,运行 minitest 套件以检查系统状态。

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 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Ruby

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

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