forked from saltstack-formulas/mysql-formula
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial configuration of automated tests
- Loading branch information
1 parent
5a50911
commit e29b770
Showing
7 changed files
with
121 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
*.pyc | ||
*~ | ||
Gemfile.lock | ||
.kitchen/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
driver: | ||
name: docker | ||
hostname: salt-formula.ci.local | ||
use_sudo: true | ||
require_chef_omnibus: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<% | ||
require 'yaml' | ||
formula = YAML.load_file('FORMULA') | ||
formula_name = formula['name'] | ||
%> | ||
--- | ||
verifier: | ||
name: inspec | ||
|
||
platforms: | ||
- name: ubuntu-12.04 | ||
- name: ubuntu-14.04 | ||
- name: ubuntu-16.04 | ||
- name: debian-7 | ||
- name: debian-8 | ||
|
||
provisioner: | ||
name: salt_solo | ||
salt_install: bootstrap | ||
salt_bootstrap_url: https://bootstrap.saltstack.com | ||
salt_version: latest | ||
salt_pillar_root: pillar.example | ||
log_level: <%= ENV['SALT_DEBUG_LEVEL'] || 'info' %> | ||
formula: <%= formula_name %> | ||
state_top: | ||
base: | ||
'*': | ||
- <%= formula_name %> | ||
|
||
suites: | ||
- name: default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
language: ruby | ||
|
||
rvm: | ||
- 2.2.5 | ||
|
||
sudo: required | ||
services: docker | ||
|
||
env: | ||
matrix: | ||
- INSTANCE=default-ubuntu-1204 | ||
- INSTANCE=default-ubuntu-1404 | ||
- INSTANCE=default-ubuntu-1604 | ||
- INSTANCE=default-debian-7 | ||
- INSTANCE=default-debian-8 | ||
|
||
# https://github.com/zuazo/kitchen-in-travis-native/issues/1#issuecomment-142455888 | ||
before_script: sudo iptables -L DOCKER || sudo iptables -N DOCKER | ||
|
||
install: | ||
# setup ci for test formula | ||
- export BUNDLE_GEMFILE=$PWD/Gemfile | ||
- bundle install | ||
|
||
script: | ||
# Run unit tests | ||
- KITCHEN_LOCAL_YAML=.kitchen.docker.yml bundle exec kitchen verify ${INSTANCE} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
source 'https://rubygems.org' | ||
|
||
gem 'codeclimate-test-reporter', group: :test, require: nil | ||
gem 'rake' | ||
gem 'berkshelf', '~> 4.0' | ||
|
||
group :integration do | ||
gem 'test-kitchen' | ||
gem 'kitchen-salt' | ||
gem 'kitchen-inspec' | ||
end | ||
|
||
group :docker do | ||
gem 'kitchen-docker' | ||
end | ||
|
||
# vi: set ft=ruby : | ||
gem "kitchen-vagrant" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
require 'rake' | ||
require 'rake/testtask' | ||
require 'bundler/setup' | ||
|
||
Rake::TestTask.new do |t| | ||
t.libs << 'lib' | ||
t.pattern = 'test/**/*_test.rb' | ||
t.verbose = false | ||
end | ||
|
||
desc 'Run Test Kitchen integration tests' | ||
namespace :integration do | ||
desc 'Run integration tests with kitchen-docker' | ||
task :docker do | ||
require 'kitchen' | ||
Kitchen.logger = Kitchen.default_file_logger | ||
@loader = Kitchen::Loader::YAML.new(local_config: '.kitchen.docker.yml') | ||
Kitchen::Config.new(loader: @loader).instances.each do |instance| | ||
instance.test(:always) | ||
end | ||
end | ||
end | ||
|
||
task default: :test | ||
|
||
begin | ||
require 'kitchen/rake_tasks' | ||
Kitchen::RakeTasks.new | ||
rescue LoadError | ||
puts '>>>>> Kitchen gem not loaded, omitting tasks' unless ENV['CI'] | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters