puppetlabs_spec_helper 2.16.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +15 -0
- data/.rubocop.yml +2 -10
- data/.rubocop_todo.yml +3 -13
- data/.travis.yml +4 -14
- data/CHANGELOG.md +31 -1
- data/Gemfile +2 -9
- data/HISTORY.md +1 -1
- data/README.md +2 -2
- data/lib/puppetlabs_spec_helper/puppet_spec_helper.rb +1 -1
- data/lib/puppetlabs_spec_helper/puppetlabs_spec/puppet_internals.rb +2 -2
- data/lib/puppetlabs_spec_helper/rake_tasks.rb +45 -79
- data/lib/puppetlabs_spec_helper/tasks/fixtures.rb +1 -1
- data/lib/puppetlabs_spec_helper/version.rb +1 -1
- data/puppetlabs_spec_helper.gemspec +2 -1
- metadata +9 -22
- data/lib/puppetlabs_spec_helper/tasks/beaker.rb +0 -115
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f934201ede34e89f4c04e3cfa7b952e6e31b883163c06138833f3d1ec631d33d
|
|
4
|
+
data.tar.gz: 69202a2e69af3b92d9fe44298916005791d52f227d0151826dee267d8f3a10dc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 962d07bc1fd4b324754d124e4c30619e238e342a18032ae210aa26531c61be9d4ecd7572e88e564ae4533d01c58a1abf9d907f0c89f8d3f59f2b136140913969
|
|
7
|
+
data.tar.gz: 452342796faa97b4d2b4cb4a16c06476358233de3e4ea7cf6d2f52f1c066807b6387bc4488072c4d424640db6706cf4f9047a4daf8740dd6c9c32016a865d721
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
updates:
|
|
3
|
+
- package-ecosystem: bundler
|
|
4
|
+
directory: "/"
|
|
5
|
+
schedule:
|
|
6
|
+
interval: daily
|
|
7
|
+
time: "13:00"
|
|
8
|
+
open-pull-requests-limit: 10
|
|
9
|
+
ignore:
|
|
10
|
+
- dependency-name: rubocop
|
|
11
|
+
versions:
|
|
12
|
+
- "> 0.49, < 1"
|
|
13
|
+
- dependency-name: rubocop
|
|
14
|
+
versions:
|
|
15
|
+
- ">= 1.a, < 2"
|
data/.rubocop.yml
CHANGED
|
@@ -2,7 +2,7 @@ require: rubocop-rspec
|
|
|
2
2
|
inherit_from: .rubocop_todo.yml
|
|
3
3
|
|
|
4
4
|
AllCops:
|
|
5
|
-
TargetRubyVersion: 2.
|
|
5
|
+
TargetRubyVersion: 2.4
|
|
6
6
|
# let dependabot find the rough spots for us
|
|
7
7
|
NewCops: enable
|
|
8
8
|
Exclude:
|
|
@@ -16,10 +16,6 @@ AllCops:
|
|
|
16
16
|
- package-testing/vendor/**/*
|
|
17
17
|
- package-testing/vendor/**/.*
|
|
18
18
|
|
|
19
|
-
Layout/HeredocIndentation:
|
|
20
|
-
Description: The `squiggly` style would be preferable, but is only available from ruby 2.3. We'll enable this when we can.
|
|
21
|
-
Enabled: False
|
|
22
|
-
|
|
23
19
|
# Metrics, excludes complexity and sizing metrics for now, as ruby's defaults are very strict
|
|
24
20
|
Metrics/AbcSize:
|
|
25
21
|
Enabled: False
|
|
@@ -36,7 +32,7 @@ Metrics/ClassLength:
|
|
|
36
32
|
Metrics/CyclomaticComplexity:
|
|
37
33
|
Enabled: False
|
|
38
34
|
|
|
39
|
-
|
|
35
|
+
Metrics/LineLength:
|
|
40
36
|
Description: People have wide screens, use them.
|
|
41
37
|
Max: 200
|
|
42
38
|
|
|
@@ -147,10 +143,6 @@ Style/SymbolArray:
|
|
|
147
143
|
Layout/EndOfLine:
|
|
148
144
|
EnforcedStyle: lf
|
|
149
145
|
|
|
150
|
-
RSpec/FactoryBot/CreateList:
|
|
151
|
-
Description: produces lots of errors (not violations) with out code
|
|
152
|
-
Enabled: false
|
|
153
|
-
|
|
154
146
|
Style/AccessModifierDeclarations:
|
|
155
147
|
EnforcedStyle: inline
|
|
156
148
|
|
data/.rubocop_todo.yml
CHANGED
|
@@ -1,28 +1,19 @@
|
|
|
1
1
|
# This configuration was generated by
|
|
2
2
|
# `rubocop --auto-gen-config`
|
|
3
|
-
# on
|
|
3
|
+
# on 2021-02-09 10:30:38 +0000 using RuboCop version 0.57.2.
|
|
4
4
|
# The point is for the user to remove these configuration records
|
|
5
5
|
# one by one as the offenses are removed from the code base.
|
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
|
7
7
|
# versions of RuboCop, may require this file to be generated again.
|
|
8
8
|
|
|
9
|
-
# Offense count:
|
|
9
|
+
# Offense count: 1
|
|
10
10
|
# Cop supports --auto-correct.
|
|
11
11
|
# Configuration parameters: EnforcedStyleAlignWith, AutoCorrect, Severity.
|
|
12
12
|
# SupportedStylesAlignWith: keyword, variable, start_of_line
|
|
13
13
|
Layout/EndAlignment:
|
|
14
14
|
Exclude:
|
|
15
|
-
- 'lib/puppetlabs_spec_helper/rake_tasks.rb'
|
|
16
15
|
- 'spec/watchr.rb'
|
|
17
16
|
|
|
18
|
-
# Offense count: 1
|
|
19
|
-
# Cop supports --auto-correct.
|
|
20
|
-
# Configuration parameters: EnforcedStyle.
|
|
21
|
-
# SupportedStyles: auto_detection, squiggly, active_support, powerpack, unindent
|
|
22
|
-
Layout/IndentHeredoc:
|
|
23
|
-
Exclude:
|
|
24
|
-
- 'lib/puppetlabs_spec_helper/rake_tasks.rb'
|
|
25
|
-
|
|
26
17
|
# Offense count: 4
|
|
27
18
|
# Configuration parameters: AllowSafeAssignment.
|
|
28
19
|
Lint/AssignmentInCondition:
|
|
@@ -38,10 +29,9 @@ Lint/HandleExceptions:
|
|
|
38
29
|
- 'lib/puppetlabs_spec_helper/puppetlabs_spec/files.rb'
|
|
39
30
|
- 'lib/puppetlabs_spec_helper/rake_tasks.rb'
|
|
40
31
|
|
|
41
|
-
# Offense count:
|
|
32
|
+
# Offense count: 1
|
|
42
33
|
Lint/UselessAssignment:
|
|
43
34
|
Exclude:
|
|
44
|
-
- 'lib/puppetlabs_spec_helper/puppet_spec_helper.rb'
|
|
45
35
|
- 'lib/puppetlabs_spec_helper/puppetlabs_spec/puppet_internals.rb'
|
|
46
36
|
|
|
47
37
|
# Offense count: 2
|
data/.travis.yml
CHANGED
|
@@ -4,30 +4,20 @@ language: ruby
|
|
|
4
4
|
cache: bundler
|
|
5
5
|
before_install: bundle -v
|
|
6
6
|
script: bundle exec rake
|
|
7
|
-
|
|
7
|
+
jobs:
|
|
8
8
|
fast_finish: true
|
|
9
9
|
include:
|
|
10
10
|
- rvm: '2.7'
|
|
11
|
-
env: PUPPET_GEM_VERSION='https://github.com/puppetlabs/puppet.git#main'
|
|
11
|
+
env: PUPPET_GEM_VERSION='https://github.com/puppetlabs/puppet.git#main'
|
|
12
|
+
- rvm: '2.7'
|
|
13
|
+
env: PUPPET_GEM_VERSION='~> 7.0' COVERAGE=yes
|
|
12
14
|
- rvm: '2.6'
|
|
13
15
|
env: PUPPET_GEM_VERSION='~> 6.0' COVERAGE=yes
|
|
14
16
|
- rvm: '2.5'
|
|
15
17
|
env: PUPPET_GEM_VERSION='~> 6.0' COVERAGE=yes
|
|
16
18
|
- rvm: '2.4'
|
|
17
19
|
env: PUPPET_GEM_VERSION='~> 6.0' COVERAGE=yes
|
|
18
|
-
- rvm: '2.3'
|
|
19
|
-
env: PUPPET_GEM_VERSION='~> 6.0'
|
|
20
20
|
- rvm: '2.4'
|
|
21
21
|
env: PUPPET_GEM_VERSION='~> 5.0' COVERAGE=yes
|
|
22
|
-
- rvm: '2.3'
|
|
23
|
-
env: PUPPET_GEM_VERSION='~> 5.0'
|
|
24
|
-
- rvm: '2.1'
|
|
25
|
-
env: PUPPET_GEM_VERSION='~> 5.0'
|
|
26
|
-
- rvm: '2.4'
|
|
27
|
-
env: PUPPET_GEM_VERSION='~> 4.0' COVERAGE=yes
|
|
28
|
-
- rvm: '2.3'
|
|
29
|
-
env: PUPPET_GEM_VERSION='~> 4.0'
|
|
30
|
-
- rvm: '2.1'
|
|
31
|
-
env: PUPPET_GEM_VERSION='~> 4.0'
|
|
32
22
|
notifications:
|
|
33
23
|
email: false
|
data/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,35 @@
|
|
|
3
3
|
All significant changes to this repo will be summarized in this file.
|
|
4
4
|
|
|
5
5
|
|
|
6
|
+
## [v4.0.0](https://github.com/puppetlabs/puppetlabs_spec_helper/tree/v4.0.0) (2021-07-26)
|
|
7
|
+
|
|
8
|
+
[Full Changelog](https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v3.0.0...v4.0.0)
|
|
9
|
+
|
|
10
|
+
**Implemented enhancements:**
|
|
11
|
+
|
|
12
|
+
- Use Rubocop's Github Actions formatter if possible [\#340](https://github.com/puppetlabs/puppetlabs_spec_helper/pull/340) ([ekohl](https://github.com/ekohl))
|
|
13
|
+
- Remove beaker integration [\#338](https://github.com/puppetlabs/puppetlabs_spec_helper/pull/338) ([ekohl](https://github.com/ekohl))
|
|
14
|
+
|
|
15
|
+
**Merged pull requests:**
|
|
16
|
+
|
|
17
|
+
- Upgrade to GitHub-native Dependabot [\#336](https://github.com/puppetlabs/puppetlabs_spec_helper/pull/336) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
|
|
18
|
+
- \(IAC-1452\) - removal of Inappropriate Terminology [\#335](https://github.com/puppetlabs/puppetlabs_spec_helper/pull/335) ([david22swan](https://github.com/david22swan))
|
|
19
|
+
- Add gemspec required\_ruby\_version [\#334](https://github.com/puppetlabs/puppetlabs_spec_helper/pull/334) ([alexjfisher](https://github.com/alexjfisher))
|
|
20
|
+
|
|
21
|
+
## [v3.0.0](https://github.com/puppetlabs/puppetlabs_spec_helper/tree/v3.0.0) (2021-02-10)
|
|
22
|
+
|
|
23
|
+
[Full Changelog](https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.16.0...v3.0.0)
|
|
24
|
+
|
|
25
|
+
**Implemented enhancements:**
|
|
26
|
+
|
|
27
|
+
- dropping rubies before 2.4 [\#332](https://github.com/puppetlabs/puppetlabs_spec_helper/pull/332) ([DavidS](https://github.com/DavidS))
|
|
28
|
+
- Remove i18n/gettext task [\#331](https://github.com/puppetlabs/puppetlabs_spec_helper/pull/331) ([DavidS](https://github.com/DavidS))
|
|
29
|
+
- Restructure PuppetLint rake tasks so they can be configurable [\#330](https://github.com/puppetlabs/puppetlabs_spec_helper/pull/330) ([nmaludy](https://github.com/nmaludy))
|
|
30
|
+
|
|
31
|
+
**Merged pull requests:**
|
|
32
|
+
|
|
33
|
+
- Release prep for v3.0.0 [\#333](https://github.com/puppetlabs/puppetlabs_spec_helper/pull/333) ([DavidS](https://github.com/DavidS))
|
|
34
|
+
|
|
6
35
|
## [v2.16.0](https://github.com/puppetlabs/puppetlabs_spec_helper/tree/v2.16.0) (2021-01-18)
|
|
7
36
|
|
|
8
37
|
[Full Changelog](https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.15.0...v2.16.0)
|
|
@@ -15,6 +44,7 @@ All significant changes to this repo will be summarized in this file.
|
|
|
15
44
|
|
|
16
45
|
**Merged pull requests:**
|
|
17
46
|
|
|
47
|
+
- Release prep for v2.16.0 [\#329](https://github.com/puppetlabs/puppetlabs_spec_helper/pull/329) ([DavidS](https://github.com/DavidS))
|
|
18
48
|
- Update pathspec requirement from ~\> 0.2.1 to \>= 0.2.1, \< 1.1.0 [\#328](https://github.com/puppetlabs/puppetlabs_spec_helper/pull/328) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
|
|
19
49
|
- Update rubocop requirement from = 0.49 to 0.57.2; prepare for future move to 1.3.1 [\#322](https://github.com/puppetlabs/puppetlabs_spec_helper/pull/322) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
|
|
20
50
|
|
|
@@ -634,7 +664,7 @@ compatible yet.
|
|
|
634
664
|
### Added
|
|
635
665
|
* Initial release
|
|
636
666
|
|
|
637
|
-
[unreleased]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.8.0...
|
|
667
|
+
[unreleased]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.8.0...main
|
|
638
668
|
[2.8.0]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.7.0...v2.8.0
|
|
639
669
|
[2.7.0]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.6.2...v2.7.0
|
|
640
670
|
[2.6.2]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.6.1...v2.6.2
|
data/Gemfile
CHANGED
|
@@ -22,10 +22,9 @@ gemspec
|
|
|
22
22
|
def infer_puppet_version
|
|
23
23
|
# Infer the Puppet Gem version based on the Ruby Version
|
|
24
24
|
ruby_ver = Gem::Version.new(RUBY_VERSION.dup)
|
|
25
|
+
return '~> 7.0' if ruby_ver >= Gem::Version.new('2.7.0')
|
|
25
26
|
return '~> 6.0' if ruby_ver >= Gem::Version.new('2.5.0')
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
'~> 4.0'
|
|
27
|
+
'~> 5.0'
|
|
29
28
|
end
|
|
30
29
|
|
|
31
30
|
group :development do
|
|
@@ -40,10 +39,4 @@ group :development do
|
|
|
40
39
|
end
|
|
41
40
|
end
|
|
42
41
|
|
|
43
|
-
# pin some gems for older ruby versions
|
|
44
|
-
gem 'fakefs', '<= 0.13.3' if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.4.0')
|
|
45
|
-
gem 'json_pure', '<=2.0.1' if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.0.0')
|
|
46
|
-
gem 'puppet-syntax', '<= 3' if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.4.0')
|
|
47
|
-
gem 'rack', '~> 1' if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.2.0')
|
|
48
|
-
|
|
49
42
|
# vim:filetype=ruby
|
data/HISTORY.md
CHANGED
|
@@ -450,7 +450,7 @@ compatible yet.
|
|
|
450
450
|
### Added
|
|
451
451
|
* Initial release
|
|
452
452
|
|
|
453
|
-
[unreleased]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.8.0...
|
|
453
|
+
[unreleased]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.8.0...main
|
|
454
454
|
[2.8.0]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.7.0...v2.8.0
|
|
455
455
|
[2.7.0]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.6.2...v2.7.0
|
|
456
456
|
[2.6.2]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.6.1...v2.6.2
|
data/README.md
CHANGED
|
@@ -102,10 +102,10 @@ This project is intended to serve two purposes:
|
|
|
102
102
|
To Use this Project
|
|
103
103
|
===================
|
|
104
104
|
|
|
105
|
-
The most common usage scenario is that you will check out the '
|
|
105
|
+
The most common usage scenario is that you will check out the 'main'
|
|
106
106
|
branch of this project from github, and install it as a rubygem.
|
|
107
107
|
There should be few or no cases where you would want to have any other
|
|
108
|
-
branch of this project besides
|
|
108
|
+
branch of this project besides main/HEAD.
|
|
109
109
|
|
|
110
110
|
Running on non-current ruby versions
|
|
111
111
|
------------------------------------
|
|
@@ -47,7 +47,7 @@ require 'puppetlabs_spec_helper/puppetlabs_spec/files'
|
|
|
47
47
|
# to compatibility mode for older versions of puppet.
|
|
48
48
|
begin
|
|
49
49
|
require 'puppet/test/test_helper'
|
|
50
|
-
rescue LoadError
|
|
50
|
+
rescue LoadError
|
|
51
51
|
end
|
|
52
52
|
|
|
53
53
|
# This is just a utility class to allow us to isolate the various version-specific
|
|
@@ -12,7 +12,7 @@ module PuppetlabsSpec
|
|
|
12
12
|
def scope(parts = {})
|
|
13
13
|
RSpec.deprecate('scope', replacement: 'rspec-puppet 2.2.0 provides a scope property')
|
|
14
14
|
|
|
15
|
-
if
|
|
15
|
+
if %r{^2\.[67]}.match?(Puppet.version)
|
|
16
16
|
# loadall should only be necessary prior to 3.x
|
|
17
17
|
# Please note, loadall needs to happen first when creating a scope, otherwise
|
|
18
18
|
# you might receive undefined method `function_*' errors
|
|
@@ -23,7 +23,7 @@ module PuppetlabsSpec
|
|
|
23
23
|
scope_parent = parts[:parent] || scope_compiler.topscope
|
|
24
24
|
scope_resource = parts[:resource] || resource(type: :node, title: scope_compiler.node.name)
|
|
25
25
|
|
|
26
|
-
scope = if
|
|
26
|
+
scope = if %r{^2\.[67]}.match?(Puppet.version)
|
|
27
27
|
Puppet::Parser::Scope.new(compiler: scope_compiler)
|
|
28
28
|
else
|
|
29
29
|
Puppet::Parser::Scope.new(scope_compiler)
|
|
@@ -6,7 +6,6 @@ require 'rspec/core/rake_task'
|
|
|
6
6
|
require 'tmpdir'
|
|
7
7
|
require 'pathname'
|
|
8
8
|
require 'puppetlabs_spec_helper/version'
|
|
9
|
-
require 'puppetlabs_spec_helper/tasks/beaker'
|
|
10
9
|
require 'puppetlabs_spec_helper/tasks/fixtures'
|
|
11
10
|
require 'puppetlabs_spec_helper/tasks/check_symlinks'
|
|
12
11
|
require 'English'
|
|
@@ -149,7 +148,7 @@ namespace :build do
|
|
|
149
148
|
require 'pdk/util'
|
|
150
149
|
require 'pdk/module/build'
|
|
151
150
|
|
|
152
|
-
path = PDK::Module::Build.invoke(:
|
|
151
|
+
path = PDK::Module::Build.invoke(force: true, 'target-dir': File.join(Dir.pwd, 'pkg'))
|
|
153
152
|
puts "Module built: #{path}"
|
|
154
153
|
rescue LoadError
|
|
155
154
|
_ = `pdk --version`
|
|
@@ -172,52 +171,34 @@ require 'puppet-lint/tasks/puppet-lint'
|
|
|
172
171
|
# Must clear as it will not override the existing puppet-lint rake task since we require to import for
|
|
173
172
|
# the PuppetLint::RakeTask
|
|
174
173
|
Rake::Task[:lint].clear
|
|
175
|
-
#
|
|
174
|
+
# Utilize PuppetLint global configuration so that these settings can be tweaked by
|
|
175
|
+
# spec_helper.rb in an individual module
|
|
176
176
|
PuppetLint.configuration.relative = true
|
|
177
|
-
PuppetLint
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
]
|
|
177
|
+
PuppetLint.configuration.ignore_paths ||= []
|
|
178
|
+
PuppetLint.configuration.ignore_paths << '.vendor/**/*.pp'
|
|
179
|
+
PuppetLint.configuration.ignore_paths << 'bundle/**/*.pp'
|
|
180
|
+
PuppetLint.configuration.ignore_paths << 'pkg/**/*.pp'
|
|
181
|
+
PuppetLint.configuration.ignore_paths << 'spec/**/*.pp'
|
|
182
|
+
PuppetLint.configuration.ignore_paths << 'tests/**/*.pp'
|
|
183
|
+
PuppetLint.configuration.ignore_paths << 'types/**/*.pp'
|
|
184
|
+
PuppetLint.configuration.ignore_paths << 'vendor/**/*.pp'
|
|
185
|
+
puppet_lint_disable_checks = %w[
|
|
186
|
+
80chars
|
|
187
|
+
140chars
|
|
188
|
+
class_inherits_from_params_class
|
|
189
|
+
class_parameter_defaults
|
|
190
|
+
disable_autoloader_layout
|
|
191
|
+
documentation
|
|
192
|
+
single_quote_string_with_variables
|
|
193
|
+
]
|
|
194
|
+
puppet_lint_disable_checks.each do |check|
|
|
195
|
+
PuppetLint.configuration.send("disable_#{check}")
|
|
197
196
|
end
|
|
197
|
+
PuppetLint::RakeTask.new(:lint)
|
|
198
198
|
|
|
199
199
|
desc 'Run puppet-lint and fix issues automatically'
|
|
200
200
|
PuppetLint::RakeTask.new(:lint_fix) do |config|
|
|
201
|
-
config.fail_on_warnings = true
|
|
202
201
|
config.fix = true
|
|
203
|
-
config.disable_checks = %w[
|
|
204
|
-
80chars
|
|
205
|
-
140chars
|
|
206
|
-
class_inherits_from_params_class
|
|
207
|
-
class_parameter_defaults
|
|
208
|
-
disable_autoloader_layout
|
|
209
|
-
documentation
|
|
210
|
-
single_quote_string_with_variables
|
|
211
|
-
]
|
|
212
|
-
config.ignore_paths = [
|
|
213
|
-
'.vendor/**/*.pp',
|
|
214
|
-
'bundle/**/*.pp',
|
|
215
|
-
'pkg/**/*.pp',
|
|
216
|
-
'spec/**/*.pp',
|
|
217
|
-
'tests/**/*.pp',
|
|
218
|
-
'types/**/*.pp',
|
|
219
|
-
'vendor/**/*.pp',
|
|
220
|
-
]
|
|
221
202
|
end
|
|
222
203
|
|
|
223
204
|
require 'puppet-syntax/tasks/puppet-syntax'
|
|
@@ -277,9 +258,9 @@ task :compute_dev_version do
|
|
|
277
258
|
|
|
278
259
|
# If we're in a CI environment include our build number
|
|
279
260
|
# If the branch is a release branch we append an 'r' into the new_version,
|
|
280
|
-
# this is due to the release branch buildID conflicting with
|
|
261
|
+
# this is due to the release branch buildID conflicting with main branch when trying to push to the staging forge.
|
|
281
262
|
# More info can be found at https://tickets.puppetlabs.com/browse/FM-6170
|
|
282
|
-
new_version = if build = ENV['BUILD_NUMBER'] || ENV['TRAVIS_BUILD_NUMBER']
|
|
263
|
+
new_version = if build = (ENV['BUILD_NUMBER'] || ENV['TRAVIS_BUILD_NUMBER'])
|
|
283
264
|
if branch.eql? 'release'
|
|
284
265
|
'%s-%s%04d-%s' % [version, 'r', build, sha] # legacy support code # rubocop:disable Style/FormatStringToken
|
|
285
266
|
else
|
|
@@ -355,6 +336,14 @@ begin
|
|
|
355
336
|
RuboCop::RakeTask.new(:rubocop) do |task|
|
|
356
337
|
# These make the rubocop experience maybe slightly less terrible
|
|
357
338
|
task.options = ['-D', '-S', '-E']
|
|
339
|
+
|
|
340
|
+
# Use Rubocop's Github Actions formatter if possible
|
|
341
|
+
if ENV['GITHUB_ACTIONS'] == 'true'
|
|
342
|
+
rubocop_spec = Gem::Specification.find_by_name('rubocop')
|
|
343
|
+
if Gem::Version.new(rubocop_spec.version) >= Gem::Version.new('1.2')
|
|
344
|
+
task.formatters << 'github'
|
|
345
|
+
end
|
|
346
|
+
end
|
|
358
347
|
end
|
|
359
348
|
rescue LoadError
|
|
360
349
|
desc 'rubocop is not available in this installation'
|
|
@@ -363,29 +352,6 @@ rescue LoadError
|
|
|
363
352
|
end
|
|
364
353
|
end
|
|
365
354
|
|
|
366
|
-
module_dir = Dir.pwd
|
|
367
|
-
locales_dir = File.absolute_path('locales', module_dir)
|
|
368
|
-
# if the task is allowed to run when the module does not have a locales directory,
|
|
369
|
-
# the task is run in the puppet gem instead and creates a POT there.
|
|
370
|
-
puts 'gettext-setup tasks will only be loaded if the locales/ directory is present' if Rake.verbose == true
|
|
371
|
-
if File.exist? locales_dir
|
|
372
|
-
begin
|
|
373
|
-
spec = Gem::Specification.find_by_name 'gettext-setup'
|
|
374
|
-
load "#{spec.gem_dir}/lib/tasks/gettext.rake"
|
|
375
|
-
# Initialization requires a valid locales directory
|
|
376
|
-
GettextSetup.initialize(locales_dir)
|
|
377
|
-
namespace :module do
|
|
378
|
-
desc 'Runs all tasks to build a modules POT file for internationalization'
|
|
379
|
-
task :pot_gen do
|
|
380
|
-
Rake::Task['gettext:pot'].invoke
|
|
381
|
-
Rake::Task['gettext:metadata_pot'].invoke("#{module_dir}/metadata.json")
|
|
382
|
-
end
|
|
383
|
-
end
|
|
384
|
-
rescue Gem::LoadError
|
|
385
|
-
puts 'No gettext-setup gem found, skipping GettextSetup config initialization' if Rake.verbose == true
|
|
386
|
-
end
|
|
387
|
-
end
|
|
388
|
-
|
|
389
355
|
def create_gch_task(changelog_user = nil, changelog_project = nil, changelog_since_tag = nil, changelog_tag_pattern = 'v%s')
|
|
390
356
|
if Bundler.rubygems.find_name('github_changelog_generator').any?
|
|
391
357
|
# needed a place to hide these methods
|
|
@@ -451,18 +417,18 @@ def create_gch_task(changelog_user = nil, changelog_project = nil, changelog_sin
|
|
|
451
417
|
else
|
|
452
418
|
desc 'Generate a Changelog from GitHub'
|
|
453
419
|
task :changelog do
|
|
454
|
-
raise
|
|
455
|
-
The changelog tasks depends on unreleased features of the github_changelog_generator gem.
|
|
456
|
-
Please manually add it to your .sync.yml for now, and run `pdk update`:
|
|
457
|
-
---
|
|
458
|
-
Gemfile:
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
MESSAGE
|
|
420
|
+
raise <<~MESSAGE
|
|
421
|
+
The changelog tasks depends on unreleased features of the github_changelog_generator gem.
|
|
422
|
+
Please manually add it to your .sync.yml for now, and run `pdk update`:
|
|
423
|
+
---
|
|
424
|
+
Gemfile:
|
|
425
|
+
optional:
|
|
426
|
+
':development':
|
|
427
|
+
- gem: 'github_changelog_generator'
|
|
428
|
+
git: 'https://github.com/skywinder/github-changelog-generator'
|
|
429
|
+
ref: '20ee04ba1234e9e83eb2ffb5056e23d641c7a018'
|
|
430
|
+
condition: "Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.2.2')"
|
|
431
|
+
MESSAGE
|
|
466
432
|
end
|
|
467
433
|
end
|
|
468
434
|
end
|
|
@@ -41,7 +41,7 @@ module PuppetlabsSpecHelper::Tasks::FixtureHelpers
|
|
|
41
41
|
# @return [Hash] - returns a hash of all the fixture repositories
|
|
42
42
|
# @example
|
|
43
43
|
# {"puppetlabs-stdlib"=>{"target"=>"https://gitlab.com/puppetlabs/puppet-stdlib.git",
|
|
44
|
-
# "ref"=>nil, "branch"=>"
|
|
44
|
+
# "ref"=>nil, "branch"=>"main", "scm"=>nil,
|
|
45
45
|
# }}
|
|
46
46
|
def repositories
|
|
47
47
|
@repositories ||= fixtures('repositories') || {}
|
|
@@ -20,6 +20,8 @@ Gem::Specification.new do |spec|
|
|
|
20
20
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
21
21
|
spec.require_paths = ['lib']
|
|
22
22
|
|
|
23
|
+
spec.required_ruby_version = Gem::Requirement.new('>= 2.4')
|
|
24
|
+
|
|
23
25
|
spec.add_runtime_dependency 'mocha', '~> 1.0'
|
|
24
26
|
spec.add_runtime_dependency 'pathspec', '>= 0.2.1', '< 1.1.0'
|
|
25
27
|
spec.add_runtime_dependency 'puppet-lint', '~> 2.0'
|
|
@@ -28,7 +30,6 @@ Gem::Specification.new do |spec|
|
|
|
28
30
|
|
|
29
31
|
spec.add_development_dependency 'bundler'
|
|
30
32
|
spec.add_development_dependency 'fakefs', ['>= 0.13.3', '< 2']
|
|
31
|
-
spec.add_development_dependency 'gettext-setup', '~> 0.29'
|
|
32
33
|
spec.add_development_dependency 'pry'
|
|
33
34
|
spec.add_development_dependency 'puppet'
|
|
34
35
|
spec.add_development_dependency 'rake', ['>= 10.0', '< 14']
|
metadata
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: puppetlabs_spec_helper
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 4.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Puppet, Inc.
|
|
8
8
|
- Community Contributors
|
|
9
|
-
autorequire:
|
|
9
|
+
autorequire:
|
|
10
10
|
bindir: exe
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2021-
|
|
12
|
+
date: 2021-07-26 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: mocha
|
|
@@ -127,20 +127,6 @@ dependencies:
|
|
|
127
127
|
- - "<"
|
|
128
128
|
- !ruby/object:Gem::Version
|
|
129
129
|
version: '2'
|
|
130
|
-
- !ruby/object:Gem::Dependency
|
|
131
|
-
name: gettext-setup
|
|
132
|
-
requirement: !ruby/object:Gem::Requirement
|
|
133
|
-
requirements:
|
|
134
|
-
- - "~>"
|
|
135
|
-
- !ruby/object:Gem::Version
|
|
136
|
-
version: '0.29'
|
|
137
|
-
type: :development
|
|
138
|
-
prerelease: false
|
|
139
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
140
|
-
requirements:
|
|
141
|
-
- - "~>"
|
|
142
|
-
- !ruby/object:Gem::Version
|
|
143
|
-
version: '0.29'
|
|
144
130
|
- !ruby/object:Gem::Dependency
|
|
145
131
|
name: pry
|
|
146
132
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -225,6 +211,7 @@ executables: []
|
|
|
225
211
|
extensions: []
|
|
226
212
|
extra_rdoc_files: []
|
|
227
213
|
files:
|
|
214
|
+
- ".github/dependabot.yml"
|
|
228
215
|
- ".gitignore"
|
|
229
216
|
- ".noexec.yaml"
|
|
230
217
|
- ".rspec"
|
|
@@ -247,7 +234,6 @@ files:
|
|
|
247
234
|
- lib/puppetlabs_spec_helper/puppetlabs_spec/puppet_internals.rb
|
|
248
235
|
- lib/puppetlabs_spec_helper/puppetlabs_spec_helper.rb
|
|
249
236
|
- lib/puppetlabs_spec_helper/rake_tasks.rb
|
|
250
|
-
- lib/puppetlabs_spec_helper/tasks/beaker.rb
|
|
251
237
|
- lib/puppetlabs_spec_helper/tasks/check_symlinks.rb
|
|
252
238
|
- lib/puppetlabs_spec_helper/tasks/fixtures.rb
|
|
253
239
|
- lib/puppetlabs_spec_helper/version.rb
|
|
@@ -258,7 +244,7 @@ homepage: http://github.com/puppetlabs/puppetlabs_spec_helper
|
|
|
258
244
|
licenses:
|
|
259
245
|
- Apache-2.0
|
|
260
246
|
metadata: {}
|
|
261
|
-
post_install_message:
|
|
247
|
+
post_install_message:
|
|
262
248
|
rdoc_options: []
|
|
263
249
|
require_paths:
|
|
264
250
|
- lib
|
|
@@ -266,15 +252,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
266
252
|
requirements:
|
|
267
253
|
- - ">="
|
|
268
254
|
- !ruby/object:Gem::Version
|
|
269
|
-
version: '
|
|
255
|
+
version: '2.4'
|
|
270
256
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
271
257
|
requirements:
|
|
272
258
|
- - ">="
|
|
273
259
|
- !ruby/object:Gem::Version
|
|
274
260
|
version: '0'
|
|
275
261
|
requirements: []
|
|
276
|
-
|
|
277
|
-
|
|
262
|
+
rubyforge_project:
|
|
263
|
+
rubygems_version: 2.7.6.2
|
|
264
|
+
signing_key:
|
|
278
265
|
specification_version: 4
|
|
279
266
|
summary: Standard tasks and configuration for module spec tests.
|
|
280
267
|
test_files: []
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'rspec/core/rake_task'
|
|
4
|
-
|
|
5
|
-
module PuppetlabsSpecHelper; end
|
|
6
|
-
module PuppetlabsSpecHelper::Tasks; end
|
|
7
|
-
module PuppetlabsSpecHelper::Tasks::BeakerHelpers
|
|
8
|
-
# This is a helper for the self-symlink entry of fixtures.yml
|
|
9
|
-
def source_dir
|
|
10
|
-
Dir.pwd
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
# cache the repositories and return a hash object
|
|
14
|
-
def repositories
|
|
15
|
-
@repositories ||= fixtures('repositories')
|
|
16
|
-
@repositories
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
# get the array of Beaker set names
|
|
20
|
-
# @return [Array<String>]
|
|
21
|
-
def beaker_node_sets
|
|
22
|
-
return @beaker_nodes if @beaker_nodes
|
|
23
|
-
|
|
24
|
-
@beaker_nodes = Dir['spec/acceptance/nodesets/*.yml'].sort.map do |node_set|
|
|
25
|
-
node_set.slice!('.yml')
|
|
26
|
-
File.basename(node_set)
|
|
27
|
-
end
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
# Use "vagrant ssh" to login to the given node in the node set
|
|
31
|
-
# @param set [String] The name of the node set (yml file)
|
|
32
|
-
# @param node [String] The name of the node in the set. For multi-node sets.
|
|
33
|
-
def vagrant_ssh(set, node = nil)
|
|
34
|
-
vagrant_yml_dir = File.join '.vagrant', 'beaker_vagrant_files', "#{set}.yml"
|
|
35
|
-
vagrant_file = File.join vagrant_yml_dir, 'Vagrantfile'
|
|
36
|
-
unless File.file? vagrant_file
|
|
37
|
-
puts "There is no Vagrantfile at: '#{vagrant_file}'. Perhaps, the node is not created or is destroyed."
|
|
38
|
-
exit 1
|
|
39
|
-
end
|
|
40
|
-
Dir.chdir(vagrant_yml_dir) do
|
|
41
|
-
command = 'vagrant ssh'
|
|
42
|
-
command += " #{node}" if node
|
|
43
|
-
# Vagrant is not distributed as a normal gem
|
|
44
|
-
# and we should protect it from the current Ruby environment
|
|
45
|
-
env = {
|
|
46
|
-
'RUBYLIB' => nil,
|
|
47
|
-
'GEM_PATH' => nil,
|
|
48
|
-
'BUNDLE_BIN_PATH' => nil,
|
|
49
|
-
}
|
|
50
|
-
system env, command
|
|
51
|
-
end
|
|
52
|
-
end
|
|
53
|
-
end
|
|
54
|
-
include PuppetlabsSpecHelper::Tasks::BeakerHelpers # legacy support code # rubocop:disable Style/MixinUsage
|
|
55
|
-
|
|
56
|
-
desc 'Run beaker acceptance tests'
|
|
57
|
-
RSpec::Core::RakeTask.new(:beaker) do |t|
|
|
58
|
-
SetupBeaker.setup_beaker(t)
|
|
59
|
-
end
|
|
60
|
-
|
|
61
|
-
class SetupBeaker
|
|
62
|
-
def self.setup_beaker(task)
|
|
63
|
-
task.rspec_opts = []
|
|
64
|
-
task.pattern = 'spec/acceptance'
|
|
65
|
-
# TEST_TIERS env variable is a comma separated list of tiers to run. e.g. low, medium, high
|
|
66
|
-
if ENV['TEST_TIERS']
|
|
67
|
-
test_tiers = ENV['TEST_TIERS'].split(',')
|
|
68
|
-
test_tiers_allowed = ENV.fetch('TEST_TIERS_ALLOWED', 'low,medium,high').split(',')
|
|
69
|
-
raise 'TEST_TIERS env variable must have at least 1 tier specified. Either low, medium or high or one of the tiers listed in TEST_TIERS_ALLOWED (comma separated).' if test_tiers.count == 0
|
|
70
|
-
|
|
71
|
-
test_tiers.each do |tier|
|
|
72
|
-
tier_to_add = tier.strip.downcase
|
|
73
|
-
raise "#{tier_to_add} not a valid test tier." unless test_tiers_allowed.include?(tier_to_add)
|
|
74
|
-
|
|
75
|
-
tiers = "--tag tier_#{tier_to_add}"
|
|
76
|
-
task.rspec_opts.push(tiers)
|
|
77
|
-
end
|
|
78
|
-
else
|
|
79
|
-
puts 'TEST_TIERS env variable not defined. Defaulting to run all tests.'
|
|
80
|
-
end
|
|
81
|
-
task
|
|
82
|
-
end
|
|
83
|
-
end
|
|
84
|
-
|
|
85
|
-
desc 'List available beaker nodesets'
|
|
86
|
-
task 'beaker:sets' do
|
|
87
|
-
beaker_node_sets.each do |set|
|
|
88
|
-
puts set
|
|
89
|
-
end
|
|
90
|
-
end
|
|
91
|
-
|
|
92
|
-
# alias for compatibility
|
|
93
|
-
task 'beaker_nodes' => 'beaker:sets'
|
|
94
|
-
|
|
95
|
-
desc 'Try to use vagrant to login to the Beaker node'
|
|
96
|
-
task 'beaker:ssh', [:set, :node] do |_task, args|
|
|
97
|
-
set = args[:set] || ENV['BEAKER_set'] || ENV['RS_SET'] || 'default'
|
|
98
|
-
node = args[:node]
|
|
99
|
-
vagrant_ssh set, node
|
|
100
|
-
end
|
|
101
|
-
|
|
102
|
-
beaker_node_sets.each do |set|
|
|
103
|
-
desc "Run the Beaker acceptance tests for the node set '#{set}'"
|
|
104
|
-
task "beaker:#{set}" do
|
|
105
|
-
ENV['BEAKER_set'] = set
|
|
106
|
-
Rake::Task['beaker'].reenable
|
|
107
|
-
Rake::Task['beaker'].invoke
|
|
108
|
-
end
|
|
109
|
-
|
|
110
|
-
desc "Use vagrant to login to a node from the set '#{set}'"
|
|
111
|
-
task "beaker:ssh:#{set}", [:node] do |_task, args|
|
|
112
|
-
node = args[:node]
|
|
113
|
-
vagrant_ssh set, node
|
|
114
|
-
end
|
|
115
|
-
end
|