puppetlabs_spec_helper 2.13.0 → 2.16.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: ad8505aa8fe7098a8d93aad0c4afda481d0e3512
4
- data.tar.gz: 1190981ff63c6ceabc641ea537264ffde1a8097c
2
+ SHA256:
3
+ metadata.gz: 77cf85ee1cb6e0c063fc70b7633745f22e1a74db5dd004addd055b11a3b2d3aa
4
+ data.tar.gz: 509b75a40c8e4041dbdd73a2f01bed57f141ebd0c44d695551ed3aa554e67d3f
5
5
  SHA512:
6
- metadata.gz: 836edb5dabb80f1f5b3f98581ed07123fe5f77996ba84a4199bd7d2b59109b42e59b8ec94115d05ea0e9c27d3d39b24c70163faf809ac4d22d0f56f01bf357b1
7
- data.tar.gz: 2801e062d093770f274a69c44e3c7414f562ec7144c228a88eaf9c74d6b87aaad55a9cae33a2dadcebb2d8db6c6ebd68101227a12d6a40cf6dc5c9789bc78d25
6
+ metadata.gz: 2c6b745e80ddc0b9d2bad8f902f9155252cf5d8503f8cc1052b3a1f8dc647646701a36145dff46b17bdeaff04e53a32d2927401faf619bfec3ac0fa61212adad
7
+ data.tar.gz: 5fb4f21feb106e531d3b5112494fba80e3deab0775d16bcbf559133cccd06259e3ad5e69d9dd055f4024282c299be9b1aceb38d7d7e5be2074a4a808531dbb64
data/.rspec CHANGED
@@ -1,3 +1,2 @@
1
1
  --format documentation
2
- --color
3
2
  --order rand
@@ -2,7 +2,9 @@ require: rubocop-rspec
2
2
  inherit_from: .rubocop_todo.yml
3
3
 
4
4
  AllCops:
5
- TargetRubyVersion: 1.9
5
+ TargetRubyVersion: 2.1
6
+ # let dependabot find the rough spots for us
7
+ NewCops: enable
6
8
  Exclude:
7
9
  # binstubs, and other utilities
8
10
  - bin/**/*
@@ -14,7 +16,7 @@ AllCops:
14
16
  - package-testing/vendor/**/*
15
17
  - package-testing/vendor/**/.*
16
18
 
17
- Layout/IndentHeredoc:
19
+ Layout/HeredocIndentation:
18
20
  Description: The `squiggly` style would be preferable, but is only available from ruby 2.3. We'll enable this when we can.
19
21
  Enabled: False
20
22
 
@@ -34,7 +36,7 @@ Metrics/ClassLength:
34
36
  Metrics/CyclomaticComplexity:
35
37
  Enabled: False
36
38
 
37
- Metrics/LineLength:
39
+ Layout/LineLength:
38
40
  Description: People have wide screens, use them.
39
41
  Max: 200
40
42
 
@@ -128,7 +130,11 @@ Style/TrailingCommaInArguments:
128
130
  Description: Prefer always trailing comma on multiline argument lists. This makes diffs, and re-ordering nicer.
129
131
  EnforcedStyleForMultiline: comma
130
132
 
131
- Style/TrailingCommaInLiteral:
133
+ Style/TrailingCommaInArrayLiteral:
134
+ Description: Prefer always trailing comma on multiline literals. This makes diffs, and re-ordering nicer.
135
+ EnforcedStyleForMultiline: comma
136
+
137
+ Style/TrailingCommaInHashLiteral:
132
138
  Description: Prefer always trailing comma on multiline literals. This makes diffs, and re-ordering nicer.
133
139
  EnforcedStyleForMultiline: comma
134
140
 
@@ -136,3 +142,22 @@ Style/SymbolArray:
136
142
  Description: Using percent style obscures symbolic intent of array's contents.
137
143
  Enabled: true
138
144
  EnforcedStyle: brackets
145
+
146
+ # Enforce LF line endings, even when on Windows
147
+ Layout/EndOfLine:
148
+ EnforcedStyle: lf
149
+
150
+ RSpec/FactoryBot/CreateList:
151
+ Description: produces lots of errors (not violations) with out code
152
+ Enabled: false
153
+
154
+ Style/AccessModifierDeclarations:
155
+ EnforcedStyle: inline
156
+
157
+ RSpec/ContextWording:
158
+ Prefixes:
159
+ - and
160
+ - but
161
+ - when
162
+ - with
163
+ - without
@@ -1,29 +1,37 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2018-06-17 09:41:41 +0200 using RuboCop version 0.49.1.
3
+ # on 2020-11-16 16:15:06 +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: 4
10
- # Configuration parameters: AllowSafeAssignment.
11
- Lint/AssignmentInCondition:
12
- Exclude:
13
- - 'lib/puppetlabs_spec_helper/puppetlabs_spec/files.rb'
14
- - 'lib/puppetlabs_spec_helper/puppetlabs_spec/fixtures.rb'
15
- - 'lib/puppetlabs_spec_helper/rake_tasks.rb'
16
-
17
9
  # Offense count: 2
18
10
  # Cop supports --auto-correct.
19
- # Configuration parameters: EnforcedStyleAlignWith, SupportedStylesAlignWith, AutoCorrect.
11
+ # Configuration parameters: EnforcedStyleAlignWith, AutoCorrect, Severity.
20
12
  # SupportedStylesAlignWith: keyword, variable, start_of_line
21
- Lint/EndAlignment:
13
+ Layout/EndAlignment:
22
14
  Exclude:
23
15
  - 'lib/puppetlabs_spec_helper/rake_tasks.rb'
24
16
  - 'spec/watchr.rb'
25
17
 
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
26
  # Offense count: 4
27
+ # Configuration parameters: AllowSafeAssignment.
28
+ Lint/AssignmentInCondition:
29
+ Exclude:
30
+ - 'lib/puppetlabs_spec_helper/puppetlabs_spec/files.rb'
31
+ - 'lib/puppetlabs_spec_helper/puppetlabs_spec/fixtures.rb'
32
+ - 'lib/puppetlabs_spec_helper/rake_tasks.rb'
33
+
34
+ # Offense count: 7
27
35
  Lint/HandleExceptions:
28
36
  Exclude:
29
37
  - 'lib/puppetlabs_spec_helper/puppet_spec_helper.rb'
@@ -50,10 +58,11 @@ RSpec/InstanceVariable:
50
58
  - 'spec/acceptance/smoke_spec.rb'
51
59
 
52
60
  # Offense count: 6
61
+ # Configuration parameters: AggregateFailuresByDefault.
53
62
  RSpec/MultipleExpectations:
54
63
  Max: 3
55
64
 
56
- # Offense count: 13
65
+ # Offense count: 18
57
66
  RSpec/NamedSubject:
58
67
  Exclude:
59
68
  - 'spec/unit/puppetlabs_spec_helper/puppetlabs_spec/puppet_internals_spec.rb'
@@ -71,7 +80,8 @@ Security/Eval:
71
80
  - 'lib/puppetlabs_spec_helper/tasks/fixtures.rb'
72
81
 
73
82
  # Offense count: 4
74
- # Configuration parameters: EnforcedStyle, SupportedStyles.
83
+ # Cop supports --auto-correct.
84
+ # Configuration parameters: AutoCorrect, EnforcedStyle.
75
85
  # SupportedStyles: nested, compact
76
86
  Style/ClassAndModuleChildren:
77
87
  Exclude:
@@ -79,7 +89,7 @@ Style/ClassAndModuleChildren:
79
89
  - 'lib/puppetlabs_spec_helper/puppetlabs_spec/matchers.rb'
80
90
  - 'lib/puppetlabs_spec_helper/puppetlabs_spec/puppet_internals.rb'
81
91
 
82
- # Offense count: 11
92
+ # Offense count: 14
83
93
  Style/Documentation:
84
94
  Exclude:
85
95
  - 'spec/**/*'
@@ -88,8 +98,8 @@ Style/Documentation:
88
98
  - 'lib/puppetlabs_spec_helper/puppetlabs_spec/matchers.rb'
89
99
  - 'lib/puppetlabs_spec_helper/puppetlabs_spec/puppet_internals.rb'
90
100
  - 'lib/puppetlabs_spec_helper/tasks/beaker.rb'
91
- - 'lib/puppetlabs_spec_helper/tasks/fixtures.rb'
92
101
  - 'lib/puppetlabs_spec_helper/tasks/check_symlinks.rb'
102
+ - 'lib/puppetlabs_spec_helper/tasks/fixtures.rb'
93
103
 
94
104
  # Offense count: 1
95
105
  Style/DoubleNegation:
@@ -111,7 +121,7 @@ Style/GuardClause:
111
121
 
112
122
  # Offense count: 1
113
123
  # Cop supports --auto-correct.
114
- # Configuration parameters: AutoCorrect, EnforcedStyle, SupportedStyles.
124
+ # Configuration parameters: AutoCorrect, EnforcedStyle.
115
125
  # SupportedStyles: predicate, comparison
116
126
  Style/NumericPredicate:
117
127
  Exclude:
@@ -1,35 +1,33 @@
1
- sudo: false
1
+ os: linux
2
+ dist: xenial
2
3
  language: ruby
3
4
  cache: bundler
4
- before_install:
5
- bundle -v
6
- script: env COVERAGE=yes bundle exec rake
5
+ before_install: bundle -v
6
+ script: bundle exec rake
7
7
  matrix:
8
8
  fast_finish: true
9
9
  include:
10
+ - rvm: '2.7'
11
+ env: PUPPET_GEM_VERSION='https://github.com/puppetlabs/puppet.git#main' # TODO: change to 7 once it becomes available
12
+ - rvm: '2.6'
13
+ env: PUPPET_GEM_VERSION='~> 6.0' COVERAGE=yes
10
14
  - rvm: '2.5'
11
- env: PUPPET_GEM_VERSION='~> 6.0'
15
+ env: PUPPET_GEM_VERSION='~> 6.0' COVERAGE=yes
12
16
  - rvm: '2.4'
13
- env: PUPPET_GEM_VERSION='~> 6.0'
17
+ env: PUPPET_GEM_VERSION='~> 6.0' COVERAGE=yes
14
18
  - rvm: '2.3'
15
19
  env: PUPPET_GEM_VERSION='~> 6.0'
16
20
  - rvm: '2.4'
17
- env: PUPPET_GEM_VERSION='~> 5.0'
21
+ env: PUPPET_GEM_VERSION='~> 5.0' COVERAGE=yes
18
22
  - rvm: '2.3'
19
23
  env: PUPPET_GEM_VERSION='~> 5.0'
20
24
  - rvm: '2.1'
21
25
  env: PUPPET_GEM_VERSION='~> 5.0'
22
26
  - rvm: '2.4'
23
- env: PUPPET_GEM_VERSION='~> 4.0'
27
+ env: PUPPET_GEM_VERSION='~> 4.0' COVERAGE=yes
24
28
  - rvm: '2.3'
25
29
  env: PUPPET_GEM_VERSION='~> 4.0'
26
30
  - rvm: '2.1'
27
31
  env: PUPPET_GEM_VERSION='~> 4.0'
28
- - rvm: '2.1'
29
- env: PUPPET_GEM_VERSION='~> 3.0'
30
- - rvm: '2.0'
31
- env: PUPPET_GEM_VERSION='~> 3.0'
32
- - rvm: '1.9'
33
- env: PUPPET_GEM_VERSION='~> 3.0'
34
32
  notifications:
35
33
  email: false
@@ -3,7 +3,92 @@
3
3
  All significant changes to this repo will be summarized in this file.
4
4
 
5
5
 
6
+ ## [v2.16.0](https://github.com/puppetlabs/puppetlabs_spec_helper/tree/v2.16.0) (2021-01-18)
7
+
8
+ [Full Changelog](https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.15.0...v2.16.0)
9
+
10
+ **Implemented enhancements:**
11
+
12
+ - Add a check task [\#327](https://github.com/puppetlabs/puppetlabs_spec_helper/pull/327) ([ekohl](https://github.com/ekohl))
13
+ - Update fixtures from forge when the module version doesn't match; fix git \< 2.7 compatibility [\#269](https://github.com/puppetlabs/puppetlabs_spec_helper/pull/269) ([nabertrand](https://github.com/nabertrand))
14
+ - Add all spec/lib directories from fixtures to LOAD\_PATH [\#233](https://github.com/puppetlabs/puppetlabs_spec_helper/pull/233) ([nabertrand](https://github.com/nabertrand))
15
+
16
+ **Merged pull requests:**
17
+
18
+ - 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
+ - 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
+
21
+ ## [v2.15.0](https://github.com/puppetlabs/puppetlabs_spec_helper/tree/v2.15.0) (2020-06-12)
22
+
23
+ [Full Changelog](https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.14.1...v2.15.0)
24
+
25
+ **Implemented enhancements:**
26
+
27
+ - Add Ruby 2.6/Puppet6 to CI matrix [\#311](https://github.com/puppetlabs/puppetlabs_spec_helper/pull/311) ([bastelfreak](https://github.com/bastelfreak))
28
+ - \(GH-297\) Don't allow git refs with forward slashes [\#299](https://github.com/puppetlabs/puppetlabs_spec_helper/pull/299) ([glennsarti](https://github.com/glennsarti))
29
+ - Accept `:tag` for consistency with r10k [\#296](https://github.com/puppetlabs/puppetlabs_spec_helper/pull/296) ([binford2k](https://github.com/binford2k))
30
+ - \(maint\) migrate the changelog task from pdk-templates [\#278](https://github.com/puppetlabs/puppetlabs_spec_helper/pull/278) ([DavidS](https://github.com/DavidS))
31
+
32
+ **Fixed bugs:**
33
+
34
+ - \(MAINT\) Fix initialize of Gettext call [\#292](https://github.com/puppetlabs/puppetlabs_spec_helper/pull/292) ([ThoughtCrhyme](https://github.com/ThoughtCrhyme))
35
+
36
+ **Merged pull requests:**
37
+
38
+ - \(IAC-885\) - Release Prep 2.15.0 [\#318](https://github.com/puppetlabs/puppetlabs_spec_helper/pull/318) ([pmcmaw](https://github.com/pmcmaw))
39
+ - \(IAC-859\) Update all the gems and ruby to 2.7 [\#316](https://github.com/puppetlabs/puppetlabs_spec_helper/pull/316) ([DavidS](https://github.com/DavidS))
40
+ - Support git fixture branches containing slashes [\#297](https://github.com/puppetlabs/puppetlabs_spec_helper/pull/297) ([trevor-vaughan](https://github.com/trevor-vaughan))
41
+ - \(maint\) Require pdk/util in build:pdk rake task [\#295](https://github.com/puppetlabs/puppetlabs_spec_helper/pull/295) ([rodjek](https://github.com/rodjek))
42
+ - Ignore plans folder and any subfolder [\#294](https://github.com/puppetlabs/puppetlabs_spec_helper/pull/294) ([cyberious](https://github.com/cyberious))
43
+ - \(maint\) add codeowners file [\#293](https://github.com/puppetlabs/puppetlabs_spec_helper/pull/293) ([tphoney](https://github.com/tphoney))
44
+ - \(MAINT\) Removes old rubies and puppet versions [\#290](https://github.com/puppetlabs/puppetlabs_spec_helper/pull/290) ([logicminds](https://github.com/logicminds))
45
+ - Remove coveralls docs [\#289](https://github.com/puppetlabs/puppetlabs_spec_helper/pull/289) ([DavidS](https://github.com/DavidS))
46
+ - Download forge modules in parallel [\#284](https://github.com/puppetlabs/puppetlabs_spec_helper/pull/284) ([logicminds](https://github.com/logicminds))
47
+
48
+ ## [v2.14.1](https://github.com/puppetlabs/puppetlabs_spec_helper/tree/v2.14.1) (2019-03-26)
49
+
50
+ [Full Changelog](https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.14.0...v2.14.1)
51
+
52
+ **Fixed bugs:**
53
+
54
+ - Revert "\(feat\) dont load the beaker if litmus is there" [\#286](https://github.com/puppetlabs/puppetlabs_spec_helper/pull/286) ([pmcmaw](https://github.com/pmcmaw))
55
+
56
+ **Merged pull requests:**
57
+
58
+ - \(MODULES-8778\) - Release Prep 2.14.1 [\#287](https://github.com/puppetlabs/puppetlabs_spec_helper/pull/287) ([pmcmaw](https://github.com/pmcmaw))
59
+
60
+ ## [v2.14.0](https://github.com/puppetlabs/puppetlabs_spec_helper/tree/v2.14.0) (2019-03-25)
61
+
62
+ [Full Changelog](https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.13.1...v2.14.0)
63
+
64
+ **Implemented enhancements:**
65
+
66
+ - \(feat\) dont load the beaker if litmus is there [\#281](https://github.com/puppetlabs/puppetlabs_spec_helper/pull/281) ([tphoney](https://github.com/tphoney))
67
+ - \(maint\) load rake tasks from optional libraries [\#279](https://github.com/puppetlabs/puppetlabs_spec_helper/pull/279) ([DavidS](https://github.com/DavidS))
68
+ - Document how to set default values for fixture loading [\#277](https://github.com/puppetlabs/puppetlabs_spec_helper/pull/277) ([Felixoid](https://github.com/Felixoid))
69
+
70
+ **Fixed bugs:**
71
+
72
+ - Remove `--color` from everywhere, use RSpec default detection instead [\#280](https://github.com/puppetlabs/puppetlabs_spec_helper/pull/280) ([DavidS](https://github.com/DavidS))
73
+
74
+ **Merged pull requests:**
75
+
76
+ - \(MODULES-8771\) - Release Prep 2.14.0 [\#282](https://github.com/puppetlabs/puppetlabs_spec_helper/pull/282) ([pmcmaw](https://github.com/pmcmaw))
77
+
78
+ ## [v2.13.1](https://github.com/puppetlabs/puppetlabs_spec_helper/tree/v2.13.1) (2019-01-15)
79
+
80
+ [Full Changelog](https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.13.0...v2.13.1)
81
+
82
+ **Fixed bugs:**
83
+
84
+ - Revert "\(MODULES-8242\) - Fix CI\_SPEC\_OPTIONS failing" [\#275](https://github.com/puppetlabs/puppetlabs_spec_helper/pull/275) ([rodjek](https://github.com/rodjek))
85
+
86
+ **Merged pull requests:**
87
+
88
+ - Release Prep 2.13.1 [\#276](https://github.com/puppetlabs/puppetlabs_spec_helper/pull/276) ([bmjen](https://github.com/bmjen))
89
+
6
90
  ## [v2.13.0](https://github.com/puppetlabs/puppetlabs_spec_helper/tree/v2.13.0) (2019-01-11)
91
+
7
92
  [Full Changelog](https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.12.0...v2.13.0)
8
93
 
9
94
  **Implemented enhancements:**
@@ -18,10 +103,12 @@ All significant changes to this repo will be summarized in this file.
18
103
 
19
104
  **Merged pull requests:**
20
105
 
106
+ - \(MODULES-8448\) - Release Prep 2.13.0 [\#273](https://github.com/puppetlabs/puppetlabs_spec_helper/pull/273) ([pmcmaw](https://github.com/pmcmaw))
21
107
  - \(maint\) - Resolving bundler ruby version failure, updating tests to include puppet 6 [\#271](https://github.com/puppetlabs/puppetlabs_spec_helper/pull/271) ([pmcmaw](https://github.com/pmcmaw))
22
108
  - \(MAINT\) Add Plans Path Exclusion [\#270](https://github.com/puppetlabs/puppetlabs_spec_helper/pull/270) ([RandomNoun7](https://github.com/RandomNoun7))
23
109
 
24
110
  ## [v2.12.0](https://github.com/puppetlabs/puppetlabs_spec_helper/tree/v2.12.0) (2018-11-08)
111
+
25
112
  [Full Changelog](https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.11.0...v2.12.0)
26
113
 
27
114
  **Implemented enhancements:**
@@ -39,6 +126,7 @@ All significant changes to this repo will be summarized in this file.
39
126
  - 2.12.0 Release Prep [\#264](https://github.com/puppetlabs/puppetlabs_spec_helper/pull/264) ([tphoney](https://github.com/tphoney))
40
127
 
41
128
  ## [v2.11.0](https://github.com/puppetlabs/puppetlabs_spec_helper/tree/v2.11.0) (2018-09-26)
129
+
42
130
  [Full Changelog](https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.10.0...v2.11.0)
43
131
 
44
132
  **Implemented enhancements:**
@@ -54,6 +142,7 @@ All significant changes to this repo will be summarized in this file.
54
142
  - \(MODULES-7858\) - 2.11.0 Release Prep [\#259](https://github.com/puppetlabs/puppetlabs_spec_helper/pull/259) ([pmcmaw](https://github.com/pmcmaw))
55
143
 
56
144
  ## [v2.10.0](https://github.com/puppetlabs/puppetlabs_spec_helper/tree/v2.10.0) (2018-08-30)
145
+
57
146
  [Full Changelog](https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.9.1...v2.10.0)
58
147
 
59
148
  **Implemented enhancements:**
@@ -68,6 +157,7 @@ All significant changes to this repo will be summarized in this file.
68
157
  - update README [\#252](https://github.com/puppetlabs/puppetlabs_spec_helper/pull/252) ([b4ldr](https://github.com/b4ldr))
69
158
 
70
159
  ## [v2.9.1](https://github.com/puppetlabs/puppetlabs_spec_helper/tree/v2.9.1) (2018-06-20)
160
+
71
161
  [Full Changelog](https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.9.0...v2.9.1)
72
162
 
73
163
  **Fixed bugs:**
@@ -80,6 +170,7 @@ All significant changes to this repo will be summarized in this file.
80
170
  - \(maint\) - Release prep for 2.9.1 [\#251](https://github.com/puppetlabs/puppetlabs_spec_helper/pull/251) ([pmcmaw](https://github.com/pmcmaw))
81
171
 
82
172
  ## [v2.9.0](https://github.com/puppetlabs/puppetlabs_spec_helper/tree/v2.9.0) (2018-06-18)
173
+
83
174
  [Full Changelog](https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.8.0...v2.9.0)
84
175
 
85
176
  **Implemented enhancements:**
@@ -591,4 +682,4 @@ compatible yet.
591
682
  [0.1.0]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/0.0.0...0.1.0
592
683
 
593
684
 
594
- \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
685
+ \* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
@@ -0,0 +1,2 @@
1
+ # Default owners.
2
+ * @puppetlabs/pdk @puppetlabs/modules
data/Gemfile CHANGED
@@ -1,24 +1,49 @@
1
- source 'https://rubygems.org'
1
+ # frozen_string_literal: true
2
+
3
+ source ENV['GEM_SOURCE'] || 'https://rubygems.org'
4
+
5
+ def location_for(place_or_version, fake_version = nil)
6
+ git_url_regex = %r{\A(?<url>(?:https?|git)[:@][^#]*)(?:#(?<branch>.*))?}
7
+ file_url_regex = %r{\Afile://(?<path>.*)}
8
+
9
+ if place_or_version && (git_url = place_or_version.match(git_url_regex))
10
+ [fake_version, { git: git_url[:url], branch: git_url[:branch], require: false }].compact
11
+ elsif place_or_version && (file_url = place_or_version.match(file_url_regex))
12
+ ['>= 0', { path: File.expand_path(file_url[:path]), require: false }]
13
+ else
14
+ [place_or_version, { require: false }]
15
+ end
16
+ end
2
17
 
3
18
  # Specify the global dependencies in puppetlabs_spec_helper.gemspec
4
19
  # Note that only ruby 1.9 compatible dependencies may go there, everything else needs to be documented and pulled in manually, and optionally by everyone who wants to use the extended features.
5
20
  gemspec
6
21
 
22
+ def infer_puppet_version
23
+ # Infer the Puppet Gem version based on the Ruby Version
24
+ ruby_ver = Gem::Version.new(RUBY_VERSION.dup)
25
+ return '~> 6.0' if ruby_ver >= Gem::Version.new('2.5.0')
26
+ return '~> 5.0' if ruby_ver >= Gem::Version.new('2.4.0')
27
+
28
+ '~> 4.0'
29
+ end
30
+
7
31
  group :development do
8
32
  gem 'codecov'
9
33
  gem 'github_changelog_generator' if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.2.0')
10
- gem 'puppet', ENV['PUPPET_GEM_VERSION'] || ENV['PUPPET_VERSION'] || '~> 4.0'
34
+ gem 'puppet', *location_for(ENV['PUPPET_GEM_VERSION'] || ENV['PUPPET_VERSION'] || infer_puppet_version)
11
35
  gem 'simplecov', '~> 0'
12
36
  gem 'simplecov-console'
13
- if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.1.0')
14
- gem 'rubocop', '< 0.50'
15
- gem 'rubocop-rspec', '~> 1'
37
+ if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.4')
38
+ gem 'rubocop', '0.57.2'
39
+ gem 'rubocop-rspec'
16
40
  end
17
41
  end
18
42
 
19
- # json_pure 2.0.2 added a requirement on ruby >= 2. We pin to json_pure 2.0.1
20
- # if using ruby 1.x
21
- gem 'json_pure', '<=2.0.1' if RUBY_VERSION =~ %r{^1\.}
22
- gem 'rack', '~> 1'
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')
23
48
 
24
49
  # vim:filetype=ruby
data/README.md CHANGED
@@ -59,7 +59,7 @@ Host github.com
59
59
 
60
60
  ```
61
61
 
62
- Note: parallel downloads is only available for repositories and not forge modules.
62
+ Note: parallel downloads are available for repositories and forge modules.
63
63
 
64
64
  ### Parallel tests
65
65
  It is also possible to use the `parallel_tests` Gem via the `:parallel_spec` Rake task to run rspec commands in parallel on groups of spec files.
@@ -156,7 +156,7 @@ variables for the spec run. These are:
156
156
  * ``TRUSTED_NODE_DATA`` _(Puppet 3.x, starting with 3.4)_ - set to "yes" to enable [the $facts hash and trusted node data](https://puppet.com/docs/puppet/3.8/lang_facts_and_builtin_vars.html#trusted-facts),
157
157
  which enabled ``$facts`` and ``$trusted`` hashes. This is equivalent to setting
158
158
  [trusted_node_data=true](https://puppet.com/docs/puppet/3.8/configuration.html#trustednodedata)
159
- in puppet.conf.
159
+ in puppet.conf.
160
160
  * ``STRINGIFY_FACTS`` _(Puppet 3.x, starting with 3.5)_ - set to "no" to enable [structured facts](http://docs.puppetlabs.com/facter/2.0/fact_overview.html#writing-structured-facts),
161
161
  otherwise leave unset to retain the current default behavior. This is equivalent to setting
162
162
  [stringify_facts=false](https://puppet.com/docs/puppet/3.8/configuration.html#stringifyfacts)
@@ -193,35 +193,38 @@ working directory is `<module directory>/spec/fixtures/work-dir`.
193
193
 
194
194
  When specifying the repo source of the fixture you have a few options as to which revision of the codebase you wish to use, and optionally, the puppet versions where the fixture is needed.
195
195
 
196
- * repo - the url to the repo
197
- * scm - options include git or hg. This is an optional step as the helper code will figure out which scm is used.
196
+ * `repo` - the url to the repo
197
+ * `scm` - options include git or hg. This is an optional step as the helper code will figure out which scm is used.
198
198
 
199
199
  ```yaml
200
200
  scm: git
201
201
  scm: hg
202
202
  ```
203
203
 
204
- * target - the directory name to clone the repo into ie. `target: mymodule` defaults to the repo name (Optional)
205
- * subdir - directory to be removed from the cloned repo. Its contents will be moved to the root directory (Optional)
206
- * ref - used to specify the tag name like version hash of commit (Optional)
204
+ * `target` - the directory name to clone the repo into ie. `target: mymodule` defaults to the repo name (Optional)
205
+ * `subdir` - directory to be removed from the cloned repo. Its contents will be moved to the root directory (Optional)
206
+ * `ref` - used to specify the tag name (like version) or commit hash to be checked out (Optional). Branch names should use the `branch` option instead.
207
207
 
208
208
  ```yaml
209
209
  ref: 1.0.0
210
210
  ref: 880fca52c
211
211
  ```
212
- * branch - used to specify the branch name you want to use ie. `branch: development`
213
- * flags - additional flags passed to the module installer (both puppet and scm)
212
+ * `branch` - used to specify the branch name you want to use ie. `branch: development`
213
+ * `flags` - additional flags passed to the module installer (both puppet and scm)
214
214
 
215
215
  ```yaml
216
216
  flags: --verbose
217
217
  ```
218
- * puppet_version - versions of puppet for which the fixture should be installed. Ruby version constraints are supported. Only works when the `semantic_puppet` gem is available (shipped with puppet 4.0 and up, by default).
218
+ * `puppet_version` - versions of puppet for which the fixture should be installed. Ruby version constraints are supported. Only works when the `semantic_puppet` gem is available (shipped with puppet 4.0 and up, by default).
219
219
 
220
220
  ```yaml
221
221
  puppet_version: '>= 6.0.0'
222
222
  ```
223
223
 
224
- **Note:** ref and branch can be used together to get a specific revision on a specific branch
224
+ **Notes:**
225
+
226
+ * `ref` and `branch` can be used together to get a specific revision on a specific branch
227
+ * Top level `defaults` option could be used to set global options
225
228
 
226
229
  Fixtures Examples
227
230
  -----------------
@@ -257,7 +260,7 @@ fixtures:
257
260
  target: "spec/fixtures/control_repos"
258
261
  ```
259
262
 
260
- Specify that the git tag `2.4.2` of `stdlib' should be checked out:
263
+ Specify that the git tag `2.4.2` of `stdlib` should be checked out:
261
264
 
262
265
  ```yaml
263
266
  fixtures:
@@ -315,6 +318,27 @@ fixtures:
315
318
  flags: "--verbose"
316
319
  ```
317
320
 
321
+ Use `defaults` to define global parameters:
322
+
323
+ ```yaml
324
+ defaults:
325
+ forge_modules:
326
+ flags: "--module_repository https://my_repo.com"
327
+ fixtures:
328
+ forge_modules:
329
+ stdlib:
330
+ repo: "puppetlabs/stdlib"
331
+ ref: "2.6.0"
332
+ repositories:
333
+ firewall:
334
+ repo: "git://github.com/puppetlabs/puppetlabs-firewall"
335
+ ref: "2.6.0"
336
+ ```
337
+
338
+ Fixture Loading
339
+ ---------------
340
+ Any module that has a `spec/lib` directory will be available on the ruby `LOAD_PATH` for tests to consume. This allows modules to provide additional helper code to be supplied. The [augeasprovider_core](https://github.com/hercules-team/augeasproviders_core) module has [some examples](https://github.com/hercules-team/augeasproviders_core/tree/master/spec/lib).
341
+
318
342
  Testing Parser Functions
319
343
  ========================
320
344
 
@@ -369,7 +393,7 @@ environment variable``TEST_TIERS=high,medium``
369
393
 
370
394
  By default ``TEST_TIERS`` only accepts low, medium and high as valid tiers. If you would like to use your own keywords to set the environment variable ``TEST_TIERS_ALLOWED``.
371
395
 
372
- For example: to use the keywords dev, rnd, staging and production you can set
396
+ For example: to use the keywords dev, rnd, staging and production you can set
373
397
  ``TEST_TIERS_ALLOWED=dev,rnd,staging,production``. Then you would be able to run tests marked ``tier_dev => true``, ``tier_production => true`` with ``TEST_TIERS=dev,production``
374
398
 
375
399
  Note, if the ``TEST_TIERS`` environment variable is set to empty string or nil, all tiers will be executed.
@@ -396,34 +420,7 @@ You can enable it, set the following environment variable:s
396
420
 
397
421
  ``SIMPLECOV=yes``
398
422
 
399
- Remember to add the simplecov-console and codecov gems to your `Gemfile`.
400
-
401
- Using Coveralls
402
- ---------------
403
-
404
- You can also use [Coveralls](https://coveralls.io/) together with SimpleCov:
405
-
406
- ```Ruby
407
- # First line of spec/spec_helper.rb
408
- require 'simplecov'
409
- require 'coveralls'
410
-
411
- SimpleCov.formatters = [
412
- SimpleCov::Formatter::HTMLFormatter,
413
- Coveralls::SimpleCov::Formatter
414
- ]
415
-
416
- SimpleCov.start do
417
- add_filter '/spec/'
418
- # Exclude bundled Gems in `/.vendor/`
419
- add_filter '/.vendor/'
420
- end
421
-
422
- require 'puppetlabs_spec_helper/module_spec_helper'
423
- # Further content
424
- ```
425
-
426
- Remember to add `gem 'coveralls', require: false` to your `Gemfile`.
423
+ Remember to add the simplecov-console and codecov gems to your `Gemfile`. If you run `spec:simplecov` on Travis-CI or any of the other supported CI services, reports gets automatically uploaded to https://codecov.io/ .
427
424
 
428
425
  Some Notes for Windows Users
429
426
  ============================