pdqtest 1.9.9beta6 → 1.9.9beta7
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/doc/pdk.md +31 -9
- data/doc/tips_and_tricks.md +2 -1
- data/docker_images/windows/make.ps1 +1 -1
- data/lib/pdqtest/docker.rb +1 -1
- data/lib/pdqtest/fastcheck.rb +11 -4
- data/lib/pdqtest/skeleton.rb +17 -0
- data/lib/pdqtest/upgrade.rb +22 -9
- data/lib/pdqtest/version.rb +1 -1
- data/res/skeleton/Makefile +5 -1
- data/res/skeleton/bitbucket-pipelines.yml +10 -2
- data/res/skeleton/make.ps1 +31 -12
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dd42c9920bb14bf63ba6dc6d021cb5bc2cb336aca20b76dcb41f8c19a317e545
|
4
|
+
data.tar.gz: 295dec7313f15b1e59348ea7e1106b8a03523ee5efe5bacb61b7a1df0e8e48bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a886738ec27f9f20017f4a42d224b7a2b1edc62e3e55f5e8e472850abe61219e57766793c130d872389e1250b2000cf7fc5f703e0ca99569250ab71efabb8516
|
7
|
+
data.tar.gz: 62b42b4dc521d8f2d36937ef910bceb3fe193d6ddb866bbf11fe29ffc5f0c5d090123f33344cc73a77c1f59299260152377394d96a24681c0e5f86787554b9db
|
data/doc/pdk.md
CHANGED
@@ -44,7 +44,7 @@ VMs in order to extract maximum speed. It offers a different approach to
|
|
44
44
|
Of course, this will only ever give you an approximation of a real-world system
|
45
45
|
but in many cases this is all that's needed. The complexity of setting up a
|
46
46
|
100% accurate test environment is a daunting task and one that may never provide
|
47
|
-
ROI
|
47
|
+
ROI vs the effort spent configuring and maintaining it.
|
48
48
|
|
49
49
|
If perfect accuracy is indeed required, then PDQTest is not what you are looking
|
50
50
|
for and you should look towards solutions like Beaker or
|
@@ -61,7 +61,10 @@ New projects should be created using PDK: `pdk new module`.
|
|
61
61
|
This will give you all the PDK versioned files you would ever need. When you run
|
62
62
|
`pdqtest init` on a new project created with PDK, we only copy in our own
|
63
63
|
integration files and do not not touch the PDK generated files at all (the ones
|
64
|
-
marked 🛠 below)
|
64
|
+
marked 🛠 below).
|
65
|
+
|
66
|
+
After running `pdqtest init`, run `pdk update` to have PDK process the
|
67
|
+
`.sync.yml` we installed.
|
65
68
|
|
66
69
|
### Existing PDQTest projects
|
67
70
|
To make upgrading to PDQTest 2.0 + PDK easy for our existing users, we automate
|
@@ -79,18 +82,37 @@ unless PDK starts writing new files that we are already using.
|
|
79
82
|
* `template-url`
|
80
83
|
* `template-ref`
|
81
84
|
The values for these fields are obtained automatically from PDK itself and are
|
82
|
-
consistent with the system installed PDK
|
85
|
+
consistent with the system installed PDK (we generate a temporary project and
|
86
|
+
read files/values from it).
|
83
87
|
|
84
88
|
**Gemfile.project**
|
85
89
|
|
86
|
-
|
90
|
+
If you require PDK to know about a particular gem for your project, add it to
|
91
|
+
this file and then run:
|
92
|
+
|
93
|
+
*Linux*
|
94
|
+
```shell
|
95
|
+
make Gemfile.local
|
96
|
+
```
|
97
|
+
|
98
|
+
*Windows*
|
99
|
+
```shell
|
100
|
+
.\make.ps1 Gemfile.local
|
101
|
+
```
|
102
|
+
|
103
|
+
Depending on platform, this will symlink or copy `Gemfile.project` to
|
104
|
+
`Gemfile.local` respectively, then run `pdk bundle install` to update PDK's
|
105
|
+
knowledge of the new gem.
|
106
|
+
|
87
107
|
|
88
108
|
**Miscellaneous skeletons**
|
89
109
|
|
90
110
|
When `pdqtest init` is run, we install a small set of skeleton files in the root
|
91
|
-
of your project. This is a one-off operation to get you started
|
92
|
-
|
93
|
-
|
111
|
+
of your project. This is a one-off operation to get you started and is _only_
|
112
|
+
done if your project is not already marked PDK compatible.
|
113
|
+
|
114
|
+
After your module has been marked as PDK compatible, you must only manage these
|
115
|
+
files using PDK.
|
94
116
|
|
95
117
|
Skeletons are generated on the fly using PDK itself, so they are always
|
96
118
|
up-to-date according to the PDK you have installed on your system.
|
@@ -99,7 +121,7 @@ up-to-date according to the PDK you have installed on your system.
|
|
99
121
|
If you have an existing Puppet project that does not use PDQTest or PDK (eg
|
100
122
|
created by hand or with the old `puppet module generate` command), then the
|
101
123
|
recommended way to enable PDQTest is to first enable PDK by running
|
102
|
-
`pdk convert
|
124
|
+
`pdk convert`, then follow the wizard.
|
103
125
|
|
104
126
|
You may then enable `PDQTest` by running `pdqtest init`.
|
105
127
|
|
@@ -134,7 +156,7 @@ These are the files installed, files marked 🛠 are generated by PDK:
|
|
134
156
|
|
135
157
|
The remaining files are specific to PDQTest - notably:
|
136
158
|
* `.travis.yml` - Complete test suite for Linux modules
|
137
|
-
* `bitbucket-pipelines.yaml` -
|
159
|
+
* `bitbucket-pipelines.yaml` - logical testing only (unit/RSpec)
|
138
160
|
* `.puppet-lint.rc` - Make lint errors test failures, ignore double quotes, etc
|
139
161
|
* `Makefile` - Essential launch script for Linux
|
140
162
|
* `make.ps1` - Essential launch script for Windows
|
data/doc/tips_and_tricks.md
CHANGED
@@ -20,4 +20,5 @@
|
|
20
20
|
* Create/copy files, directories, etc.
|
21
21
|
* Install OS packages
|
22
22
|
* Install python scripts to mock database servers using SQLite... 😉
|
23
|
-
* Files added by PDQTest >= 2.0 have the magic marker:
|
23
|
+
* Files added by PDQTest >= 2.0 have the magic marker:
|
24
|
+
`*File originally created by PDQTest*`
|
@@ -1,2 +1,2 @@
|
|
1
|
-
docker build -t declarativesystems/pdqtest-windows:$([datetime]::now.tostring("yyyy-MM-dd"))-0 .
|
1
|
+
docker build --no-cache -t declarativesystems/pdqtest-windows:$([datetime]::now.tostring("yyyy-MM-dd"))-0 .
|
2
2
|
|
data/lib/pdqtest/docker.rb
CHANGED
@@ -10,7 +10,7 @@ module PDQTest
|
|
10
10
|
IMAGES = {
|
11
11
|
:DEFAULT => 'declarativesystems/pdqtest-centos:2018-09-15-0',
|
12
12
|
:UBUNTU => 'declarativesystems/pdqtest-ubuntu:2018-09-15-0',
|
13
|
-
:WINDOWS => 'declarativesystems/pdqtest-windows:2018-09-
|
13
|
+
:WINDOWS => 'declarativesystems/pdqtest-windows:2018-09-29-0',
|
14
14
|
}
|
15
15
|
|
16
16
|
# volume paths are different for windows containers
|
data/lib/pdqtest/fastcheck.rb
CHANGED
@@ -7,13 +7,20 @@ module PDQTest
|
|
7
7
|
def self.run
|
8
8
|
$logger.debug "inside Fastcheck::run - current dir: #{Dir.pwd}"
|
9
9
|
|
10
|
-
|
11
|
-
|
10
|
+
# On windows, `system()` always executes `cmd.exe` so we can use `&&` to
|
11
|
+
# join commands... even when we launched from powershell.exe (! unproved)
|
12
|
+
#
|
13
|
+
# also must, MUST, MUST!!! use double quotes not singles to feed `system`
|
14
|
+
# or it will be eaten
|
15
|
+
cmd = "cd .pdqtest && bundle exec \"cd .. && rake syntax\""
|
16
|
+
$logger.debug "Running syntax...: #{cmd}"
|
17
|
+
status = system(cmd)
|
12
18
|
$logger.debug "...done; result: #{status}"
|
13
19
|
|
14
20
|
if status
|
15
|
-
|
16
|
-
|
21
|
+
cmd = "cd .pdqtest && bundle exec \"cd .. && puppet lint --relative manifests\""
|
22
|
+
$logger.debug "Running lint...: #{cmd}"
|
23
|
+
status = system(cmd)
|
17
24
|
$logger.debug "...done; result: #{status}"
|
18
25
|
end
|
19
26
|
|
data/lib/pdqtest/skeleton.rb
CHANGED
@@ -27,6 +27,7 @@ module PDQTest
|
|
27
27
|
"Gemfile",
|
28
28
|
"Rakefile",
|
29
29
|
".gitignore",
|
30
|
+
".gitattributes",
|
30
31
|
]
|
31
32
|
|
32
33
|
# PDK adds custom metadata fields which we can ONLY get by creating a new
|
@@ -42,6 +43,15 @@ module PDQTest
|
|
42
43
|
"paths" => [
|
43
44
|
".Puppetfile.pdqtest",
|
44
45
|
],
|
46
|
+
},
|
47
|
+
".gitattributes" => {
|
48
|
+
"include" => [
|
49
|
+
"*.epp eol=lf",
|
50
|
+
"*.json eol=lf",
|
51
|
+
"*.yaml eol=lf",
|
52
|
+
"*.yml eol=lf",
|
53
|
+
"*.md eol=lf",
|
54
|
+
]
|
45
55
|
}
|
46
56
|
}.freeze
|
47
57
|
|
@@ -170,6 +180,13 @@ module PDQTest
|
|
170
180
|
# snag generated metadata now we are in the temporary module dir
|
171
181
|
Dir.chdir TEMP_PDK_MODULE do
|
172
182
|
@@pdk_metadata = PDQTest::Puppet.module_metadata
|
183
|
+
|
184
|
+
# Now we need to install .sync.yml and re-install otherwise not
|
185
|
+
# applied until `pdk update`
|
186
|
+
PDQTest::Pdk.amend_sync_yml(SYNC_YML_CONTENT)
|
187
|
+
|
188
|
+
# Next do a forced update to make PDK process sync.yml
|
189
|
+
PDQTest::Pdk.run("update --force")
|
173
190
|
end
|
174
191
|
|
175
192
|
PDK_FILES.each do |pdk_file|
|
data/lib/pdqtest/upgrade.rb
CHANGED
@@ -2,16 +2,15 @@ require 'pdqtest/skeleton'
|
|
2
2
|
|
3
3
|
module PDQTest
|
4
4
|
module Upgrade
|
5
|
-
GEMDIR = '.pdqtest'
|
5
|
+
GEMDIR = '.pdqtest'.freeze
|
6
6
|
GEMFILE = File.join(GEMDIR,'Gemfile')
|
7
7
|
GEM_REGEXP = /gem ('|")([-\w]+)('|").*$/
|
8
8
|
GEM_ATTRIB_REGEXP = /^\s*:\w+/
|
9
9
|
|
10
|
+
GEM_SOURCE = "source ENV['GEM_SOURCE'] || 'https://rubygems.org'".freeze
|
11
|
+
PDQTEST_MAGIC_MARKER = "*File originally created by PDQTest*".freeze
|
12
|
+
|
10
13
|
GEMS = {
|
11
|
-
# 'gemsource' => {
|
12
|
-
# 'line' => "source ENV['GEM_SOURCE'] || 'https://rubygems.org'",
|
13
|
-
# 'added' => false,
|
14
|
-
# },
|
15
14
|
'pdqtest' => {
|
16
15
|
'line' => "gem 'pdqtest', '#{PDQTest::VERSION}'",
|
17
16
|
'added' => false,
|
@@ -21,18 +20,25 @@ module PDQTest
|
|
21
20
|
'added' => false,
|
22
21
|
},
|
23
22
|
'puppet' => {
|
24
|
-
'line' => "gem 'puppet'",
|
23
|
+
'line' => "gem 'puppet', '5.5.3'",
|
25
24
|
'added' => false,
|
26
25
|
},
|
27
26
|
'puppet-lint' => {
|
28
|
-
'line' => "gem 'puppet-lint'",
|
27
|
+
'line' => "gem 'puppet-lint', '2.3.6'",
|
29
28
|
'added' => false,
|
30
29
|
},
|
31
30
|
'puppet-syntax' => {
|
32
|
-
'line' => "gem 'puppet-syntax'",
|
31
|
+
'line' => "gem 'puppet-syntax', '2.4.1'",
|
32
|
+
'added' => false,
|
33
|
+
},
|
34
|
+
'puppetlabs_spec_helper' => {
|
35
|
+
'line' => "gem 'puppetlabs_spec_helper', '2.11.0'",
|
36
|
+
'added' => false,
|
37
|
+
},
|
38
|
+
'rake' => {
|
39
|
+
'line' => "gem 'rake', '12.3.1'",
|
33
40
|
'added' => false,
|
34
41
|
},
|
35
|
-
|
36
42
|
}.freeze
|
37
43
|
|
38
44
|
|
@@ -48,6 +54,13 @@ module PDQTest
|
|
48
54
|
|
49
55
|
if ! File.exists?(GEMFILE)
|
50
56
|
FileUtils.touch(GEMFILE)
|
57
|
+
|
58
|
+
# We are creating Gemfile for the first time, so add a gemsource and
|
59
|
+
# a magic marker
|
60
|
+
File.open(GEMFILE, 'w') do |file|
|
61
|
+
file.puts("# #{PDQTEST_MAGIC_MARKER}")
|
62
|
+
file.puts(GEM_SOURCE)
|
63
|
+
end
|
51
64
|
end
|
52
65
|
File.open(GEMFILE, 'r') do |f|
|
53
66
|
f.each_line { |line|
|
data/lib/pdqtest/version.rb
CHANGED
data/res/skeleton/Makefile
CHANGED
@@ -27,7 +27,7 @@ pdqtestbundle:
|
|
27
27
|
cd .pdqtest && pwd && bundle install
|
28
28
|
|
29
29
|
docs:
|
30
|
-
cd .pdqtest && pwd && bundle exec "cd ..&& puppet strings"
|
30
|
+
cd .pdqtest && pwd && bundle exec "cd ..&& puppet strings generate --format markdown"
|
31
31
|
|
32
32
|
|
33
33
|
Gemfile.local:
|
@@ -37,3 +37,7 @@ Gemfile.local:
|
|
37
37
|
|
38
38
|
pdkbundle:
|
39
39
|
pdk bundle install
|
40
|
+
|
41
|
+
clean:
|
42
|
+
rm -rf pkg
|
43
|
+
rm -rf spec/fixtures/modules
|
@@ -1,5 +1,8 @@
|
|
1
1
|
# *File originally created by PDQTest*
|
2
|
-
|
2
|
+
# To run locally:
|
3
|
+
# https://confluence.atlassian.com/bitbucket/debug-your-pipelines-locally-with-docker-838273569.html
|
4
|
+
---
|
5
|
+
image: ruby:2.4.1
|
3
6
|
|
4
7
|
pipelines:
|
5
8
|
default:
|
@@ -9,7 +12,12 @@ pipelines:
|
|
9
12
|
script:
|
10
13
|
- ruby --version
|
11
14
|
- bundler --version
|
12
|
-
-
|
15
|
+
- wget https://apt.puppetlabs.com/puppet5-release-trusty.deb
|
16
|
+
- dpkg -i puppet5-release-trusty.deb
|
17
|
+
- apt-get update
|
18
|
+
- apt install -y pdk
|
19
|
+
- sh .ci_custom.sh
|
20
|
+
- make pdqtestbundle
|
13
21
|
- make logical
|
14
22
|
|
15
23
|
definitions:
|
data/res/skeleton/make.ps1
CHANGED
@@ -10,10 +10,10 @@
|
|
10
10
|
.PARAMETER target
|
11
11
|
Test suite to run
|
12
12
|
#>
|
13
|
-
# *File originally created by PDQTest*
|
14
13
|
param(
|
15
14
|
$target = "all"
|
16
15
|
)
|
16
|
+
# *File originally created by PDQTest*
|
17
17
|
|
18
18
|
$gfl = "Gemfile.local"
|
19
19
|
$gfp = "Gemfile.project"
|
@@ -41,25 +41,44 @@ function Install-GemfileLocal {
|
|
41
41
|
|
42
42
|
switch ($target) {
|
43
43
|
"all" {
|
44
|
-
|
45
|
-
bundle exec pdqtest all
|
44
|
+
cd .pdqtest; bundle exec pdqtest all; cd ..
|
46
45
|
}
|
47
46
|
"fast" {
|
48
|
-
|
49
|
-
|
47
|
+
cd .pdqtest; bundle exec pdqtest fast; cd ..
|
48
|
+
}
|
49
|
+
"acceptance" {
|
50
|
+
cd .pdqtest; bundle exec pdqtest acceptance; cd ..
|
50
51
|
}
|
51
52
|
"shell" {
|
52
|
-
|
53
|
-
bundle exec pdqtest --keep-container acceptance
|
53
|
+
cd .pdqtest; bundle exec pdqtest --keep-container acceptance; cd ..
|
54
54
|
}
|
55
55
|
"shellnopuppet" {
|
56
|
-
|
57
|
-
|
56
|
+
cd .pdqtest; bundle exec pdqtest shell; cd ..
|
57
|
+
}
|
58
|
+
"setup" {
|
59
|
+
cd .pdqtest; bundle exec pdqtest setup; cd ..
|
58
60
|
}
|
59
61
|
"logical" {
|
60
|
-
|
61
|
-
|
62
|
-
|
62
|
+
cd .pdqtest; bundle exec pdqtest logical; cd ..
|
63
|
+
cd .pdqtest ; bundle exec "cd ..; puppet strings"; cd ..
|
64
|
+
}
|
65
|
+
"docs" {
|
66
|
+
cd .pdqtest ; bundle exec "cd ..; puppet strings generate --format markdown"; cd ..
|
67
|
+
}
|
68
|
+
"Gemfile.local" {
|
69
|
+
echo "[(-_-)zzz] *copying* Gemfile.project to Gemfile.local and running pdk bundle..."
|
70
|
+
Install-GemfileLocal
|
71
|
+
.\make.ps1 pdkbundle
|
72
|
+
}
|
73
|
+
"pdqtestbundle" {
|
74
|
+
cd .pdqtest ; bundle install; cd ..
|
75
|
+
}
|
76
|
+
"pdkbundle" {
|
77
|
+
pdk bundle install
|
78
|
+
}
|
79
|
+
"clean" {
|
80
|
+
Remove-Item -ErrorAction SilentlyContinue -Confirm:$false -Recurse -force pkg
|
81
|
+
Remove-Item -ErrorAction SilentlyContinue -Confirm:$false -Recurse -force spec/fixtures/modules
|
63
82
|
}
|
64
83
|
default {
|
65
84
|
Write-Error "No such target: $($target)"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pdqtest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.9.
|
4
|
+
version: 1.9.9beta7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Geoff Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-09-
|
11
|
+
date: 2018-09-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|