Skip to content
Snippets Groups Projects
Commit c57eb6ca authored by Jonathan Gazeley's avatar Jonathan Gazeley
Browse files

Merge branch 'main' into 144_rocky8_support

parents 5dcf8e1c 0554d584
No related tags found
No related merge requests found
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
/log/ /log/
/pkg/ /pkg/
/spec/fixtures/manifests/ /spec/fixtures/manifests/
/spec/fixtures/modules/ /spec/fixtures/modules/*
/tmp/ /tmp/
/vendor/ /vendor/
/convert_report.txt /convert_report.txt
......
---
stages:
- syntax
- unit
default:
cache:
paths:
- vendor/bundle
before_script: &before_script
- bundle -v
- rm Gemfile.lock || true
- "# Update system gems if requested. This is useful to temporarily workaround troubles in the test runner"
- "# Set `rubygems_version` in the .sync.yml to set a value"
- "# Ignore exit code of SIGPIPE'd yes to not fail with shell's pipefail set"
- '[ -z "$RUBYGEMS_VERSION" ] || (yes || true) | gem update --system $RUBYGEMS_VERSION'
- gem --version
- bundle -v
- bundle install --without system_tests --path vendor/bundle --jobs $(nproc)
validate lint check rubocop-Ruby 2.5.7-Puppet ~> 6:
stage: syntax
image: ruby:2.5.7
script:
- bundle exec rake validate lint check rubocop
variables:
PUPPET_GEM_VERSION: '~> 6'
parallel_spec-Ruby 2.5.7-Puppet ~> 6:
stage: unit
image: ruby:2.5.7
script:
- bundle exec rake parallel_spec
variables:
PUPPET_GEM_VERSION: '~> 6'
validate lint check rubocop-Ruby 2.7.2-Puppet ~> 7:
stage: syntax
image: ruby:2.7.2
script:
- bundle exec rake validate lint check rubocop
variables:
PUPPET_GEM_VERSION: '~> 7'
parallel_spec-Ruby 2.7.2-Puppet ~> 7:
stage: unit
image: ruby:2.7.2
script:
- bundle exec rake parallel_spec
variables:
PUPPET_GEM_VERSION: '~> 7'
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
/log/ /log/
/pkg/ /pkg/
/spec/fixtures/manifests/ /spec/fixtures/manifests/
/spec/fixtures/modules/ /spec/fixtures/modules/*
/tmp/ /tmp/
/vendor/ /vendor/
/convert_report.txt /convert_report.txt
...@@ -26,19 +26,16 @@ ...@@ -26,19 +26,16 @@
.envrc .envrc
/inventory.yaml /inventory.yaml
/spec/fixtures/litmus_inventory.yaml /spec/fixtures/litmus_inventory.yaml
/appveyor.yml
/.editorconfig
/.fixtures.yml /.fixtures.yml
/Gemfile /Gemfile
/.gitattributes /.gitattributes
/.gitignore /.gitignore
/.gitlab-ci.yml
/.pdkignore /.pdkignore
/.puppet-lint.rc /.puppet-lint.rc
/Rakefile /Rakefile
/rakelib/ /rakelib/
/.rspec /.rspec
/.rubocop.yml /..yml
/.yardopts /.yardopts
/spec/ /spec/
/.vscode/ /.vscode/
......
...@@ -4,7 +4,7 @@ require: ...@@ -4,7 +4,7 @@ require:
- rubocop-rspec - rubocop-rspec
AllCops: AllCops:
DisplayCopNames: true DisplayCopNames: true
TargetRubyVersion: '2.5' TargetRubyVersion: '2.6'
Include: Include:
- "**/*.rb" - "**/*.rb"
Exclude: Exclude:
...@@ -111,8 +111,14 @@ Style/MethodCalledOnDoEndBlock: ...@@ -111,8 +111,14 @@ Style/MethodCalledOnDoEndBlock:
Enabled: true Enabled: true
Style/StringMethods: Style/StringMethods:
Enabled: true Enabled: true
Bundler/GemFilename:
Enabled: false
Bundler/InsecureProtocolSource: Bundler/InsecureProtocolSource:
Enabled: false Enabled: false
Capybara/CurrentPathExpectation:
Enabled: false
Capybara/VisibilityMatcher:
Enabled: false
Gemspec/DuplicatedAssignment: Gemspec/DuplicatedAssignment:
Enabled: false Enabled: false
Gemspec/OrderedDependencies: Gemspec/OrderedDependencies:
...@@ -287,11 +293,9 @@ Performance/UriDefaultParser: ...@@ -287,11 +293,9 @@ Performance/UriDefaultParser:
Enabled: false Enabled: false
RSpec/Be: RSpec/Be:
Enabled: false Enabled: false
RSpec/Capybara/CurrentPathExpectation:
Enabled: false
RSpec/Capybara/FeatureMethods: RSpec/Capybara/FeatureMethods:
Enabled: false Enabled: false
RSpec/Capybara/VisibilityMatcher: RSpec/ContainExactly:
Enabled: false Enabled: false
RSpec/ContextMethod: RSpec/ContextMethod:
Enabled: false Enabled: false
...@@ -331,6 +335,8 @@ RSpec/LeakyConstantDeclaration: ...@@ -331,6 +335,8 @@ RSpec/LeakyConstantDeclaration:
Enabled: false Enabled: false
RSpec/LetBeforeExamples: RSpec/LetBeforeExamples:
Enabled: false Enabled: false
RSpec/MatchArray:
Enabled: false
RSpec/MissingExampleGroupArgument: RSpec/MissingExampleGroupArgument:
Enabled: false Enabled: false
RSpec/MultipleExpectations: RSpec/MultipleExpectations:
...@@ -373,8 +379,6 @@ Style/AccessModifierDeclarations: ...@@ -373,8 +379,6 @@ Style/AccessModifierDeclarations:
Enabled: false Enabled: false
Style/AccessorGrouping: Style/AccessorGrouping:
Enabled: false Enabled: false
Style/AsciiComments:
Enabled: false
Style/BisectedAttrAccessor: Style/BisectedAttrAccessor:
Enabled: false Enabled: false
Style/CaseLikeIf: Style/CaseLikeIf:
...@@ -485,35 +489,235 @@ Style/TrailingMethodEndStatement: ...@@ -485,35 +489,235 @@ Style/TrailingMethodEndStatement:
Enabled: false Enabled: false
Style/UnpackFirst: Style/UnpackFirst:
Enabled: false Enabled: false
Capybara/MatchStyle:
Enabled: false
Capybara/NegationMatcher:
Enabled: false
Capybara/SpecificActions:
Enabled: false
Capybara/SpecificFinders:
Enabled: false
Capybara/SpecificMatcher:
Enabled: false
Gemspec/DeprecatedAttributeAssignment:
Enabled: false
Gemspec/DevelopmentDependencies:
Enabled: false
Gemspec/RequireMFA:
Enabled: false
Layout/LineContinuationLeadingSpace:
Enabled: false
Layout/LineContinuationSpacing:
Enabled: false
Layout/LineEndStringConcatenationIndentation:
Enabled: false
Layout/SpaceBeforeBrackets:
Enabled: false
Lint/AmbiguousAssignment:
Enabled: false
Lint/AmbiguousOperatorPrecedence:
Enabled: false
Lint/AmbiguousRange:
Enabled: false
Lint/ConstantOverwrittenInRescue:
Enabled: false
Lint/DeprecatedConstants:
Enabled: false
Lint/DuplicateBranch: Lint/DuplicateBranch:
Enabled: false Enabled: false
Lint/DuplicateMagicComment:
Enabled: false
Lint/DuplicateRegexpCharacterClassElement: Lint/DuplicateRegexpCharacterClassElement:
Enabled: false Enabled: false
Lint/EmptyBlock: Lint/EmptyBlock:
Enabled: false Enabled: false
Lint/EmptyClass: Lint/EmptyClass:
Enabled: false Enabled: false
Lint/EmptyInPattern:
Enabled: false
Lint/IncompatibleIoSelectWithFiberScheduler:
Enabled: false
Lint/LambdaWithoutLiteralBlock:
Enabled: false
Lint/NoReturnInBeginEndBlocks: Lint/NoReturnInBeginEndBlocks:
Enabled: false Enabled: false
Lint/NonAtomicFileOperation:
Enabled: false
Lint/NumberedParameterAssignment:
Enabled: false
Lint/OrAssignmentToConstant:
Enabled: false
Lint/RedundantDirGlobSort:
Enabled: false
Lint/RefinementImportMethods:
Enabled: false
Lint/RequireRangeParentheses:
Enabled: false
Lint/RequireRelativeSelfPath:
Enabled: false
Lint/SymbolConversion:
Enabled: false
Lint/ToEnumArguments: Lint/ToEnumArguments:
Enabled: false Enabled: false
Lint/TripleQuotes:
Enabled: false
Lint/UnexpectedBlockArity: Lint/UnexpectedBlockArity:
Enabled: false Enabled: false
Lint/UnmodifiedReduceAccumulator: Lint/UnmodifiedReduceAccumulator:
Enabled: false Enabled: false
Lint/UselessRescue:
Enabled: false
Lint/UselessRuby2Keywords:
Enabled: false
Metrics/CollectionLiteralLength:
Enabled: false
Naming/BlockForwarding:
Enabled: false
Performance/CollectionLiteralInLoop: Performance/CollectionLiteralInLoop:
Enabled: false Enabled: false
Performance/ConcurrentMonotonicTime:
Enabled: false
Performance/MapCompact:
Enabled: false
Performance/RedundantEqualityComparisonBlock:
Enabled: false
Performance/RedundantSplitRegexpArgument:
Enabled: false
Performance/StringIdentifierArgument:
Enabled: false
RSpec/BeEq:
Enabled: false
RSpec/BeNil:
Enabled: false
RSpec/ChangeByZero:
Enabled: false
RSpec/ClassCheck:
Enabled: false
RSpec/DuplicatedMetadata:
Enabled: false
RSpec/ExcessiveDocstringSpacing:
Enabled: false
RSpec/FactoryBot/ConsistentParenthesesStyle:
Enabled: false
RSpec/FactoryBot/FactoryNameStyle:
Enabled: false
RSpec/FactoryBot/SyntaxMethods:
Enabled: false
RSpec/IdenticalEqualityAssertion:
Enabled: false
RSpec/NoExpectationExample:
Enabled: false
RSpec/PendingWithoutReason:
Enabled: false
RSpec/Rails/AvoidSetupHook:
Enabled: false
RSpec/Rails/HaveHttpStatus:
Enabled: false
RSpec/Rails/InferredSpecType:
Enabled: false
RSpec/Rails/MinitestAssertions:
Enabled: false
RSpec/Rails/TravelAround:
Enabled: false
RSpec/RedundantAround:
Enabled: false
RSpec/SkipBlockInsideExample:
Enabled: false
RSpec/SortMetadata:
Enabled: false
RSpec/SubjectDeclaration:
Enabled: false
RSpec/VerifiedDoubleReference:
Enabled: false
Security/CompoundHash:
Enabled: false
Security/IoMethods:
Enabled: false
Style/ArgumentsForwarding: Style/ArgumentsForwarding:
Enabled: false Enabled: false
Style/ArrayIntersect:
Enabled: false
Style/CollectionCompact: Style/CollectionCompact:
Enabled: false Enabled: false
Style/ComparableClamp:
Enabled: false
Style/ConcatArrayLiterals:
Enabled: false
Style/DirEmpty:
Enabled: false
Style/DocumentDynamicEvalDefinition: Style/DocumentDynamicEvalDefinition:
Enabled: false Enabled: false
Style/EmptyHeredoc:
Enabled: false
Style/EndlessMethod:
Enabled: false
Style/EnvHome:
Enabled: false
Style/FetchEnvVar:
Enabled: false
Style/FileEmpty:
Enabled: false
Style/FileRead:
Enabled: false
Style/FileWrite:
Enabled: false
Style/HashConversion:
Enabled: false
Style/HashExcept:
Enabled: false
Style/IfWithBooleanLiteralBranches:
Enabled: false
Style/InPatternThen:
Enabled: false
Style/MagicCommentFormat:
Enabled: false
Style/MapCompactWithConditionalBlock:
Enabled: false
Style/MapToHash:
Enabled: false
Style/MapToSet:
Enabled: false
Style/MinMaxComparison:
Enabled: false
Style/MultilineInPatternThen:
Enabled: false
Style/NegatedIfElseCondition: Style/NegatedIfElseCondition:
Enabled: false Enabled: false
Style/NestedFileDirname:
Enabled: false
Style/NilLambda: Style/NilLambda:
Enabled: false Enabled: false
Style/NumberedParameters:
Enabled: false
Style/NumberedParametersLimit:
Enabled: false
Style/ObjectThen:
Enabled: false
Style/OpenStructUse:
Enabled: false
Style/OperatorMethodCall:
Enabled: false
Style/QuotedSymbols:
Enabled: false
Style/RedundantArgument: Style/RedundantArgument:
Enabled: false Enabled: false
Style/RedundantConstantBase:
Enabled: false
Style/RedundantDoubleSplatHashBraces:
Enabled: false
Style/RedundantEach:
Enabled: false
Style/RedundantHeredocDelimiterQuotes:
Enabled: false
Style/RedundantInitialize:
Enabled: false
Style/RedundantSelfAssignmentBranch:
Enabled: false
Style/RedundantStringEscape:
Enabled: false
Style/SelectByRegexp:
Enabled: false
Style/StringChars:
Enabled: false
Style/SwapValues: Style/SwapValues:
Enabled: false Enabled: false
---
os: linux
dist: xenial
language: ruby
cache: bundler
before_install:
- bundle -v
- rm -f Gemfile.lock
- "# Update system gems if requested. This is useful to temporarily workaround troubles in the test runner"
- "# See https://github.com/puppetlabs/pdk-templates/commit/705154d5c437796b821691b707156e1b056d244f for an example of how this was used"
- "# Ignore exit code of SIGPIPE'd yes to not fail with shell's pipefail set"
- '[ -z "$RUBYGEMS_VERSION" ] || (yes || true) | gem update --system $RUBYGEMS_VERSION'
- gem --version
- bundle -v
script:
- 'bundle exec rake $CHECK'
bundler_args: --without system_tests
rvm:
- 2.5.7
stages:
- static
- spec
- acceptance
-
if: tag =~ ^v\d
name: deploy
jobs:
fast_finish: true
include:
-
env: CHECK="validate lint check rubocop"
stage: static
-
env: PUPPET_GEM_VERSION="~> 6.0" CHECK=parallel_spec
rvm: 2.5.7
stage: spec
-
env: DEPLOY_TO_FORGE=yes
stage: deploy
branches:
only:
- main
- /^v\d/
notifications:
email: false
...@@ -19,24 +19,25 @@ group :development do ...@@ -19,24 +19,25 @@ group :development do
gem "json", '= 2.5.1', require: false if Gem::Requirement.create(['>= 3.0.0', '< 3.0.5']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) gem "json", '= 2.5.1', require: false if Gem::Requirement.create(['>= 3.0.0', '< 3.0.5']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "json", '= 2.6.1', require: false if Gem::Requirement.create(['>= 3.1.0', '< 3.1.3']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) gem "json", '= 2.6.1', require: false if Gem::Requirement.create(['>= 3.1.0', '< 3.1.3']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "json", '= 2.6.3', require: false if Gem::Requirement.create(['>= 3.2.0', '< 4.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) gem "json", '= 2.6.3', require: false if Gem::Requirement.create(['>= 3.2.0', '< 4.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "voxpupuli-puppet-lint-plugins", '~> 4.0', require: false gem "racc", '~> 1.4.0', require: false if Gem::Requirement.create(['>= 2.7.0', '< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "voxpupuli-puppet-lint-plugins", '~> 5.0', require: false
gem "facterdb", '~> 1.18', require: false gem "facterdb", '~> 1.18', require: false
gem "metadata-json-lint", '>= 2.0.2', '< 4.0.0', require: false gem "metadata-json-lint", '~> 3.0', require: false
gem "puppetlabs_spec_helper", '~> 5.0', require: false gem "puppetlabs_spec_helper", '~> 6.0', require: false
gem "rspec-puppet-facts", '~> 2.0', require: false gem "rspec-puppet-facts", '~> 2.0', require: false
gem "codecov", '~> 0.2', require: false gem "codecov", '~> 0.2', require: false
gem "dependency_checker", '~> 0.2', require: false gem "dependency_checker", '~> 1.0.0', require: false
gem "parallel_tests", '= 3.12.1', require: false gem "parallel_tests", '= 3.12.1', require: false
gem "pry", '~> 0.10', require: false gem "pry", '~> 0.10', require: false
gem "simplecov-console", '~> 0.5', require: false gem "simplecov-console", '~> 0.5', require: false
gem "puppet-debugger", '~> 1.0', require: false gem "puppet-debugger", '~> 1.0', require: false
gem "rubocop", '= 1.6.1', require: false gem "rubocop", '= 1.48.1', require: false
gem "rubocop-performance", '= 1.9.1', require: false gem "rubocop-performance", '= 1.16.0', require: false
gem "rubocop-rspec", '= 2.0.1', require: false gem "rubocop-rspec", '= 2.19.0', require: false
gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw] gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw]
end end
group :system_tests do group :system_tests do
gem "puppet_litmus", '< 1.0.0', require: false, platforms: [:ruby, :x64_mingw] gem "puppet_litmus", '~> 1.0', require: false, platforms: [:ruby, :x64_mingw]
gem "serverspec", '~> 2.41', require: false gem "serverspec", '~> 2.41', require: false
end end
......
# frozen_string_literal: true # frozen_string_literal: true
require 'bundler' require 'bundler'
require 'puppet_litmus/rake_tasks' if Bundler.rubygems.find_name('puppet_litmus').any? require 'puppet_litmus/rake_tasks' if Gem.loaded_specs.key? 'puppet_litmus'
require 'puppetlabs_spec_helper/rake_tasks' require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-syntax/tasks/puppet-syntax' require 'puppet-syntax/tasks/puppet-syntax'
require 'puppet_blacksmith/rake_tasks' if Bundler.rubygems.find_name('puppet-blacksmith').any? require 'github_changelog_generator/task' if Gem.loaded_specs.key? 'github_changelog_generator'
require 'github_changelog_generator/task' if Bundler.rubygems.find_name('github_changelog_generator').any? require 'puppet-strings/tasks' if Gem.loaded_specs.key? 'puppet-strings'
require 'puppet-strings/tasks' if Bundler.rubygems.find_name('puppet-strings').any?
def changelog_user def changelog_user
return unless Rake.application.top_level_tasks.include? "changelog" return unless Rake.application.top_level_tasks.include? "changelog"
...@@ -44,7 +43,7 @@ end ...@@ -44,7 +43,7 @@ end
PuppetLint.configuration.send('disable_relative') PuppetLint.configuration.send('disable_relative')
if Bundler.rubygems.find_name('github_changelog_generator').any? if Gem.loaded_specs.key? 'github_changelog_generator'
GitHubChangelogGenerator::RakeTask.new :changelog do |config| GitHubChangelogGenerator::RakeTask.new :changelog do |config|
raise "Set CHANGELOG_GITHUB_TOKEN environment variable eg 'export CHANGELOG_GITHUB_TOKEN=valid_token_here'" if Rake.application.top_level_tasks.include? "changelog" and ENV['CHANGELOG_GITHUB_TOKEN'].nil? raise "Set CHANGELOG_GITHUB_TOKEN environment variable eg 'export CHANGELOG_GITHUB_TOKEN=valid_token_here'" if Rake.application.top_level_tasks.include? "changelog" and ENV['CHANGELOG_GITHUB_TOKEN'].nil?
config.user = "#{changelog_user}" config.user = "#{changelog_user}"
......
...@@ -94,6 +94,7 @@ class freeradius::params { ...@@ -94,6 +94,7 @@ class freeradius::params {
$fr_basepath = $::operatingsystemmajrelease ? { $fr_basepath = $::operatingsystemmajrelease ? {
'9' => '/etc/freeradius/3.0', '9' => '/etc/freeradius/3.0',
'10' => '/etc/freeradius/3.0', '10' => '/etc/freeradius/3.0',
'11' => '/etc/freeradius/3.0',
'buster/sid' => '/etc/freeradius/3.0', 'buster/sid' => '/etc/freeradius/3.0',
'18.04' => '/etc/freeradius/3.0', '18.04' => '/etc/freeradius/3.0',
'20.04' => '/etc/freeradius/3.0', '20.04' => '/etc/freeradius/3.0',
...@@ -103,6 +104,7 @@ class freeradius::params { ...@@ -103,6 +104,7 @@ class freeradius::params {
$fr_raddbdir = $::operatingsystemmajrelease ? { $fr_raddbdir = $::operatingsystemmajrelease ? {
'9' => "\${sysconfdir}/freeradius/3.0", '9' => "\${sysconfdir}/freeradius/3.0",
'10' => "\${sysconfdir}/freeradius/3.0", '10' => "\${sysconfdir}/freeradius/3.0",
'11' => "\${sysconfdir}/freeradius/3.0",
'buster/sid' => "\${sysconfdir}/freeradius/3.0", 'buster/sid' => "\${sysconfdir}/freeradius/3.0",
'18.04' => "\${sysconfdir}/freeradius/3.0", '18.04' => "\${sysconfdir}/freeradius/3.0",
'20.04' => "\${sysconfdir}/freeradius/3.0", '20.04' => "\${sysconfdir}/freeradius/3.0",
......
...@@ -99,7 +99,7 @@ ...@@ -99,7 +99,7 @@
"version_requirement": ">=4.0.0 <7.0.0" "version_requirement": ">=4.0.0 <7.0.0"
} }
], ],
"pdk-version": "2.7.1", "pdk-version": "3.0.0",
"template-url": "pdk-default#2.7.4", "template-url": "pdk-default#3.0.0",
"template-ref": "tags/2.7.4-0-g58edf57" "template-ref": "tags/3.0.0-0-g056e50d"
} }
...@@ -25,8 +25,8 @@ default_fact_files.each do |f| ...@@ -25,8 +25,8 @@ default_fact_files.each do |f|
next unless File.exist?(f) && File.readable?(f) && File.size?(f) next unless File.exist?(f) && File.readable?(f) && File.size?(f)
begin begin
default_facts.merge!(YAML.safe_load(File.read(f), [], [], true)) default_facts.merge!(YAML.safe_load(File.read(f), permitted_classes: [], permitted_symbols: [], aliases: true))
rescue => e rescue StandardError => e
RSpec.configuration.reporter.message "WARNING: Unable to load #{f}: #{e}" RSpec.configuration.reporter.message "WARNING: Unable to load #{f}: #{e}"
end end
end end
...@@ -46,6 +46,7 @@ RSpec.configure do |c| ...@@ -46,6 +46,7 @@ RSpec.configure do |c|
end end
c.filter_run_excluding(bolt: true) unless ENV['GEM_BOLT'] c.filter_run_excluding(bolt: true) unless ENV['GEM_BOLT']
c.after(:suite) do c.after(:suite) do
RSpec::Puppet::Coverage.report!(0)
end end
# Filter backtrace noise # Filter backtrace noise
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment