Skip to content

Commit

Permalink
Merge 355da3f into ecbb8c0
Browse files Browse the repository at this point in the history
  • Loading branch information
miah committed May 30, 2019
2 parents ecbb8c0 + 355da3f commit d558686
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 206 deletions.
114 changes: 25 additions & 89 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,107 +4,43 @@ branches:
- 3-stable
language: ruby
cache:
- bundler
- directories:
bundler: true
directories:
- /home/travis/.rvm
dist: xenial
os:
- linux
- osx
services:
- docker
bundler_args: "--without integration tools maintenance deploy"
bundler_args: "--without tools maintenance deploy"
before_install:
- gem update --system
- gem --version
- bundle --version
env:
- SLOW=1
- CI_ENABLE_COVERAGE=true SLOW=1
script: bundle exec rake $SUITE
matrix:
fast_finish: true
exclude:
- os: osx
env: CI_ENABLE_COVERAGE=true SLOW=1
- os: linux
env: SLOW=1
include:
- rvm: 2.4.5
env: UNIT_TESTS_24=1
- rvm: 2.5.5
env: UNIT_TESTS_25=1
- rvm: 2.6.3
env: UNIT_TESTS_26=1
- rvm: 2.4.5
script: bundle exec rake $SUITE
env: SUITE="test:functional"
- rvm: 2.5.5
script: bundle exec rake $SUITE
env: SUITE="test:functional"
- rvm: 2.6.2
script: bundle exec rake $SUITE
env: SUITE="test:functional"
- rvm: 2.5.5
script: bundle exec rake $SUITE
bundler_args: "--without tools maintenance deploy"
env: SUITE=test:integration[default-ubuntu-1604]
- rvm: 2.5.5
script: bundle exec rake $SUITE
bundler_args: "--without tools maintenance deploy"
env: SUITE=test:integration[default-ubuntu-1804]
- rvm: 2.5.5
script: bundle exec rake $SUITE
bundler_args: "--without tools maintenance deploy"
env: SUITE=test:integration[default-centos-6]
- rvm: 2.5.5
script: bundle exec rake $SUITE
bundler_args: "--without tools maintenance deploy"
env: SUITE=test:integration[default-centos-7]
- rvm: 2.5.5
script: bundle exec rake $SUITE
bundler_args: "--without tools maintenance deploy"
env: SUITE=test:integration[default-debian-8]
- rvm: 2.5.5
script: bundle exec rake $SUITE
bundler_args: "--without tools maintenance deploy"
env: SUITE=test:integration[default-debian-9]
- rvm: 2.5.5
script: bundle exec rake $SUITE
bundler_args: "--without tools maintenance deploy"
env: SUITE=test:integration[default-debian-10]
- rvm: 2.5.5
script: bundle exec rake $SUITE
bundler_args: "--without tools maintenance deploy"
env: SUITE=test:integration[default-oraclelinux-6]
- rvm: 2.5.5
script: bundle exec rake $SUITE
bundler_args: "--without tools maintenance deploy"
env: SUITE=test:integration[default-oraclelinux-7]
- rvm: 2.5.5
script: bundle exec rake $SUITE
bundler_args: "--without tools maintenance deploy"
env: SUITE=test:integration[default-fedora-29]
- rvm: 2.4.5
sudo: false
cache:
apt: true
bundle: true
addons:
apt:
packages:
- curl
- nodejs
env:
- AFFECTED_DIRS="www"
- secure: "jdzXUhP1o7RkfSikZLKgUcCIaKqLjqWa35dnxWnz7qAQ2draRKa7I7cXmUv76BZkW8HBUUH11dOi8YOVxPYPOzaqvcTCfqNqGVxsT9epgWa7rA8aXMXkECp548ry1rYJQpti9zpwsoe2GQyNPr9vNiWMiyj51CaABmZ6JzmFEEqlZc8vqpqWeqJvIqaibQGk7ByLKmi4R44fVwFKIG39RuxV+alc/G4nnQ2zmNTFuy8uFGs5EghQvRytzWY+s2AKtDiZ0YXYOII1Nl1unXNnNoQt9oI209ztlSm1+XOuTPelW6bEIx5i7OZFaSRPgJzWnkGN85C9nBE08L2az9Jz18/rYJF4fdVRttdGskueyYI21lh1FwlAg51ZG0RfLTYk2Pq+k4c+NO1cfmGcaXBwihfD5BWqrILU5HHkYszXCSmgl4hscC7/BS4Kgcq2z32JJwV8B+x4XngM0G4uzIn1Soia3lZXEKdnfVsxFDdMQ7FK60F3uQlq/44LRkZujRhqfAKOiz+0tsLexWzj7wK+DJY9Y00CUfh7xcxRxDxFNpOv1FWYFB9lUlaOt3HDHgUoksqbURiUzhOZZzTE/1MAtF2K6mbpME5CbN08J88L5JBlb+CX79XCzj30lNMeS0I/dCRQEmkygr2eJYxvRO2qsBNuphs4SWk8NZyS/llVZFI="
before_install: ./support/ci/fast_pass.sh || exit 0
script: ./support/ci/deploy_website_to_acceptance.sh

- env: SUITE=test:integration[default-ubuntu-1604]
- env: SUITE=test:integration[default-ubuntu-1804]
- env: SUITE=test:integration[default-centos-6]
- env: SUITE=test:integration[default-centos-7]
- env: SUITE=test:integration[default-debian-8]
- env: SUITE=test:integration[default-debian-9]
- env: SUITE=test:integration[default-debian-10]
- env: SUITE=test:integration[default-oraclelinux-6]
- env: SUITE=test:integration[default-oraclelinux-7]
- env: SUITE=test:integration[default-fedora-29]
allow_failures:
- env:
- AFFECTED_DIRS="www"
- secure: "jdzXUhP1o7RkfSikZLKgUcCIaKqLjqWa35dnxWnz7qAQ2draRKa7I7cXmUv76BZkW8HBUUH11dOi8YOVxPYPOzaqvcTCfqNqGVxsT9epgWa7rA8aXMXkECp548ry1rYJQpti9zpwsoe2GQyNPr9vNiWMiyj51CaABmZ6JzmFEEqlZc8vqpqWeqJvIqaibQGk7ByLKmi4R44fVwFKIG39RuxV+alc/G4nnQ2zmNTFuy8uFGs5EghQvRytzWY+s2AKtDiZ0YXYOII1Nl1unXNnNoQt9oI209ztlSm1+XOuTPelW6bEIx5i7OZFaSRPgJzWnkGN85C9nBE08L2az9Jz18/rYJF4fdVRttdGskueyYI21lh1FwlAg51ZG0RfLTYk2Pq+k4c+NO1cfmGcaXBwihfD5BWqrILU5HHkYszXCSmgl4hscC7/BS4Kgcq2z32JJwV8B+x4XngM0G4uzIn1Soia3lZXEKdnfVsxFDdMQ7FK60F3uQlq/44LRkZujRhqfAKOiz+0tsLexWzj7wK+DJY9Y00CUfh7xcxRxDxFNpOv1FWYFB9lUlaOt3HDHgUoksqbURiUzhOZZzTE/1MAtF2K6mbpME5CbN08J88L5JBlb+CX79XCzj30lNMeS0I/dCRQEmkygr2eJYxvRO2qsBNuphs4SWk8NZyS/llVZFI="

notifications:
slack:
secure: zwOu1gWt8wBDzlhXrYJ39jBDYTYj4Zb8/Z5XH6PalFOyYBytOLYqmpPzxw5KTzFapmcxYt1/biViX25+zapSSmDBuDa94ZneaXuCZAPXX0UJb82ORALMDsdbV1TkkS4Q6N4soigLJ5UaJwIgkZze9VtXeUvo3g8L8+mDYX4J0Poi7Kf/f1KZycNhgaVs7N/i2AI3lBeiVJv+giQbA99OR5dxPzkbx1BeZCK+W+YEPFmg1xycAItiHq0unT+kBN4pm9gW8TT1s/ZucUsKVu6Q8inw5N0PjZwboOkqsQFi5BweVicZBcbOVsW3Xs/f8DX2G823y73Al3QQg+ENxnIpizsHfjE+YzXUVsZ7v/UdsOq01Khxz1GK/X/PYrvIdHQKBwZ86RPJP61BvGIaQ4Hy6f9z+o2Tl/EaAmiOMScpdFi7sMskm8xknI0G24ZG5hkd7XNQ1eVvu33dvs+u12DsBGIylnwrppMDGnh022I5Hg8pS9tJ9gAsJlSFoIBn/yOryoFYb4avB8ujvN6+8cbZgkQ41k6ydqCHk2DxWmhsM4dUVXqC36sOePDE8a/DK5uQ057DSai5M+go5LeEJyK5r4fT5nbTk3nW6CGH0k2bPGWH5aP22mSKB9r2alDzqVfVyArfgtBIX2OXS/cZLER26a1EcB4mf3PMPDB06Aekyj0=
on_success: change
on_failure: always
on_pull_requests: false

deploy:
provider: rubygems
on:
tags: true
api_key:
secure: uI2Zy3z4ljvOoG/6E4XPmSDg4QX5jmUfp6N9lzOfOosuZGjiGG6cWe4QMfidIz4/B5Ctp9X78bYCPxLkhCPmY9qcsR6eimQsC5AwGJhQF2Fz5fSX12LO+P4H7bis/A7cP+6QYNU8n9oXy6MYIdaw8aLJoEK4tKlNueWYhKG99O1taiF6qXsKkuNXZW7LT3B774IRCK0+BUknfW22ksAOeSpk10dkPXW5lEluXq/Q60L6+Cy01Yix1gLNav7ftMeOtE968mK3L1mzf0L3q8Tih3PLwEzYZRYQRTsd8f1J6XmNZtpdW5QiehvX08ZiFT28Dx15GMp5OKc7TnfU5avm8ryxFJB8xfdrkwNPf/UB3z1IVpHIJ6ZQlHDaiJBL429ZgYSCwrdk71IHWaAK4zSuOZyE+y9EmXbdgLLMgY6QIVrgoBLzzHLCQADXchrMaYR8LIkKI5euOfl3d96sSqXrIN/v1LSlPG/Z1LVO07cYarVGy3J/iM5aTghw3ixZcdlepGrU9DIxe7kRhmz7OLDGTZiPyRzXX1IRjaxSBMGmQSJVv6+r2UJRLmpC3W+1ysXY7nZtffzrFXHGacyvcIHxm8KSPvHgfloPvgFeebcTHcly50TOcZuBc4ZF9HZwWR5lEg/1OX5puBYE7IYfLyFm48+pqFk++tbn2glE742BhkY=
- env: CI_ENABLE_COVERAGE=true SLOW=1
14 changes: 4 additions & 10 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,17 @@ group :test do
gem 'jsonschema', '~> 2.0.2'
gem 'passgen'
gem 'm'
gem 'pry', '~> 0.10'
gem 'pry-byebug'
end

group :integration do
gem 'berkshelf', '~> 7'
gem 'test-kitchen', '~> 1.17'
gem 'test-kitchen'
gem 'kitchen-vagrant'
# we need winrm v2 support >= 0.15.1
gem 'kitchen-inspec', '>= 0.15.1'
gem 'kitchen-inspec'
gem 'kitchen-ec2'
gem 'kitchen-dokken'
end

group :tools do
gem 'pry', '~> 0.10'
gem 'license_finder'
gem 'git', '~> 1.4'
gem 'git'
end

# gems for Maintainers.md generation
Expand Down
94 changes: 32 additions & 62 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,47 +34,38 @@ rescue LoadError
puts 'contrib tasks are unavailable because the git gem is not available.'
end

# Rubocop
begin
require 'rubocop/rake_task'
RuboCop::RakeTask.new(:lint)
rescue LoadError
puts 'rubocop is not available. Install the rubocop gem to run the lint tests.'
end

task :install do
inspec_bin_path = ::File.join(::File.dirname(__FILE__), "inspec-bin")
Dir.chdir(inspec_bin_path)
sh("rake install")
end

# update command output for demo
desc 'Run inspec commands and save results to www/app/responses'
task :update_demo do
ruby 'www/tutorial/scripts/build_simulator_runtime.rb'
ruby 'www/tutorial/scripts/run_simulator_recording.rb'
end
GLOBS = [
"test/unit/**/*_test.rb",
"test/functional/**/*_test.rb",
"lib/plugins/inspec-*/test/**/*_test.rb",
]

# run tests
task default: [:lint, :test]

Rake::TestTask.new do |t|
t.libs << 'test'
t.test_files = Dir.glob([
'test/unit/**/*_test.rb',
'lib/plugins/inspec-*/test/unit/**/*_test.rb',
])
t.warning = false
t.verbose = !!ENV["V"] # default to off. the test commands are _huge_.
t.ruby_opts = ['--dev'] if defined?(JRUBY_VERSION)
end
task default: ['test:lint', 'test:default']

namespace :test do
GLOBS = [
"test/unit/**/*_test.rb",
"test/functional/**/*_test.rb",
"lib/plugins/inspec-*/test/**/*_test.rb",
]

Rake::TestTask.new(:default) do |t|
t.libs << 'test'
t.test_files = Dir[*GLOBS].sort
t.warning = ENV.fetch("W", true)
t.verbose = !!ENV["V"] # default to off. the test commands are _huge_.
t.ruby_opts = ['--dev'] if defined?(JRUBY_VERSION)
end
task :default => [:accept_license]

begin
require 'rubocop/rake_task'
RuboCop::RakeTask.new(:lint)
rescue LoadError
puts 'rubocop is not available. Install the rubocop gem to run the lint tests.'
end

task :list do
puts Dir[*GLOBS].sort
Expand Down Expand Up @@ -121,31 +112,25 @@ namespace :test do
'test/functional/**/*_test.rb',
'lib/plugins/inspec-*/test/functional/**/*_test.rb',
])
t.warning = false # This just complains about things in underlying libraries
t.verbose = true
t.warning = ENV.fetch("W", true)
t.verbose = !!ENV["V"] # default to off. the test commands are _huge_.
t.ruby_opts = ['--dev'] if defined?(JRUBY_VERSION)
end
# Inject a prerequisite task
task :functional => [:accept_license]

# Functional tests on Windows take a bit to run. This
# optionally takes a env to breake the tests up into 3 workers.
Rake::TestTask.new(:'functional:windows') do |t, args|
files = Dir.glob('test/functional/*_test.rb').sort
if ENV['WORKER_NUMBER']
count = (files.count / 3).abs+1
start = (ENV['WORKER_NUMBER'].to_i - 1) * count
files = files[start..start+count-1]
end

Rake::TestTask.new(:unit) do |t|
t.libs << 'test'
t.test_files = files
t.warning = false # This just complains about things in underlying libraries
t.verbose = true
t.test_files = Dir.glob([
'test/unit/**/*_test.rb',
'lib/plugins/inspec-*/test/unit/**/*_test.rb',
])
t.warning = ENV.fetch("W", true)
t.verbose = !!ENV["V"] # default to off. the test commands are _huge_.
t.ruby_opts = ['--dev'] if defined?(JRUBY_VERSION)
end
# Inject a prerequisite task
task :'functional:windows' => [:accept_license]
task :unit => [:accept_license]

task :resources do
tests = Dir['test/unit/resource/*_test.rb']
Expand Down Expand Up @@ -414,18 +399,3 @@ task :release_docker do
sh('sh', '-c', cmd)
end

desc 'Release the website [deprecated]'
task :www do
puts 'The Rake tasks for releasing the website are now in the www/ directory.'
puts 'Run `cd www` and then `rake --tasks` for a list of the www-related tasks available.'
exit(1)
end

namespace :www do
desc 'Release the website [deprecated]'
task :release do
puts 'The Rake tasks for releasing the website are now in the www/ directory.'
puts 'Run `cd www` and then `rake --tasks` for a list of the www-related tasks available.'
exit(1)
end
end
45 changes: 5 additions & 40 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,12 @@ platform:

environment:
matrix:
- name: unit-tests-ruby-2.4.4
ruby_version: "24-x64"
- name: unit-tests-ruby-2.5
ruby_version: "25-x64"
- name: unit-tests-ruby-2.6
ruby_version: "26-x64"
- name: functional-tests-1
ruby_version: "26-x64"
- name: functional-tests-2
ruby_version: "26-x64"
- name: functional-tests-3
- name: ruby-2.6
ruby_version: "26-x64"
- name: ruby-2.5
ruby_version: "25-x64"
- name: ruby-2.4
ruby_version: "24-x64"
clone_folder: c:\projects\inspec
clone_depth: 1
# Disable MSBuild mode entirely
Expand Down Expand Up @@ -67,32 +61,3 @@ test_script:
- SET SPEC_OPTS=--format progress
- SET SLOW=1
- bundle exec rake

for:
-
matrix:
only:
- name: functional-tests-1
test_script:
- SET SPEC_OPTS=--format progress
- SET WORKER_NUMBER=1
- SET SLOW=1
- bundle exec rake test:functional:windows
-
matrix:
only:
- name: functional-tests-2
test_script:
- SET SPEC_OPTS=--format progress
- SET WORKER_NUMBER=2
- SET SLOW=1
- bundle exec rake test:functional:windows
-
matrix:
only:
- name: functional-tests-3
test_script:
- SET SPEC_OPTS=--format progress
- SET WORKER_NUMBER=3
- SET SLOW=1
- bundle exec rake test:functional:windows
12 changes: 7 additions & 5 deletions test/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@
Coveralls::SimpleCov::Formatter
])

SimpleCov.start do
add_filter '/test/'
add_group 'Resources', 'lib/resources'
add_group 'Matchers', 'lib/matchers'
add_group 'Backends', 'lib/inspec/backend'
if ENV['CI_ENABLE_COVERAGE']
SimpleCov.start do
add_filter '/test/'
add_group 'Resources', ['lib/resources', 'lib/inspec/resources']
add_group 'Matchers', ['lib/matchers', 'lib/inspec/matchers']
add_group 'Backends', 'lib/inspec/backend'
end
end

##
Expand Down

0 comments on commit d558686

Please sign in to comment.