Unverified Commit 27419439 authored by Raphaël Pinson's avatar Raphaël Pinson Committed by GitHub

Convert to PDK (#270)

* Convert to PDK

* Add beaker

* Adjust Gemfile and .travis.yml

* Rename tests dir into examples

* Deactivate rubocop for now

* Remove rspec config

* Rubocop autocorrect

* Fix Lint/ParenthesesAsGroupedExpression

* rubocop autocorrect

* Exclude examples tagged with excl
parent 303e06ba
*.rb eol=lf
*.erb eol=lf
*.pp eol=lf
*.sh eol=lf
*.epp eol=lf
pkg/
Gemfile.lock
vendor/
spec/fixtures/
.vagrant/
.bundle/
coverage/
log/
.*.swp
*~
.git/
.*.sw[op]
.metadata
.yardoc
.yardwarns
*.iml
/.bundle/
/.idea/
/.vagrant/
/coverage/
/bin/
/doc/
/Gemfile.local
/Gemfile.lock
/junit/
/log/
/pkg/
/spec/fixtures/manifests/
/spec/fixtures/modules/
/tmp/
/vendor/
/convert_report.txt
/update_report.txt
.DS_Store
.project
.envrc
/inventory.yaml
---
stages:
- syntax
- unit
cache:
paths:
- vendor/bundle
before_script:
- bundle -v
- rm Gemfile.lock || true
- gem update --system $RUBYGEMS_VERSION
- gem --version
- bundle -v
- bundle install --without system_tests --path vendor/bundle --jobs $(nproc)
syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop-Ruby 2.5.3-Puppet ~> 6:
stage: syntax
image: ruby:2.5.3
script:
- bundle exec rake syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop
variables:
PUPPET_GEM_VERSION: '~> 6'
parallel_spec-Ruby 2.5.3-Puppet ~> 6:
stage: unit
image: ruby:2.5.3
script:
- bundle exec rake parallel_spec
variables:
PUPPET_GEM_VERSION: '~> 6'
parallel_spec-Ruby 2.4.5-Puppet ~> 5:
stage: unit
image: ruby:2.4.5
script:
- bundle exec rake parallel_spec
variables:
PUPPET_GEM_VERSION: '~> 5'
.git/
.*.sw[op]
.metadata
.yardoc
.yardwarns
*.iml
/.bundle/
/.idea/
/.vagrant/
/coverage/
/bin/
/doc/
/Gemfile.local
/Gemfile.lock
/junit/
/log/
/pkg/
/spec/fixtures/manifests/
/spec/fixtures/modules/
/tmp/
/vendor/
/convert_report.txt
/update_report.txt
.DS_Store
.project
.envrc
/inventory.yaml
/appveyor.yml
/.fixtures.yml
/Gemfile
/.gitattributes
/.gitignore
/.gitlab-ci.yml
/.pdkignore
/Rakefile
/rakelib/
/.rspec
/.rubocop.yml
/.travis.yml
/.yardopts
/spec/
/.vscode/
--fail-on-warnings
--relative
--no-140chars
--no-documentation
--no-class_inherits_from_params_class-check
--color
--format documentation
---
require:
- rubocop-rspec
- rubocop-i18n
AllCops:
DisplayCopNames: true
TargetRubyVersion: '2.1'
Include:
- "./**/*.rb"
Exclude:
- bin/*
- ".vendor/**/*"
- "**/Gemfile"
- "**/Rakefile"
- pkg/**/*
- spec/fixtures/**/*
- vendor/**/*
- "**/Puppetfile"
- "**/Vagrantfile"
- "**/Guardfile"
Metrics/LineLength:
Description: People have wide screens, use them.
Max: 200
GetText:
Enabled: false
GetText/DecorateString:
Description: We don't want to decorate test output.
Exclude:
- spec/**/*
Enabled: false
RSpec/BeforeAfterAll:
Description: Beware of using after(:all) as it may cause state to leak between tests.
A necessary evil in acceptance testing.
Exclude:
- spec/acceptance/**/*.rb
RSpec/HookArgument:
Description: Prefer explicit :each argument, matching existing module's style
EnforcedStyle: each
Style/BlockDelimiters:
Description: Prefer braces for chaining. Mostly an aesthetical choice. Better to
be consistent then.
EnforcedStyle: braces_for_chaining
Style/ClassAndModuleChildren:
Description: Compact style reduces the required amount of indentation.
EnforcedStyle: compact
Style/EmptyElse:
Description: Enforce against empty else clauses, but allow `nil` for clarity.
EnforcedStyle: empty
Style/FormatString:
Description: Following the main puppet project's style, prefer the % format format.
EnforcedStyle: percent
Style/FormatStringToken:
Description: Following the main puppet project's style, prefer the simpler template
tokens over annotated ones.
EnforcedStyle: template
Style/Lambda:
Description: Prefer the keyword for easier discoverability.
EnforcedStyle: literal
Style/RegexpLiteral:
Description: Community preference. See https://github.com/voxpupuli/modulesync_config/issues/168
EnforcedStyle: percent_r
Style/TernaryParentheses:
Description: Checks for use of parentheses around ternary conditions. Enforce parentheses
on complex expressions for better readability, but seriously consider breaking
it up.
EnforcedStyle: require_parentheses_when_complex
Style/TrailingCommaInArguments:
Description: Prefer always trailing comma on multiline argument lists. This makes
diffs, and re-ordering nicer.
EnforcedStyleForMultiline: comma
Style/TrailingCommaInLiteral:
Description: Prefer always trailing comma on multiline literals. This makes diffs,
and re-ordering nicer.
EnforcedStyleForMultiline: comma
Style/SymbolArray:
Description: Using percent style obscures symbolic intent of array's contents.
EnforcedStyle: brackets
RSpec/MessageSpies:
EnforcedStyle: receive
Style/Documentation:
Exclude:
- lib/puppet/parser/functions/**/*
- spec/**/*
Style/WordArray:
EnforcedStyle: brackets
Style/CollectionMethods:
Enabled: true
Style/MethodCalledOnDoEndBlock:
Enabled: true
Style/StringMethods:
Enabled: true
GetText/DecorateFunctionMessage:
Enabled: false
GetText/DecorateStringFormattingUsingInterpolation:
Enabled: false
GetText/DecorateStringFormattingUsingPercent:
Enabled: false
Layout/EndOfLine:
Enabled: false
Layout/IndentHeredoc:
Enabled: false
Metrics/AbcSize:
Enabled: false
Metrics/BlockLength:
Enabled: false
Metrics/ClassLength:
Enabled: false
Metrics/CyclomaticComplexity:
Enabled: false
Metrics/MethodLength:
Enabled: false
Metrics/ModuleLength:
Enabled: false
Metrics/ParameterLists:
Enabled: false
Metrics/PerceivedComplexity:
Enabled: false
RSpec/DescribeClass:
Enabled: false
RSpec/ExampleLength:
Enabled: false
RSpec/MessageExpectation:
Enabled: false
RSpec/MultipleExpectations:
Enabled: false
RSpec/NestedGroups:
Enabled: false
Style/AsciiComments:
Enabled: false
Style/IfUnlessModifier:
Enabled: false
Style/SymbolProc:
Enabled: false
---
.travis.yml:
addons:
apt:
sources:
- augeas
packages:
- libaugeas-dev
acceptance:
- '*'
forge_password: "XAv4O363tng0KuRnu1ZhhwORy+2CF9UQwdwlFmS+NG9jOaTZZN+PMK8iC7OSIvZN6cfKlYjHRHNuxFBnYlnMrLsM9fVxt4NjjznOgIKQpQDleWk4UitZj5ntyHmUtYtofUd5Bhi/sdYXwGN9pVRCrcfFBmsIRq/dOhXD7Wy5KcQ="
user: camptocamp
secure: "XAv4O363tng0KuRnu1ZhhwORy+2CF9UQwdwlFmS+NG9jOaTZZN+PMK8iC7OSIvZN6cfKlYjHRHNuxFBnYlnMrLsM9fVxt4NjjznOgIKQpQDleWk4UitZj5ntyHmUtYtofUd5Bhi/sdYXwGN9pVRCrcfFBmsIRq/dOhXD7Wy5KcQ="
includes:
-
env: CHECK="check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop syntax lint metadata_lint"
stage: static
-
env: PUPPET_GEM_VERSION="~> 5.0" CHECK=parallel_spec
rvm: 2.4.5
stage: spec
-
env: PUPPET_GEM_VERSION="~> 6.0" CHECK=parallel_spec
rvm: 2.5.3
stage: spec
-
env: DEPLOY_TO_FORGE=yes
stage: deploy
- rvm: default
sudo: required
services: docker
env:
- PUPPET_INSTALL_TYPE=agent
- BEAKER_IS_PE=no
- BEAKER_PUPPET_COLLECTION=puppet5
- BEAKER_debug=true
- BEAKER_setfile=debian7-64{hypervisor=docker}
bundler_args:
script: bundle exec rspec spec/acceptance/*_spec.rb
stage: acceptance
- rvm: default
sudo: required
services: docker
env:
- PUPPET_INSTALL_TYPE=agent
- BEAKER_IS_PE=no
- BEAKER_PUPPET_COLLECTION=puppet5
- BEAKER_debug=true
- BEAKER_setfile=debian8-64{hypervisor=docker}
bundler_args:
script: bundle exec rspec spec/acceptance/*_spec.rb
stage: acceptance
- rvm: default
sudo: required
services: docker
env:
- PUPPET_INSTALL_TYPE=agent
- BEAKER_IS_PE=no
- BEAKER_PUPPET_COLLECTION=puppet5
- BEAKER_debug=true
- BEAKER_setfile=debian9-64{hypervisor=docker}
bundler_args:
script: bundle exec rspec spec/acceptance/*_spec.rb
stage: acceptance
- rvm: default
sudo: required
services: docker
env:
- PUPPET_INSTALL_TYPE=agent
- BEAKER_IS_PE=no
- BEAKER_PUPPET_COLLECTION=puppet5
- BEAKER_debug=true
- BEAKER_setfile=ubuntu1404-64{hypervisor=docker}
bundler_args:
script: bundle exec rspec spec/acceptance/*_spec.rb
stage: acceptance
- rvm: default
sudo: required
services: docker
env:
- PUPPET_INSTALL_TYPE=agent
- BEAKER_IS_PE=no
- BEAKER_PUPPET_COLLECTION=puppet5
- BEAKER_debug=true
- BEAKER_setfile=ubuntu1604-64{hypervisor=docker}
bundler_args:
script: bundle exec rspec spec/acceptance/*_spec.rb
stage: acceptance
- rvm: default
sudo: required
services: docker
env:
- PUPPET_INSTALL_TYPE=agent
- BEAKER_IS_PE=no
- BEAKER_PUPPET_COLLECTION=puppet5
- BEAKER_debug=true
- BEAKER_setfile=ubuntu1804-64{hypervisor=docker}
bundler_args:
script: bundle exec rspec spec/acceptance/*_spec.rb
- rvm: default
sudo: required
services: docker
env:
- PUPPET_INSTALL_TYPE=agent
- BEAKER_IS_PE=no
- BEAKER_PUPPET_COLLECTION=puppet5
- BEAKER_debug=true
- BEAKER_setfile=centos6-64{hypervisor=docker}
bundler_args:
script: bundle exec rspec spec/acceptance/*_spec.rb
stage: acceptance
- rvm: default
sudo: required
services: docker
env:
- PUPPET_INSTALL_TYPE=agent
- BEAKER_IS_PE=no
- BEAKER_PUPPET_COLLECTION=puppet5
- BEAKER_debug=true
- BEAKER_setfile=centos7-64{hypervisor=docker}
bundler_args:
script: bundle exec rspec spec/acceptance/*_spec.rb
stage: acceptance
allow_failures:
# Exim is not properly stopped on these OSes, which makes the run non
# idempotent
......@@ -17,6 +134,7 @@
- BEAKER_setfile=debian6-64{hypervisor=docker}
bundler_args:
script: bundle exec rspec spec/acceptance/*_spec.rb
stage: acceptance
- rvm: default
sudo: required
services: docker
......@@ -28,4 +146,12 @@
- BEAKER_setfile=debian7-64{hypervisor=docker}
bundler_args:
script: bundle exec rspec spec/acceptance/*_spec.rb
stage: acceptance
Gemfile:
required:
':development':
- gem: ruby-augeas
':system_tests':
- gem: beaker-hostgenerator
- gem: "puppet-module-posix-system-r#{minor_version}"
---
dist: xenial
language: ruby
sudo: false
cache: bundler
addons:
apt:
packages:
- libaugeas-dev
sources:
- augeas
cache: bundler
packages:
- libaugeas-dev
before_install:
- bundle -v
- rm -f Gemfile.lock
- gem update --system $RUBYGEMS_VERSION
- gem --version
- bundle -v
script:
- 'bundle exec rake $CHECK'
bundler_args: --without system_tests
script: ["bundle exec rake validate", "bundle exec rake lint", "bundle exec rake spec SPEC_OPTS='--format documentation'"]
rvm:
- 2.5.3
stages:
- static
- spec
- acceptance
-
if: tag =~ ^v\d
name: deploy
matrix:
fast_finish: true
include:
- rvm: 2.1
env: PUPPET_GEM_VERSION="~> 4.0"
- rvm: 2.4
env: PUPPET_GEM_VERSION="~> 5.0"
- rvm: 2.5
env: PUPPET_GEM_VERSION="~> 6.0"
- rvm: default
sudo: required
services: docker
env:
- PUPPET_INSTALL_TYPE=agent
- BEAKER_IS_PE=no
- BEAKER_PUPPET_COLLECTION=puppet5
- BEAKER_debug=true
- BEAKER_setfile=debian7-64{hypervisor=docker}
bundler_args:
script: bundle exec rspec spec/acceptance/*_spec.rb
- rvm: default
sudo: required
services: docker
env:
- PUPPET_INSTALL_TYPE=agent
- BEAKER_IS_PE=no
- BEAKER_PUPPET_COLLECTION=puppet5
- BEAKER_debug=true
- BEAKER_setfile=debian8-64{hypervisor=docker}
bundler_args:
script: bundle exec rspec spec/acceptance/*_spec.rb
- rvm: default
sudo: required
services: docker
env:
- PUPPET_INSTALL_TYPE=agent
- BEAKER_IS_PE=no
- BEAKER_PUPPET_COLLECTION=puppet5
- BEAKER_debug=true
- BEAKER_setfile=debian9-64{hypervisor=docker}
bundler_args:
script: bundle exec rspec spec/acceptance/*_spec.rb
- rvm: default
sudo: required
services: docker
env:
- PUPPET_INSTALL_TYPE=agent
- BEAKER_IS_PE=no
- BEAKER_PUPPET_COLLECTION=puppet5
- BEAKER_debug=true
- BEAKER_setfile=ubuntu1404-64{hypervisor=docker}
bundler_args:
script: bundle exec rspec spec/acceptance/*_spec.rb
- rvm: default
sudo: required
services: docker
env:
- PUPPET_INSTALL_TYPE=agent
- BEAKER_IS_PE=no
- BEAKER_PUPPET_COLLECTION=puppet5
- BEAKER_debug=true
- BEAKER_setfile=ubuntu1604-64{hypervisor=docker}
bundler_args:
script: bundle exec rspec spec/acceptance/*_spec.rb
- rvm: default
sudo: required
services: docker
env:
- PUPPET_INSTALL_TYPE=agent
- BEAKER_IS_PE=no
- BEAKER_PUPPET_COLLECTION=puppet5
- BEAKER_debug=true
- BEAKER_setfile=ubuntu1804-64{hypervisor=docker}
bundler_args:
script: bundle exec rspec spec/acceptance/*_spec.rb
- rvm: default
sudo: required
services: docker
env:
- PUPPET_INSTALL_TYPE=agent
- BEAKER_IS_PE=no
- BEAKER_PUPPET_COLLECTION=puppet5
- BEAKER_debug=true
- BEAKER_setfile=centos6-64{hypervisor=docker}
bundler_args:
script: bundle exec rspec spec/acceptance/*_spec.rb
- rvm: default
sudo: required
services: docker
env:
- PUPPET_INSTALL_TYPE=agent
- BEAKER_IS_PE=no
- BEAKER_PUPPET_COLLECTION=puppet5
- BEAKER_debug=true
- BEAKER_setfile=centos7-64{hypervisor=docker}
bundler_args:
script: bundle exec rspec spec/acceptance/*_spec.rb
allow_failures:
- rvm: default
-
env: CHECK="check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop syntax lint metadata_lint"
stage: static
-
env: PUPPET_GEM_VERSION="~> 5.0" CHECK=parallel_spec
rvm: 2.4.5
stage: spec
-
env: PUPPET_GEM_VERSION="~> 6.0" CHECK=parallel_spec
rvm: 2.5.3
stage: spec
-
env: DEPLOY_TO_FORGE=yes
stage: deploy
-
bundler_args:
env: ["PUPPET_INSTALL_TYPE=agent", "BEAKER_IS_PE=no", "BEAKER_PUPPET_COLLECTION=puppet5", "BEAKER_debug=true", "BEAKER_setfile=debian7-64{hypervisor=docker}"]
rvm: default
script: bundle exec rspec spec/acceptance/*_spec.rb
services: docker
stage: acceptance
sudo: required
-
bundler_args:
env: ["PUPPET_INSTALL_TYPE=agent", "BEAKER_IS_PE=no", "BEAKER_PUPPET_COLLECTION=puppet5", "BEAKER_debug=true", "BEAKER_setfile=debian8-64{hypervisor=docker}"]
rvm: default
script: bundle exec rspec spec/acceptance/*_spec.rb
services: docker
env: ["PUPPET_INSTALL_TYPE=agent", "BEAKER_IS_PE=no", "BEAKER_PUPPET_COLLECTION=puppet5", "BEAKER_debug=true", "BEAKER_setfile=debian6-64{hypervisor=docker}"]
stage: acceptance
sudo: required
-
bundler_args:
env: ["PUPPET_INSTALL_TYPE=agent", "BEAKER_IS_PE=no", "BEAKER_PUPPET_COLLECTION=puppet5", "BEAKER_debug=true", "BEAKER_setfile=debian9-64{hypervisor=docker}"]
rvm: default
script: bundle exec rspec spec/acceptance/*_spec.rb
- rvm: default
services: docker
stage: acceptance
sudo: required
-
bundler_args:
env: ["PUPPET_INSTALL_TYPE=agent", "BEAKER_IS_PE=no", "BEAKER_PUPPET_COLLECTION=puppet5", "BEAKER_debug=true", "BEAKER_setfile=ubuntu1404-64{hypervisor=docker}"]
rvm: default
script: bundle exec rspec spec/acceptance/*_spec.rb
services: docker
env: ["PUPPET_INSTALL_TYPE=agent", "BEAKER_IS_PE=no", "BEAKER_PUPPET_COLLECTION=puppet5", "BEAKER_debug=true", "BEAKER_setfile=debian7-64{hypervisor=docker}"]
stage: acceptance
sudo: required
-
bundler_args:
env: ["PUPPET_INSTALL_TYPE=agent", "BEAKER_IS_PE=no", "BEAKER_PUPPET_COLLECTION=puppet5", "BEAKER_debug=true", "BEAKER_setfile=ubuntu1604-64{hypervisor=docker}"]
rvm: default
script: bundle exec rspec spec/acceptance/*_spec.rb
services: docker
stage: acceptance
sudo: required
-
bundler_args:
env: ["PUPPET_INSTALL_TYPE=agent", "BEAKER_IS_PE=no", "BEAKER_PUPPET_COLLECTION=puppet5", "BEAKER_debug=true", "BEAKER_setfile=ubuntu1804-64{hypervisor=docker}"]
rvm: default
script: bundle exec rspec spec/acceptance/*_spec.rb
services: docker
sudo: required
-
bundler_args:
env: ["PUPPET_INSTALL_TYPE=agent", "BEAKER_IS_PE=no", "BEAKER_PUPPET_COLLECTION=puppet5", "BEAKER_debug=true", "BEAKER_setfile=centos6-64{hypervisor=docker}"]
rvm: default
script: bundle exec rspec spec/acceptance/*_spec.rb
services: docker
stage: acceptance
sudo: required
-
bundler_args:
env: ["PUPPET_INSTALL_TYPE=agent", "BEAKER_IS_PE=no", "BEAKER_PUPPET_COLLECTION=puppet5", "BEAKER_debug=true", "BEAKER_setfile=centos7-64{hypervisor=docker}"]
rvm: default
script: bundle exec rspec spec/acceptance/*_spec.rb
services: docker
stage: acceptance
sudo: required
-
env: DEPLOY_TO_FORGE=yes
stage: deploy
allow_failures:
-
bundler_args:
env: ["PUPPET_INSTALL_TYPE=agent", "BEAKER_IS_PE=no", "BEAKER_PUPPET_COLLECTION=puppet5", "BEAKER_debug=true", "BEAKER_setfile=debian6-64{hypervisor=docker}"]
rvm: default
script: bundle exec rspec spec/acceptance/*_spec.rb
services: docker
stage: acceptance
sudo: required
-
bundler_args:
env: ["PUPPET_INSTALL_TYPE=agent", "BEAKER_IS_PE=no", "BEAKER_PUPPET_COLLECTION=puppet5", "BEAKER_debug=true", "BEAKER_setfile=debian7-64{hypervisor=docker}"]
rvm: default
script: bundle exec rspec spec/acceptance/*_spec.rb
services: docker
stage: acceptance
sudo: required
branches:
only:
- master