minitest-chef-handler 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +6 -0
- data/README.md +30 -0
- data/examples/simple-solo/solo.rb +1 -1
- data/lib/minitest-chef-handler.rb +6 -0
- data/minitest-chef-handler.gemspec +1 -1
- metadata +10 -10
data/History.txt
CHANGED
data/README.md
CHANGED
@@ -122,6 +122,36 @@ handler = MiniTest::Chef::Handler.new({
|
|
122
122
|
report_handlers << handler
|
123
123
|
```
|
124
124
|
|
125
|
+
## Automatic tests detection
|
126
|
+
|
127
|
+
MiniTest-chef-hander collects test paths based in the recipes ran.
|
128
|
+
It loads the tests based in the name of the cookbook and the name of the recipe.
|
129
|
+
The tests must be under the cookbooks directory.
|
130
|
+
|
131
|
+
Examples:
|
132
|
+
|
133
|
+
If the seen recipes includes the recipe "foo" we try to load tests from:
|
134
|
+
|
135
|
+
cookbooks/foo/tests/default_test.rb
|
136
|
+
cookbooks/foo/tests/default/*_test.rb
|
137
|
+
|
138
|
+
cookbooks/foo/specs/default_spec.rb
|
139
|
+
cookbooks/foo/specs/default/*_spec.rb
|
140
|
+
|
141
|
+
If the seen recipes includes the recipe "foo::install" we try to load tests from:
|
142
|
+
|
143
|
+
cookbooks/foo/tests/install_test.rb
|
144
|
+
cookbooks/foo/tests/install/*_test.rb
|
145
|
+
|
146
|
+
cookbooks/foo/specs/install_spec.rb
|
147
|
+
cookbooks/foo/specs/install/*_spec.rb
|
148
|
+
|
149
|
+
## Automatic chef failure
|
150
|
+
|
151
|
+
If the tests detect any failure, the handler raises an error to abort the
|
152
|
+
Chef execution. This error can be captured by any other exception handler
|
153
|
+
and be treated like any other error in the Chef execution.
|
154
|
+
|
125
155
|
## Chef server distribution
|
126
156
|
|
127
157
|
The instructions abow 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](https://github.com/btm/minitest-handler-cookbook).
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'minitest-chef-handler'
|
2
2
|
|
3
|
-
path = '
|
3
|
+
path = File.expand_path('{test/test_*,spec/*_spec}.rb', File.dirname(__FILE__))
|
4
4
|
|
5
5
|
report_handlers << MiniTest::Chef::Handler.new(:path => path)
|
6
6
|
cookbook_path File.expand_path('cookbooks', File.dirname(__FILE__))
|
@@ -26,6 +26,12 @@ module MiniTest
|
|
26
26
|
else
|
27
27
|
runner.run(miniunit_options)
|
28
28
|
end
|
29
|
+
|
30
|
+
if runner.failures.nonzero?
|
31
|
+
::Chef::Client.when_run_completes_successfully do |run_status|
|
32
|
+
raise "MiniTest failed with #{runner.failures} failure(s)"
|
33
|
+
end
|
34
|
+
end
|
29
35
|
end
|
30
36
|
|
31
37
|
private
|
@@ -11,7 +11,7 @@ Gem::Specification.new do |gem|
|
|
11
11
|
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
12
12
|
gem.name = "minitest-chef-handler"
|
13
13
|
gem.require_paths = ["lib"]
|
14
|
-
gem.version = '0.5.
|
14
|
+
gem.version = '0.5.1'
|
15
15
|
|
16
16
|
gem.add_dependency('chef')
|
17
17
|
gem.add_development_dependency('rake')
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: minitest-chef-handler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-06-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: chef
|
16
|
-
requirement: &
|
16
|
+
requirement: &70293859474040 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70293859474040
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rake
|
27
|
-
requirement: &
|
27
|
+
requirement: &70293859473200 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70293859473200
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rspec
|
38
|
-
requirement: &
|
38
|
+
requirement: &70293859472480 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70293859472480
|
47
47
|
description: Run Minitest suites as Chef report handlers
|
48
48
|
email:
|
49
49
|
- david.calavera@gmail.com
|
@@ -106,7 +106,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
106
106
|
version: '0'
|
107
107
|
segments:
|
108
108
|
- 0
|
109
|
-
hash:
|
109
|
+
hash: 833207758309813032
|
110
110
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
111
111
|
none: false
|
112
112
|
requirements:
|
@@ -115,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
115
115
|
version: '0'
|
116
116
|
segments:
|
117
117
|
- 0
|
118
|
-
hash:
|
118
|
+
hash: 833207758309813032
|
119
119
|
requirements: []
|
120
120
|
rubyforge_project:
|
121
121
|
rubygems_version: 1.8.11
|