forked from criteo-forks/chef-kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
50 lines (42 loc) · 1.36 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# frozen_string_literal: true
require 'rake'
require 'rake/testtask'
require 'rspec/core/rake_task'
require 'rubocop/rake_task'
require 'bundler/setup'
require 'foodcritic'
require 'stove/rake_task'
Stove::RakeTask.new
desc 'Run RuboCop on the lib directory'
RuboCop::RakeTask.new(:rubocop) do |task|
task.fail_on_error = true
end
FoodCritic::Rake::LintTask.new
desc 'Run Test Kitchen integration tests'
namespace :integration do
desc 'Run integration tests with kitchen-vagrant'
task :vagrant do
require 'kitchen'
Kitchen.logger = Kitchen.default_file_logger
Kitchen::Config.new.instances.each { |instance| instance.test(:always) }
end
desc 'Run integration tests with kitchen-docker'
task :docker, [:instance] do |_t, args|
args.with_defaults(instance: 'default-ubuntu-1404')
require 'kitchen'
Kitchen.logger = Kitchen.default_file_logger
loader = Kitchen::Loader::YAML.new(local_config: '.kitchen.docker.yml')
instances = Kitchen::Config.new(loader: loader).instances
# Travis CI Docker service does not support destroy:
instances.get(args.instance).verify
end
end
desc 'Run chefspec unit tests'
RSpec::Core::RakeTask.new(:unit) do |t|
t.rspec_opts = [].tap do |a|
a.push('--color')
a.push('--format documentation')
end.join(' ')
t.pattern = 'test/unit/spec/*_spec.rb'
end
task default: %i[rubocop foodcritic unit]