|
22 | 22 | require 'rake'
|
23 | 23 |
|
24 | 24 | #----------------------------------------------------------- integration tests
|
25 |
| -# # TODO: from sudo cookboook: |
26 | 25 | # Integration tests. Kitchen.ci
|
27 | 26 | namespace :integration do
|
28 | 27 | begin
|
|
31 | 30 | desc 'Run Test Kitchen integration tests with Docker'
|
32 | 31 | task :docker do
|
33 | 32 | Kitchen.logger = Kitchen.default_file_logger
|
34 |
| - # loader_config = { :project_config => ENV["KITCHEN_YAML"] } |
35 | 33 | config = {
|
36 | 34 | :loader => Kitchen::Loader::YAML.new(:project_config =>
|
37 |
| - ENV['KITCHEN_YAML'] || '.kitchen.local.yml') |
| 35 | + ENV['KITCHEN_YAML'] || '.kitchen.local.yml') |
38 | 36 | }
|
39 | 37 | Kitchen::Config.new(config).instances.each do |instance|
|
40 | 38 | instance.test(:always)
|
|
45 | 43 | end
|
46 | 44 | end
|
47 | 45 |
|
48 |
| -task :integration => %w(integration:docker) |
| 46 | +task :integration => %w(integration:local) |
49 | 47 |
|
50 | 48 | # where
|
51 | 49 | # integration:cloud
|
|
56 | 54 | # integration:docker
|
57 | 55 | # integration:vagrant
|
58 | 56 | # integration:parallels
|
59 |
| - |
60 |
| - |
61 |
| -# desc 'Run Test Kitchen integration tests' |
62 |
| -# namespace :integration do |
63 |
| -# # Gets a collection of instances. |
64 |
| -# # |
65 |
| -# # @param regexp [String] regular expression to match against instance names. |
66 |
| -# # @param config [Hash] configuration values for the `Kitchen::Config` class. |
67 |
| -# # @return [Collection<Instance>] all instances. |
68 |
| -# def kitchen_instances(regexp, config) |
69 |
| -# instances = Kitchen::Config.new(config).instances |
70 |
| -# return instances if regexp.nil? || regexp == 'all' |
71 |
| -# instances.get_all(Regexp.new(regexp)) |
72 |
| -# end |
73 |
| -# |
74 |
| -# # Runs a test kitchen action against some instances. |
75 |
| -# # |
76 |
| -# # @param action [String] kitchen action to run (defaults to `'test'`). |
77 |
| -# # @param regexp [String] regular expression to match against instance names. |
78 |
| -# # @param loader_config [Hash] loader configuration options. |
79 |
| -# # @return void |
80 |
| -# def run_kitchen(action, regexp, loader_config = {}) |
81 |
| -# action = 'test' if action.nil? |
82 |
| -# require 'kitchen' |
83 |
| -# Kitchen.logger = Kitchen.default_file_logger |
84 |
| -# config = { loader: Kitchen::Loader::YAML.new(loader_config) } |
85 |
| -# kitchen_instances(regexp, config).each { |i| i.send(action) } |
86 |
| -# end |
87 |
| -# |
88 |
| -# desc 'Run integration tests with kitchen-vagrant' |
89 |
| -# task :vagrant, [:regexp, :action] do |_t, args| |
90 |
| -# run_kitchen(args.action, args.regexp) |
91 |
| -# end |
92 |
| -# |
93 |
| -# desc 'Run integration tests with kitchen-docker' |
94 |
| -# task :docker, [:regexp, :action] do |_t, args| |
95 |
| -# run_kitchen(args.action, args.regexp, local_config: '.kitchen.docker.yml') |
96 |
| -# end |
97 |
| -# end |
98 |
| -# |
99 |
| -# task default: %w(integration:vagrant) |
0 commit comments