Skip to content

Commit

Permalink
QA
Browse files Browse the repository at this point in the history
  • Loading branch information
trombik committed Sep 23, 2019
1 parent fbe9d53 commit d00ea6c
Show file tree
Hide file tree
Showing 3 changed files with 120 additions and 60 deletions.
7 changes: 7 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ cache:
- $HOME/.bundler/
- $HOME/.cache/pip/

before_install:
# XXX update RubyGem to fix build in Travis CI. when ruby 2.6.3 or later is
# available in travis environment, this can be removed.
# see details at:
# https://bundler.io/blog/2019/05/14/solutions-for-cant-find-gem-bundler-with-executable-bundle.html
- gem update --system

install:
# Install ansible
- pip install ansible yamllint
Expand Down
96 changes: 65 additions & 31 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,21 @@ GIT
GEM
remote: https://rubygems.org/
specs:
addressable (2.6.0)
public_suffix (>= 2.0.2, < 4.0)
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
ast (2.4.0)
builder (3.2.3)
capybara (3.20.2)
capybara (3.29.0)
addressable
mini_mime (>= 0.1.3)
nokogiri (~> 1.8)
rack (>= 1.6.0)
rack-test (>= 0.6.3)
regexp_parser (~> 1.2)
regexp_parser (~> 1.5)
xpath (~> 3.2)
cliver (0.3.2)
diff-lcs (1.3)
equatable (0.6.1)
erubis (2.7.0)
faraday (0.15.4)
multipart-post (>= 1.2, < 3)
Expand All @@ -50,109 +51,141 @@ GEM
gyoku (1.3.1)
builder (>= 2.1.2)
httpclient (2.8.3)
kitchen-ansible (0.50.0)
kitchen-ansible (0.50.1)
net-ssh (>= 3)
test-kitchen (>= 1.4)
kitchen-vagrant (1.5.2)
kitchen-vagrant (1.6.0)
test-kitchen (>= 1.4, < 3)
kitchen-verifier-serverspec (0.7.0)
net-ssh (>= 3)
test-kitchen (>= 1.4)
kitchen-verifier-shell (0.2.0)
test-kitchen (~> 1.4)
license-acceptance (1.0.13)
pastel (~> 0.7)
tomlrb (~> 1.2)
tty-box (~> 0.3)
tty-prompt (~> 0.18)
little-plugger (1.1.4)
logging (2.2.2)
little-plugger (~> 1.1)
multi_json (~> 1.10)
mini_mime (1.0.1)
mini_mime (1.0.2)
mini_portile2 (2.4.0)
mixlib-install (3.11.18)
mixlib-install (3.11.21)
mixlib-shellout
mixlib-versioning
thor
mixlib-shellout (2.4.4)
mixlib-versioning (1.2.7)
multi_json (1.13.1)
multipart-post (2.1.1)
net-scp (1.2.1)
net-ssh (>= 2.6.5)
necromancer (0.5.0)
net-scp (2.0.0)
net-ssh (>= 2.6.5, < 6.0.0)
net-sftp (2.1.2)
net-ssh (>= 2.6.5)
net-ssh (4.2.0)
net-ssh-gateway (1.3.0)
net-ssh (>= 2.6.5)
net-ssh-gateway (2.0.0)
net-ssh (>= 4.0.0)
net-telnet (0.1.1)
nokogiri (1.10.3)
nokogiri (1.10.4)
mini_portile2 (~> 2.4.0)
nori (2.6.0)
parallel (1.17.0)
parser (2.6.3.0)
parser (2.6.4.1)
ast (~> 2.4.0)
pastel (0.7.3)
equatable (~> 0.6)
tty-color (~> 0.5)
poltergeist (1.18.1)
capybara (>= 2.1, < 4)
cliver (~> 0.3.1)
websocket-driver (>= 0.2.0)
powerpack (0.1.2)
public_suffix (3.0.3)
public_suffix (4.0.1)
rack (2.0.7)
rack-test (1.1.0)
rack (>= 1.0, < 3)
rainbow (2.2.2)
rake
rake (12.3.2)
regexp_parser (1.5.1)
rake (12.3.3)
regexp_parser (1.6.0)
rspec (3.8.0)
rspec-core (~> 3.8.0)
rspec-expectations (~> 3.8.0)
rspec-mocks (~> 3.8.0)
rspec-core (3.8.0)
rspec-core (3.8.2)
rspec-support (~> 3.8.0)
rspec-expectations (3.8.3)
rspec-expectations (3.8.4)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.8.0)
rspec-its (1.3.0)
rspec-core (>= 3.0.0)
rspec-expectations (>= 3.0.0)
rspec-mocks (3.8.0)
rspec-mocks (3.8.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.8.0)
rspec-support (3.8.0)
rspec-support (3.8.2)
rubocop (0.51.0)
parallel (~> 1.10)
parser (>= 2.3.3.1, < 3.0)
powerpack (~> 0.1)
rainbow (>= 2.2.2, < 3.0)
ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.0, >= 1.0.1)
ruby-progressbar (1.10.0)
ruby-progressbar (1.10.1)
rubyntlm (0.6.2)
rubyzip (1.2.3)
serverspec (2.41.4)
rubyzip (1.2.4)
serverspec (2.41.5)
multi_json
rspec (~> 3.0)
rspec-its
specinfra (~> 2.72)
sfl (2.3)
specinfra (2.77.2)
specinfra (2.81.0)
net-scp
net-ssh (>= 2.7)
net-telnet (= 0.1.1)
sfl
test-kitchen (1.24.0)
strings (0.1.6)
strings-ansi (~> 0.1)
unicode-display_width (~> 1.5)
unicode_utils (~> 1.4)
strings-ansi (0.1.0)
test-kitchen (1.25.0)
license-acceptance (~> 1.0, >= 1.0.11)
mixlib-install (~> 3.6)
mixlib-shellout (>= 1.2, < 3.0)
net-scp (~> 1.1)
net-scp (>= 1.1, < 3.0)
net-ssh (>= 2.9, < 5.0)
net-ssh-gateway (~> 1.2)
net-ssh-gateway (>= 1.2, < 3.0)
thor (~> 0.19)
winrm (~> 2.0)
winrm-elevated (~> 1.0)
winrm-fs (~> 1.1)
thor (0.20.3)
tomlrb (1.2.8)
tty-box (0.4.1)
pastel (~> 0.7.2)
strings (~> 0.1.6)
tty-cursor (~> 0.7)
tty-color (0.5.0)
tty-cursor (0.7.0)
tty-prompt (0.19.0)
necromancer (~> 0.5.0)
pastel (~> 0.7.0)
tty-reader (~> 0.6.0)
tty-reader (0.6.0)
tty-cursor (~> 0.7)
tty-screen (~> 0.7)
wisper (~> 2.0.0)
tty-screen (0.7.0)
unicode-display_width (1.6.0)
websocket-driver (0.7.0)
unicode_utils (1.4.0)
websocket-driver (0.7.1)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.3)
websocket-extensions (0.1.4)
winrm (2.3.2)
builder (>= 2.1.2)
erubis (~> 2.7)
Expand All @@ -170,6 +203,7 @@ GEM
logging (>= 1.6.1, < 3.0)
rubyzip (~> 1.1)
winrm (~> 2.0)
wisper (2.0.0)
xpath (3.2.0)
nokogiri (~> 1.8)

Expand All @@ -191,4 +225,4 @@ DEPENDENCIES
test-kitchen

BUNDLED WITH
1.17.3
2.0.2
77 changes: 48 additions & 29 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,44 +4,63 @@ root_dir = Pathname.new(__FILE__).dirname
integration_test_dir = root_dir + "tests" + "integration"
integration_test_dirs = Pathname.new(integration_test_dir)
.children.select(&:directory?)

task default: %w[test]

desc "run all tests"
task :test do
integration_test_dirs.each do |d|
rakefile = d + "Rakefile"
if rakefile.exist? && rakefile.file?
Dir.chdir(d) do
puts format("entering to %<directory>s", directory: d)
begin
puts "running rake"
sh "rake"
ensure
sh "rake clean"
desc "test kitchen test and integration test"
task test: ["kitchen:test", "integration:test"]

namespace :kitchen do
desc "run test-kitchen"
task :test do
begin
puts "running kitchen test"
sh "kitchen test"
ensure
sh "kitchen destroy"
end
end
end

# rubocop:disable Metrics/BlockLength
namespace :integration do
desc "run all tests"
task :test do
integration_test_dirs.each do |d|
rakefile = d + "Rakefile"
if rakefile.exist? && rakefile.file?
Dir.chdir(d) do
puts format("entering to %<directory>s", directory: d)
begin
puts "running rake"
sh "rake"
ensure
sh "rake clean"
end
end
else
puts "Rakefile does not exist, skipping"
end
else
puts "Rakefile does not exist, skipping"
end
end
end

task :clean do
integration_test_dirs.each do |d|
rakefile = d + "Rakefile"
next unless rakefile.exist? && rakefile.file?
desc "clean after test"
task :clean do
integration_test_dirs.each do |d|
rakefile = d + "Rakefile"
next unless rakefile.exist? && rakefile.file?

Dir.chdir(d) do
puts format("entering to %<directory>s", directory: d)
begin
puts "running rake clean"
sh "rake clean"
rescue StandardError => e
puts "rake clean clean failed:"
puts e.message
puts e.backtrace.inspect
Dir.chdir(d) do
puts format("entering to %<directory>s", directory: d)
begin
puts "running rake clean"
sh "rake clean"
rescue StandardError => e
puts "rake clean clean failed:"
puts e.message
puts e.backtrace.inspect
end
end
end
end
end
# rubocop:enable Metrics/BlockLength

0 comments on commit d00ea6c

Please sign in to comment.