test-kitchen 0.5.4 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- data/config/Cheffile +1 -2
- data/config/Vagrantfile +5 -0
- data/lib/test-kitchen/cli.rb +2 -1
- data/lib/test-kitchen/cli/test.rb +8 -2
- data/lib/test-kitchen/project/base.rb +6 -6
- data/lib/test-kitchen/project/cookbook.rb +6 -0
- data/lib/test-kitchen/project/ruby.rb +2 -2
- data/lib/test-kitchen/version.rb +1 -1
- metadata +2 -8
data/config/Cheffile
CHANGED
@@ -40,8 +40,7 @@ if env.project.respond_to?(:cookbook_path)
|
|
40
40
|
end
|
41
41
|
|
42
42
|
if env.project.run_list.include? 'recipe[minitest-handler]'
|
43
|
-
cookbook 'minitest-handler'
|
44
|
-
:git => 'git://github.com/kotiri/minitest-handler-cookbook.git'
|
43
|
+
cookbook 'minitest-handler'
|
45
44
|
end
|
46
45
|
|
47
46
|
# include user-provided cookbooks
|
data/config/Vagrantfile
CHANGED
@@ -96,6 +96,11 @@ project = tk_env.project
|
|
96
96
|
|
97
97
|
vm_config.vm.provision :chef_solo do |chef|
|
98
98
|
chef.cookbooks_path = tk_env.cookbook_paths
|
99
|
+
|
100
|
+
if project.data_bags_path && File.exists?(project.data_bags_path)
|
101
|
+
chef.data_bags_path = project.data_bags_path
|
102
|
+
end
|
103
|
+
|
99
104
|
chef.run_list = project.run_list + build_run_list(tk_env.cookbook_paths, test_recipe_name)
|
100
105
|
chef.json = chef_json
|
101
106
|
chef.log_level = :debug
|
data/lib/test-kitchen/cli.rb
CHANGED
@@ -27,7 +27,8 @@ module TestKitchen
|
|
27
27
|
|
28
28
|
option :platform,
|
29
29
|
:long => "--platform PLATFORM",
|
30
|
-
:description => "The platform to use. If not specified tests will be run against all platforms."
|
30
|
+
:description => "The platform to use. If not specified tests will be run against all platforms.",
|
31
|
+
:default => nil
|
31
32
|
|
32
33
|
option :configuration,
|
33
34
|
:long => "--configuration CONFIG",
|
@@ -27,8 +27,14 @@ module TestKitchen
|
|
27
27
|
banner "kitchen test (options)"
|
28
28
|
|
29
29
|
def run
|
30
|
-
|
31
|
-
|
30
|
+
if config[:platform]
|
31
|
+
test_platforms = [config[:platform]]
|
32
|
+
else
|
33
|
+
test_platforms = env.platform_names
|
34
|
+
end
|
35
|
+
|
36
|
+
warn_for_non_buildable_platforms(test_platforms)
|
37
|
+
env.project.each_build(test_platforms,
|
32
38
|
config[:configuration]) do |platform,configuration|
|
33
39
|
runner = TestKitchen::Runner.for_platform(env,
|
34
40
|
{:platform => platform, :configuration => configuration})
|
@@ -33,6 +33,7 @@ module TestKitchen
|
|
33
33
|
raise ArgumentError, "Project name must be specified" if name.nil? || name.empty?
|
34
34
|
@name = name
|
35
35
|
@parent = parent
|
36
|
+
@runtimes = parent.runtimes if parent
|
36
37
|
@configurations = {}
|
37
38
|
@exclusions = []
|
38
39
|
@guest_source_root = '/test-kitchen/source'
|
@@ -85,12 +86,7 @@ module TestKitchen
|
|
85
86
|
end
|
86
87
|
|
87
88
|
def runtimes(arg=nil)
|
88
|
-
set_or_return(:runtimes, arg, :default =>
|
89
|
-
if language == 'ruby' || language == 'chef'
|
90
|
-
['1.9.2']
|
91
|
-
else
|
92
|
-
[]
|
93
|
-
end)
|
89
|
+
set_or_return(:runtimes, arg, :default => [])
|
94
90
|
end
|
95
91
|
|
96
92
|
def install(arg=nil)
|
@@ -138,6 +134,10 @@ module TestKitchen
|
|
138
134
|
nil
|
139
135
|
end
|
140
136
|
|
137
|
+
def data_bags_path
|
138
|
+
nil
|
139
|
+
end
|
140
|
+
|
141
141
|
def install_command(runtime=nil)
|
142
142
|
raise NotImplementedError
|
143
143
|
end
|
@@ -25,6 +25,7 @@ module TestKitchen
|
|
25
25
|
|
26
26
|
attr_writer :lint
|
27
27
|
attr_writer :supported_platforms
|
28
|
+
attr_writer :data_bags_path
|
28
29
|
|
29
30
|
def lint(arg=nil)
|
30
31
|
set_or_return(:lint, arg, {:default => true})
|
@@ -46,6 +47,11 @@ module TestKitchen
|
|
46
47
|
" && foodcritic -f ~FC007 -f correctness#{ignore_tags} #{root_path}")
|
47
48
|
end
|
48
49
|
|
50
|
+
def data_bags_path(path = nil)
|
51
|
+
set_or_return(:data_bags_path, path,
|
52
|
+
{ :default => root_path.join('test/kitchen/data_bags').to_s })
|
53
|
+
end
|
54
|
+
|
49
55
|
def script(arg=nil)
|
50
56
|
set_or_return(:script, arg, :default =>
|
51
57
|
%Q{if [ -d "features" ]; then bundle exec cucumber -t @#{tests_tag} features; fi})
|
@@ -22,14 +22,14 @@ module TestKitchen
|
|
22
22
|
|
23
23
|
def install_command(runtime=nil, test_path=guest_test_root)
|
24
24
|
cmd = "cd #{test_path}"
|
25
|
-
cmd << " && rvm use #{runtime}" if runtime
|
25
|
+
cmd << " && rvm use #{runtime}" if runtime && ! runtime.empty?
|
26
26
|
cmd << " && gem install bundler"
|
27
27
|
cmd << " && #{install}"
|
28
28
|
end
|
29
29
|
|
30
30
|
def test_command(runtime=nil, test_path=guest_test_root)
|
31
31
|
cmd = "cd #{test_path}"
|
32
|
-
cmd << " && rvm use #{runtime}" if runtime
|
32
|
+
cmd << " && rvm use #{runtime}" if runtime && ! runtime.empty?
|
33
33
|
cmd << " && #{script}"
|
34
34
|
end
|
35
35
|
end
|
data/lib/test-kitchen/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: test-kitchen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-10-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: foodcritic
|
@@ -180,18 +180,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
180
180
|
- - ! '>='
|
181
181
|
- !ruby/object:Gem::Version
|
182
182
|
version: '0'
|
183
|
-
segments:
|
184
|
-
- 0
|
185
|
-
hash: 3834866993864711664
|
186
183
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
187
184
|
none: false
|
188
185
|
requirements:
|
189
186
|
- - ! '>='
|
190
187
|
- !ruby/object:Gem::Version
|
191
188
|
version: '0'
|
192
|
-
segments:
|
193
|
-
- 0
|
194
|
-
hash: 3834866993864711664
|
195
189
|
requirements: []
|
196
190
|
rubyforge_project:
|
197
191
|
rubygems_version: 1.8.23
|