pdqtest 1.4.1 → 1.9.9beta2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +9 -3
- data/doc/acceptance_tests.md +100 -22
- data/doc/caching.md +5 -1
- data/doc/development.md +16 -5
- data/doc/emoji.md +20 -9
- data/doc/enabling_testing.md +15 -3
- data/doc/examples.md +25 -6
- data/doc/hiera.md +30 -11
- data/doc/installation.md +59 -8
- data/doc/pdk.md +334 -0
- data/doc/puppet_facts.md +45 -3
- data/doc/puppet_module_dependencies.md +34 -16
- data/doc/running_tests.md +35 -15
- data/doc/test_generation.md +11 -19
- data/doc/tips_and_tricks.md +17 -8
- data/doc/troubleshooting.md +19 -8
- data/doc/upgrading.md +125 -6
- data/doc/windows.md +51 -0
- data/docker_images/centos/Dockerfile +4 -3
- data/docker_images/centos/Makefile +1 -1
- data/docker_images/ubuntu/Dockerfile +3 -3
- data/docker_images/windows/Dockerfile +26 -0
- data/docker_images/windows/make.ps1 +2 -0
- data/exe/pdqtest +73 -28
- data/lib/pdqtest/core.rb +1 -1
- data/lib/pdqtest/docker.rb +143 -51
- data/lib/pdqtest/emoji.rb +33 -7
- data/lib/pdqtest/fastcheck.rb +19 -0
- data/lib/pdqtest/instance.rb +16 -15
- data/lib/pdqtest/logger.rb +35 -0
- data/lib/pdqtest/pdk.rb +98 -0
- data/lib/pdqtest/pdqtest1x.rb +115 -0
- data/lib/pdqtest/puppet.rb +277 -134
- data/lib/pdqtest/skeleton.rb +119 -39
- data/lib/pdqtest/upgrade.rb +42 -42
- data/lib/pdqtest/util.rb +82 -2
- data/lib/pdqtest/version.rb +1 -2
- data/pdqtest.gemspec +8 -13
- data/res/{skeleton → acceptance}/init.bats +0 -0
- data/res/{skeleton → acceptance}/init__before.bats +0 -0
- data/res/{skeleton → acceptance}/init__setup.sh +0 -0
- data/res/skeleton/.puppet-lint.rc +5 -0
- data/res/skeleton/{dot_travis.yml → .travis.yml} +0 -0
- data/res/skeleton/Makefile +20 -5
- data/res/skeleton/make.ps1 +66 -0
- data/res/skeleton/spec/fixtures/hiera.yaml +13 -0
- data/res/skeleton/spec/fixtures/hieradata/test.yaml +11 -0
- data/res/templates/examples_init.pp.erb +1 -1
- metadata +47 -115
- data/lib/pdqtest/lint.rb +0 -31
- data/lib/pdqtest/rspec.rb +0 -69
- data/lib/pdqtest/syntax.rb +0 -20
- data/res/skeleton/Gemfile +0 -7
- data/res/skeleton/Rakefile +0 -3
- data/res/skeleton/dot_gitignore +0 -9
- data/res/skeleton/dot_rspec +0 -2
- data/res/skeleton/hiera.yaml +0 -7
- data/res/skeleton/spec_helper.rb +0 -4
- data/res/skeleton/test.yaml +0 -3
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pdqtest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.9.9beta2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Geoff Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-09-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: '1.16'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: '1.16'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: coveralls
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -39,33 +39,19 @@ dependencies:
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 0.8.21
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - '='
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: 0.14.2
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - '='
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: 0.14.2
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: puppet
|
42
|
+
name: rspec
|
57
43
|
requirement: !ruby/object:Gem::Requirement
|
58
44
|
requirements:
|
59
45
|
- - '='
|
60
46
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
47
|
+
version: 3.7.0
|
62
48
|
type: :development
|
63
49
|
prerelease: false
|
64
50
|
version_requirements: !ruby/object:Gem::Requirement
|
65
51
|
requirements:
|
66
52
|
- - '='
|
67
53
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
54
|
+
version: 3.7.0
|
69
55
|
- !ruby/object:Gem::Dependency
|
70
56
|
name: rake
|
71
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -80,20 +66,6 @@ dependencies:
|
|
80
66
|
- - '='
|
81
67
|
- !ruby/object:Gem::Version
|
82
68
|
version: 12.3.1
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: rspec
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - '='
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: 3.7.0
|
90
|
-
type: :runtime
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - '='
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: 3.7.0
|
97
69
|
- !ruby/object:Gem::Dependency
|
98
70
|
name: thor
|
99
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -122,20 +94,6 @@ dependencies:
|
|
122
94
|
- - '='
|
123
95
|
- !ruby/object:Gem::Version
|
124
96
|
version: 0.6.1
|
125
|
-
- !ruby/object:Gem::Dependency
|
126
|
-
name: hiera
|
127
|
-
requirement: !ruby/object:Gem::Requirement
|
128
|
-
requirements:
|
129
|
-
- - '='
|
130
|
-
- !ruby/object:Gem::Version
|
131
|
-
version: 3.4.2
|
132
|
-
type: :runtime
|
133
|
-
prerelease: false
|
134
|
-
version_requirements: !ruby/object:Gem::Requirement
|
135
|
-
requirements:
|
136
|
-
- - '='
|
137
|
-
- !ruby/object:Gem::Version
|
138
|
-
version: 3.4.2
|
139
97
|
- !ruby/object:Gem::Dependency
|
140
98
|
name: escort
|
141
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -165,92 +123,64 @@ dependencies:
|
|
165
123
|
- !ruby/object:Gem::Version
|
166
124
|
version: 1.34.2
|
167
125
|
- !ruby/object:Gem::Dependency
|
168
|
-
name:
|
169
|
-
requirement: !ruby/object:Gem::Requirement
|
170
|
-
requirements:
|
171
|
-
- - '='
|
172
|
-
- !ruby/object:Gem::Version
|
173
|
-
version: 2.3.5
|
174
|
-
type: :runtime
|
175
|
-
prerelease: false
|
176
|
-
version_requirements: !ruby/object:Gem::Requirement
|
177
|
-
requirements:
|
178
|
-
- - '='
|
179
|
-
- !ruby/object:Gem::Version
|
180
|
-
version: 2.3.5
|
181
|
-
- !ruby/object:Gem::Dependency
|
182
|
-
name: puppet-syntax
|
183
|
-
requirement: !ruby/object:Gem::Requirement
|
184
|
-
requirements:
|
185
|
-
- - '='
|
186
|
-
- !ruby/object:Gem::Version
|
187
|
-
version: 2.4.1
|
188
|
-
type: :runtime
|
189
|
-
prerelease: false
|
190
|
-
version_requirements: !ruby/object:Gem::Requirement
|
191
|
-
requirements:
|
192
|
-
- - '='
|
193
|
-
- !ruby/object:Gem::Version
|
194
|
-
version: 2.4.1
|
195
|
-
- !ruby/object:Gem::Dependency
|
196
|
-
name: puppetlabs_spec_helper
|
126
|
+
name: r10k
|
197
127
|
requirement: !ruby/object:Gem::Requirement
|
198
128
|
requirements:
|
199
129
|
- - '='
|
200
130
|
- !ruby/object:Gem::Version
|
201
|
-
version: 2.
|
131
|
+
version: 2.6.4
|
202
132
|
type: :runtime
|
203
133
|
prerelease: false
|
204
134
|
version_requirements: !ruby/object:Gem::Requirement
|
205
135
|
requirements:
|
206
136
|
- - '='
|
207
137
|
- !ruby/object:Gem::Version
|
208
|
-
version: 2.
|
138
|
+
version: 2.6.4
|
209
139
|
- !ruby/object:Gem::Dependency
|
210
|
-
name:
|
140
|
+
name: logging
|
211
141
|
requirement: !ruby/object:Gem::Requirement
|
212
142
|
requirements:
|
213
|
-
- -
|
143
|
+
- - "~>"
|
214
144
|
- !ruby/object:Gem::Version
|
215
|
-
version: 2.
|
145
|
+
version: '2.2'
|
216
146
|
type: :runtime
|
217
147
|
prerelease: false
|
218
148
|
version_requirements: !ruby/object:Gem::Requirement
|
219
149
|
requirements:
|
220
|
-
- -
|
150
|
+
- - "~>"
|
221
151
|
- !ruby/object:Gem::Version
|
222
|
-
version: 2.
|
152
|
+
version: '2.2'
|
223
153
|
- !ruby/object:Gem::Dependency
|
224
|
-
name:
|
154
|
+
name: deep_merge
|
225
155
|
requirement: !ruby/object:Gem::Requirement
|
226
156
|
requirements:
|
227
|
-
- -
|
157
|
+
- - "~>"
|
228
158
|
- !ruby/object:Gem::Version
|
229
|
-
version:
|
159
|
+
version: '1.2'
|
230
160
|
type: :runtime
|
231
161
|
prerelease: false
|
232
162
|
version_requirements: !ruby/object:Gem::Requirement
|
233
163
|
requirements:
|
234
|
-
- -
|
164
|
+
- - "~>"
|
235
165
|
- !ruby/object:Gem::Version
|
236
|
-
version:
|
166
|
+
version: '1.2'
|
237
167
|
- !ruby/object:Gem::Dependency
|
238
|
-
name:
|
168
|
+
name: json
|
239
169
|
requirement: !ruby/object:Gem::Requirement
|
240
170
|
requirements:
|
241
|
-
- -
|
171
|
+
- - "<="
|
242
172
|
- !ruby/object:Gem::Version
|
243
|
-
version: 0.
|
173
|
+
version: 2.0.4
|
244
174
|
type: :runtime
|
245
175
|
prerelease: false
|
246
176
|
version_requirements: !ruby/object:Gem::Requirement
|
247
177
|
requirements:
|
248
|
-
- -
|
178
|
+
- - "<="
|
249
179
|
- !ruby/object:Gem::Version
|
250
|
-
version: 0.
|
180
|
+
version: 2.0.4
|
251
181
|
description:
|
252
182
|
email:
|
253
|
-
- geoff
|
183
|
+
- geoff@declarativesystems.com
|
254
184
|
executables:
|
255
185
|
- pdqtest
|
256
186
|
extensions: []
|
@@ -274,6 +204,7 @@ files:
|
|
274
204
|
- doc/examples.md
|
275
205
|
- doc/hiera.md
|
276
206
|
- doc/installation.md
|
207
|
+
- doc/pdk.md
|
277
208
|
- doc/puppet_facts.md
|
278
209
|
- doc/puppet_module_dependencies.md
|
279
210
|
- doc/running_tests.md
|
@@ -281,41 +212,42 @@ files:
|
|
281
212
|
- doc/tips_and_tricks.md
|
282
213
|
- doc/troubleshooting.md
|
283
214
|
- doc/upgrading.md
|
215
|
+
- doc/windows.md
|
284
216
|
- docker_images/centos/Dockerfile
|
285
217
|
- docker_images/centos/Makefile
|
286
218
|
- docker_images/ubuntu/Dockerfile
|
287
219
|
- docker_images/ubuntu/Makefile
|
220
|
+
- docker_images/windows/Dockerfile
|
221
|
+
- docker_images/windows/make.ps1
|
288
222
|
- exe/pdqtest
|
289
223
|
- lib/pdqtest.rb
|
290
224
|
- lib/pdqtest/core.rb
|
291
225
|
- lib/pdqtest/docker.rb
|
292
226
|
- lib/pdqtest/emoji.rb
|
227
|
+
- lib/pdqtest/fastcheck.rb
|
293
228
|
- lib/pdqtest/instance.rb
|
294
|
-
- lib/pdqtest/
|
229
|
+
- lib/pdqtest/logger.rb
|
230
|
+
- lib/pdqtest/pdk.rb
|
231
|
+
- lib/pdqtest/pdqtest1x.rb
|
295
232
|
- lib/pdqtest/puppet.rb
|
296
|
-
- lib/pdqtest/rspec.rb
|
297
233
|
- lib/pdqtest/skeleton.rb
|
298
|
-
- lib/pdqtest/syntax.rb
|
299
234
|
- lib/pdqtest/upgrade.rb
|
300
235
|
- lib/pdqtest/util.rb
|
301
236
|
- lib/pdqtest/version.rb
|
302
237
|
- pdqtest.gemspec
|
303
|
-
- res/
|
238
|
+
- res/acceptance/init.bats
|
239
|
+
- res/acceptance/init__before.bats
|
240
|
+
- res/acceptance/init__setup.sh
|
241
|
+
- res/skeleton/.puppet-lint.rc
|
242
|
+
- res/skeleton/.travis.yml
|
304
243
|
- res/skeleton/Makefile
|
305
|
-
- res/skeleton/Rakefile
|
306
244
|
- res/skeleton/bitbucket-pipelines.yml
|
307
|
-
- res/skeleton/
|
308
|
-
- res/skeleton/
|
309
|
-
- res/skeleton/
|
310
|
-
- res/skeleton/hiera.yaml
|
311
|
-
- res/skeleton/init.bats
|
312
|
-
- res/skeleton/init__before.bats
|
313
|
-
- res/skeleton/init__setup.sh
|
314
|
-
- res/skeleton/spec_helper.rb
|
315
|
-
- res/skeleton/test.yaml
|
245
|
+
- res/skeleton/make.ps1
|
246
|
+
- res/skeleton/spec/fixtures/hiera.yaml
|
247
|
+
- res/skeleton/spec/fixtures/hieradata/test.yaml
|
316
248
|
- res/templates/examples_init.pp.erb
|
317
249
|
- res/templates/rspec.rb.erb
|
318
|
-
homepage: https://github.com/
|
250
|
+
homepage: https://github.com/DeclarativeSystems/pdqtest
|
319
251
|
licenses:
|
320
252
|
- Apache-2.0
|
321
253
|
metadata: {}
|
@@ -330,9 +262,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
330
262
|
version: '0'
|
331
263
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
332
264
|
requirements:
|
333
|
-
- - "
|
265
|
+
- - ">"
|
334
266
|
- !ruby/object:Gem::Version
|
335
|
-
version:
|
267
|
+
version: 1.3.1
|
336
268
|
requirements: []
|
337
269
|
rubyforge_project:
|
338
270
|
rubygems_version: 2.7.6
|
data/lib/pdqtest/lint.rb
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
require 'pdqtest/emoji'
|
2
|
-
module PDQTest
|
3
|
-
module Lint
|
4
|
-
LINT_PATHS = [
|
5
|
-
"manifests"
|
6
|
-
]
|
7
|
-
|
8
|
-
LINT_OPTIONS = [
|
9
|
-
"--relative",
|
10
|
-
"--fail-on-warnings",
|
11
|
-
"--no-double_quoted_strings-check",
|
12
|
-
"--no-80chars-check",
|
13
|
-
"--no-variable_scope-check",
|
14
|
-
"--no-quoted_booleans-check",
|
15
|
-
]
|
16
|
-
def self.puppet
|
17
|
-
status = true
|
18
|
-
LINT_PATHS.each { |p|
|
19
|
-
if Dir.exists?(p)
|
20
|
-
if ! system("puppet-lint #{LINT_OPTIONS.join ' '} manifests")
|
21
|
-
status = false
|
22
|
-
end
|
23
|
-
end
|
24
|
-
}
|
25
|
-
|
26
|
-
PDQTest::Emoji.partial_status(status, 'Linter')
|
27
|
-
status
|
28
|
-
end
|
29
|
-
|
30
|
-
end
|
31
|
-
end
|
data/lib/pdqtest/rspec.rb
DELETED
@@ -1,69 +0,0 @@
|
|
1
|
-
require 'pdqtest'
|
2
|
-
require 'pdqtest/puppet'
|
3
|
-
require 'pdqtest/util'
|
4
|
-
require 'pdqtest/emoji'
|
5
|
-
require 'erb'
|
6
|
-
require 'fileutils'
|
7
|
-
require 'pdqtest/util'
|
8
|
-
require 'json'
|
9
|
-
|
10
|
-
|
11
|
-
module PDQTest
|
12
|
-
module Rspec
|
13
|
-
SPEC_DIR = './spec'
|
14
|
-
SPEC_CLASSES_DIR = "#{SPEC_DIR}/classes"
|
15
|
-
MODULE_CACHE_DIR = "#{Util::app_dir_expanded}/cache/modules"
|
16
|
-
|
17
|
-
|
18
|
-
def self.run
|
19
|
-
if ! Dir.exists?(MODULE_CACHE_DIR)
|
20
|
-
FileUtils.mkdir_p(MODULE_CACHE_DIR)
|
21
|
-
end
|
22
|
-
|
23
|
-
status = PDQTest::Puppet.install_modules()
|
24
|
-
|
25
|
-
if status
|
26
|
-
PDQTest::Puppet.git_fixtures.each { |extra_mod_install_cmd|
|
27
|
-
if status
|
28
|
-
cmd = "bundle exec #{extra_mod_install_cmd}"
|
29
|
-
status &= system(cmd)
|
30
|
-
end
|
31
|
-
if ! status
|
32
|
-
Escort::Logger.error.error "Install git fixtures failed: #{cmd}"
|
33
|
-
end
|
34
|
-
}
|
35
|
-
if status
|
36
|
-
status &= system("bundle exec rake spec")
|
37
|
-
end
|
38
|
-
end
|
39
|
-
PDQTest::Emoji.partial_status(status, 'RSpec-Puppet')
|
40
|
-
status
|
41
|
-
end
|
42
|
-
|
43
|
-
def self.class2specfile(c)
|
44
|
-
pp = Puppet::class2filename(c)
|
45
|
-
pp.gsub(Puppet::MANIFESTS_DIR, SPEC_CLASSES_DIR).gsub('.pp', '_spec.rb')
|
46
|
-
end
|
47
|
-
|
48
|
-
def self.gen_specs
|
49
|
-
classes = PDQTest::Puppet::find_classes
|
50
|
-
|
51
|
-
classes.each { |classname|
|
52
|
-
spec_file = class2specfile(classname)
|
53
|
-
if File.exists?(spec_file)
|
54
|
-
Escort::Logger.output.puts "Skipped #{classname} - tests already exist at #{spec_file}"
|
55
|
-
else
|
56
|
-
# first ensure any nested directories exist
|
57
|
-
base_dir = File.dirname(spec_file)
|
58
|
-
if ! Dir.exists?(base_dir)
|
59
|
-
FileUtils.mkdir_p(base_dir)
|
60
|
-
end
|
61
|
-
|
62
|
-
# process the rspec template into a new file
|
63
|
-
PDQTest::Skeleton.install_template(spec_file, 'rspec.rb.erb', {:classname=>classname})
|
64
|
-
end
|
65
|
-
}
|
66
|
-
end
|
67
|
-
|
68
|
-
end
|
69
|
-
end
|
data/lib/pdqtest/syntax.rb
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
# Ask user to install puppet gem if missing. It's not in the bundle to avoid
|
2
|
-
# the issue of accidentally installing the puppet gem on a managed node.
|
3
|
-
# Fixes #21
|
4
|
-
begin
|
5
|
-
require 'puppet-syntax/tasks/puppet-syntax'
|
6
|
-
rescue LoadError
|
7
|
-
raise "Please install the puppet gem: `gem install puppet`"
|
8
|
-
end
|
9
|
-
require 'pdqtest'
|
10
|
-
require 'pdqtest/emoji'
|
11
|
-
module PDQTest
|
12
|
-
module Syntax
|
13
|
-
def self.puppet
|
14
|
-
status = system("rake syntax")
|
15
|
-
PDQTest::Emoji.partial_status(status, 'Syntax')
|
16
|
-
|
17
|
-
status
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
data/res/skeleton/Gemfile
DELETED
data/res/skeleton/Rakefile
DELETED
data/res/skeleton/dot_gitignore
DELETED
data/res/skeleton/dot_rspec
DELETED
data/res/skeleton/hiera.yaml
DELETED
data/res/skeleton/spec_helper.rb
DELETED
data/res/skeleton/test.yaml
DELETED