diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 5574191a..602f324b 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -98,3 +98,7 @@ If you don't want to have to recreate the virtual machine every time you can use `BEAKER_DESTROY=no` and `BEAKER_PROVISION=no`. On the first run you will at least need `BEAKER_PROVISION` set to yes (the default). The Vagrantfile for the created virtual machines will be in `.vagrant/beaker_vagrant_fies`. + +The easiest way to debug in a docker container is to open a shell: + + docker exec -it -u root ${container_id_or_name} bash diff --git a/.gitignore b/.gitignore index 0d629b0c..e9b3cf4b 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ Puppetfile.lock *.iml .*.sw? .yardoc/ +Guardfile diff --git a/.msync.yml b/.msync.yml index a8e6a4ee..4abde220 100644 --- a/.msync.yml +++ b/.msync.yml @@ -1 +1 @@ -modulesync_config_version: '0.20.1' +modulesync_config_version: '0.21.3' diff --git a/.overcommit.yml b/.overcommit.yml new file mode 100644 index 00000000..31699e74 --- /dev/null +++ b/.overcommit.yml @@ -0,0 +1,63 @@ +# Managed by https://github.com/voxpupuli/modulesync_configs +# +# Hooks are only enabled if you take action. +# +# To enable the hooks run: +# +# ``` +# bundle exec overcommit --install +# # ensure .overcommit.yml does not harm to you and then +# bundle exec overcommit --sign +# ``` +# +# (it will manage the .git/hooks directory): +# +# Examples howto skip a test for a commit or push: +# +# ``` +# SKIP=RuboCop git commit +# SKIP=PuppetLint git commit +# SKIP=RakeTask git push +# ``` +# +# Don't invoke overcommit at all: +# +# ``` +# OVERCOMMIT_DISABLE=1 git commit +# ``` +# +# Read more about overcommit: https://github.com/brigade/overcommit +# +# To manage this config yourself in your module add +# +# ``` +# .overcommit.yml: +# unmanaged: true +# ``` +# +# to your modules .sync.yml config +--- +PreCommit: + RuboCop: + enabled: true + description: 'Runs rubocop on modified files only' + command: ['bundle', 'exec', 'rubocop'] + PuppetLint: + enabled: true + description: 'Runs puppet-lint on modified files only' + command: ['bundle', 'exec', 'puppet-lint'] + YamlSyntax: + enabled: true + JsonSyntax: + enabled: true + TrailingWhitespace: + enabled: true + +PrePush: + RakeTarget: + enabled: true + description: 'Run rake targets' + targets: + - 'test' + - 'rubocop' + command: [ 'bundle', 'exec', 'rake' ] diff --git a/.rspec_parallel b/.rspec_parallel new file mode 100644 index 00000000..e4d136b7 --- /dev/null +++ b/.rspec_parallel @@ -0,0 +1 @@ +--format progress diff --git a/.rubocop.yml b/.rubocop.yml index ef85ceb4..d92e4e45 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -9,6 +9,9 @@ AllCops: - .vendor/**/* - pkg/**/* - spec/fixtures/**/* + - Gemfile + - Rakefile + - Guardfile Lint/ConditionPosition: Enabled: True @@ -500,6 +503,10 @@ Style/ClosingParenthesisIndentation: # RSpec +RSpec/BeforeAfterAll: + Exclude: + - spec/acceptance/**/* + # We don't use rspec in this way RSpec/DescribeClass: Enabled: False @@ -519,6 +526,10 @@ RSpec/RepeatedDescription: RSpec/NestedGroups: Enabled: False +# this is broken on ruby1.9 +Style/IndentHeredoc: + Enabled: False + # disable Yaml safe_load. This is needed to support ruby2.0.0 development envs Security/YAMLLoad: Enabled: false diff --git a/.travis.yml b/.travis.yml index 449f5b67..3bafcb01 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,6 @@ sudo: false dist: trusty language: ruby cache: bundler -bundler_args: --without system_tests development before_install: - bundle -v - rm Gemfile.lock || true @@ -17,16 +16,22 @@ matrix: fast_finish: true include: - rvm: 2.1.9 + bundler_args: --without system_tests development env: PUPPET_VERSION="~> 4.0" CHECK=test - - rvm: 2.2.6 + - rvm: 2.2.7 + bundler_args: --without system_tests development env: PUPPET_VERSION="~> 4.0" CHECK=test - - rvm: 2.3.3 + - rvm: 2.3.4 + bundler_args: --without system_tests development env: PUPPET_VERSION="~> 4.0" CHECK=test - - rvm: 2.4.0 + - rvm: 2.4.1 + bundler_args: --without system_tests development env: PUPPET_VERSION="~> 4.0" CHECK=test - - rvm: 2.4.0 + - rvm: 2.4.1 + bundler_args: --without system_tests development env: PUPPET_VERSION="~> 4.0" CHECK=rubocop - - rvm: 2.4.0 + - rvm: 2.4.1 + bundler_args: --without system_tests development env: PUPPET_VERSION="~> 4.0" CHECK=build DEPLOY_TO_FORGE=yes branches: only: diff --git a/Gemfile b/Gemfile index 2270de7d..0914f7cb 100644 --- a/Gemfile +++ b/Gemfile @@ -11,8 +11,7 @@ def location_for(place, fake_version = nil) end group :test do - gem 'puppetlabs_spec_helper', '~> 2.0.1', :require => false - gem 'parallel_tests', :require => false + gem 'puppetlabs_spec_helper', '~> 2.1.1', :require => false gem 'rspec-puppet', '~> 2.5', :require => false gem 'rspec-puppet-facts', :require => false gem 'rspec-puppet-utils', :require => false @@ -26,22 +25,24 @@ group :test do gem 'metadata-json-lint', :require => false gem 'puppet-blacksmith', :require => false gem 'voxpupuli-release', :require => false, :git => 'https://github.com/voxpupuli/voxpupuli-release-gem.git' - gem 'puppet-strings', '~> 1.0.0', :require => false + gem 'puppet-strings', '~> 1.0', :require => false gem 'redcarpet', :require => false - gem 'rubocop', '~> 0.47.0', :require => false if RUBY_VERSION >= '2.3.0' - gem 'rubocop-rspec', '~> 1.10.0', :require => false if RUBY_VERSION >= '2.3.0' + gem 'rubocop', '~> 0.48.0', :require => false if RUBY_VERSION >= '2.3.0' + gem 'rubocop-rspec', '~> 1.15.0', :require => false if RUBY_VERSION >= '2.3.0' gem 'mocha', '>= 1.2.1', :require => false gem 'coveralls', :require => false gem 'simplecov-console', :require => false gem 'github_changelog_generator', '~> 1.13.0', :require => false if RUBY_VERSION < '2.2.2' gem 'rack', '~> 1.0', :require => false if RUBY_VERSION < '2.2.2' gem 'github_changelog_generator', :require => false if RUBY_VERSION >= '2.2.2' + gem 'parallel_tests', :require => false end group :development do - gem 'travis', :require => false - gem 'travis-lint', :require => false - gem 'guard-rake', :require => false + gem 'travis', :require => false + gem 'travis-lint', :require => false + gem 'guard-rake', :require => false + gem 'overcommit', '~> 0.39.1', :require => false end group :system_tests do diff --git a/spec/acceptance/nodesets/archlinux-2-x64.yml b/spec/acceptance/nodesets/archlinux-2-x64.yml new file mode 100644 index 00000000..89b63003 --- /dev/null +++ b/spec/acceptance/nodesets/archlinux-2-x64.yml @@ -0,0 +1,13 @@ +--- +# This file is managed via modulesync +# https://github.com/voxpupuli/modulesync +# https://github.com/voxpupuli/modulesync_config +HOSTS: + archlinux-2-x64: + roles: + - master + platform: archlinux-2-x64 + box: archlinux/archlinux + hypervisor: vagrant +CONFIG: + type: foss diff --git a/spec/acceptance/nodesets/docker/ubuntu-16.04.yml b/spec/acceptance/nodesets/docker/ubuntu-16.04.yml index 92a93cb7..bac2d5b3 100644 --- a/spec/acceptance/nodesets/docker/ubuntu-16.04.yml +++ b/spec/acceptance/nodesets/docker/ubuntu-16.04.yml @@ -10,7 +10,7 @@ HOSTS: docker_preserve_image: true docker_cmd: '["/sbin/init"]' docker_image_commands: - - 'apt-get install -y net-tools wget' + - 'apt-get install -y net-tools wget locales' - 'locale-gen en_US.UTF-8' CONFIG: trace_limit: 200