pdqtest 0.8.4 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/exe/pdqtest +10 -0
- data/lib/pdqtest/puppet.rb +18 -6
- data/lib/pdqtest/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 59cfe8a4a7a28734f02acac84965152cb9e28197
|
4
|
+
data.tar.gz: 1b70cf001fc4a3b622990c0f128ff4a6099800e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 364b23efc25433b0cf82a4d4c4f3e1d91302f90daffad172cc462905254c5cab2626b0512a5940048b693cee7bdc199b18f37c56dd6e6d94d78151a79b7ed6ed
|
7
|
+
data.tar.gz: d0b0a259cfcbb34dc9f157405a1fbafb45f54e52b6465ac531006c64133a37384487b978a1258d59e46039ce4a9db79bc0c0fe0bbefd20fd3ef9c16ee79b9732
|
data/exe/pdqtest
CHANGED
@@ -49,6 +49,14 @@ Escort::App.create do |app|
|
|
49
49
|
:type => :boolean,
|
50
50
|
:default => false,
|
51
51
|
)
|
52
|
+
|
53
|
+
opts.opt(:skip_idempotency,
|
54
|
+
'Dont check idempotency (run only once)',
|
55
|
+
:long => '--skip-idempotency',
|
56
|
+
:type => :boolean,
|
57
|
+
:default => false,
|
58
|
+
)
|
59
|
+
|
52
60
|
end
|
53
61
|
|
54
62
|
app.command :all do |command|
|
@@ -56,6 +64,7 @@ Escort::App.create do |app|
|
|
56
64
|
command.description "Run all tests"
|
57
65
|
command.action do |options, arguments|
|
58
66
|
PDQTest::Emoji.disable(options[:global][:options][:disable_emoji])
|
67
|
+
PDQTest::Puppet.skip_second_run(options[:global][:options][:skip_idempotency])
|
59
68
|
|
60
69
|
PDQTest::Instance.set_keep_container(options[:global][:options][:keep_container])
|
61
70
|
PDQTest::Instance.set_docker_image(options[:global][:options][:image_name])
|
@@ -92,6 +101,7 @@ Escort::App.create do |app|
|
|
92
101
|
end
|
93
102
|
command.action do |options, arguments|
|
94
103
|
PDQTest::Emoji.disable(options[:global][:options][:disable_emoji])
|
104
|
+
PDQTest::Puppet.skip_second_run(options[:global][:options][:skip_idempotency])
|
95
105
|
PDQTest::Instance.set_docker_image(options[:global][:options][:image_name])
|
96
106
|
PDQTest::Instance.set_keep_container(options[:global][:options][:keep_container])
|
97
107
|
example = options[:global][:commands][:acceptance][:options][:example]
|
data/lib/pdqtest/puppet.rb
CHANGED
@@ -20,8 +20,13 @@ module PDQTest
|
|
20
20
|
CLASS_RE = /^class /
|
21
21
|
@@bats_executed = []
|
22
22
|
@@setup_executed = []
|
23
|
+
@@skip_second_run = false
|
23
24
|
FIXTURES = 'fixtures.yml'
|
24
25
|
|
26
|
+
def self.skip_second_run(skip_second_run)
|
27
|
+
@@skip_second_run = skip_second_run
|
28
|
+
end
|
29
|
+
|
25
30
|
def self.reset_bats_executed
|
26
31
|
@@bats_executed = []
|
27
32
|
end
|
@@ -212,15 +217,22 @@ module PDQTest
|
|
212
217
|
PDQTest::Docker.log_out(res)
|
213
218
|
if PDQTest::Docker.exec_status(res, true) # allow 2 as exit status
|
214
219
|
|
215
|
-
|
216
|
-
|
217
|
-
PDQTest::Docker.log_out(res)
|
220
|
+
if @@skip_second_run
|
221
|
+
Escort::Logger.output.puts "Skipping idempotency check as you requested..."
|
218
222
|
|
219
|
-
|
220
|
-
if PDQTest::Docker.exec_status(res) # only allow 0 as exit status
|
223
|
+
# check the system right now since puppet ran OK once
|
221
224
|
status = bats_test(container, example, AFTER_SUFFIX)
|
222
225
|
else
|
223
|
-
|
226
|
+
# run puppet apply - 2nd run (check for idempotencey/no more changes)
|
227
|
+
res = PDQTest::Docker.exec(container, puppet_apply(example))
|
228
|
+
PDQTest::Docker.log_out(res)
|
229
|
+
|
230
|
+
# run the bats test if nothing failed yet
|
231
|
+
if PDQTest::Docker.exec_status(res) # only allow 0 as exit status
|
232
|
+
status = bats_test(container, example, AFTER_SUFFIX)
|
233
|
+
else
|
234
|
+
Escort::Logger.error.error "Not idempotent: #{example}"
|
235
|
+
end
|
224
236
|
end
|
225
237
|
else
|
226
238
|
Escort::Logger.error.error "First puppet run of #{example} failed"
|
data/lib/pdqtest/version.rb
CHANGED
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: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Geoff Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-09-
|
11
|
+
date: 2017-09-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|