puppet_litmus 1.1.0 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +16 -5
- data/lib/puppet_litmus/rake_helper.rb +4 -3
- data/lib/puppet_litmus/rake_tasks.rb +9 -0
- data/lib/puppet_litmus/version.rb +1 -1
- 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: 8a30baea9597240441a67b27c36f17d535c33db12b4099359b56bd812e756cbc
|
4
|
+
data.tar.gz: cb7f0aa263b87db882ab890f1c3c0b7629b26cc77210f74a94d708b9002875c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c8f045fd86d51b30319f30f56d0b3f472c9904e4400e89c35b21fce606d7b627c32f4a8e4d31abfe48d873dea040023aebcfb84cbacf4edf64198eb1e07442d
|
7
|
+
data.tar.gz: 1724f3326553387aaeeb8310980a242cc4cd047bd8ef3ae0b9ae12f10c677ea1db720484833750e7226ddaaa930288c8e0e79c56dc68b649b4f4a772e8c66f98
|
data/README.md
CHANGED
@@ -27,25 +27,36 @@ Litmus also facilitates parallel test runs and running tests in isolation. Each
|
|
27
27
|
|
28
28
|
Install Litmus as a gem by running `gem install puppet_litmus`.
|
29
29
|
|
30
|
-
- Note if you choose to override the `litmus_inventory.yaml` location, please ensure that the directory
|
30
|
+
- Note if you choose to override the `litmus_inventory.yaml` location, please ensure that the directory structure you define exists.
|
31
31
|
|
32
32
|
## matrix_from_metadata_v2
|
33
33
|
|
34
|
-
matrix_from_metadata_v2 tool generates github
|
34
|
+
matrix_from_metadata_v2 tool generates a github action matrix from the supported operating systems listed in the module's metadata.json.
|
35
35
|
|
36
|
-
How to use it:
|
36
|
+
How to use it:
|
37
|
+
in the project module root directory run `bundle exec matrix_from_metadata_v2`
|
37
38
|
|
38
39
|
### --exclude-platforms parameter
|
39
40
|
|
40
|
-
matrix_from_metadata_v2 accepts `--exclude-platforms <JSON array>`
|
41
|
+
matrix_from_metadata_v2 accepts the `--exclude-platforms <JSON array>` argument in order to exclude some platforms from the matrix.
|
41
42
|
|
42
|
-
|
43
|
+
For example:
|
43
44
|
|
44
45
|
`$: bundle exec matrix_from_metadata_v2 --exclude-platforms '["debian-11","centos-8"]'`
|
45
46
|
|
46
47
|
> Note: The option value should be JSON string otherwise it will throw an error.
|
47
48
|
> The values provided in the json array are case-insensitive `["debian-11","centos-8"]'` or `["Debian-11","CentOS-8"]'` are treated as being the same.
|
48
49
|
|
50
|
+
### --custom-matrix parameter
|
51
|
+
|
52
|
+
matrix_from_metadata_v2 accepts the `--custom-matrix /path/to/matrix.json` argument in order to execute your test suite against a custom matrix. This is useful for use cases that do not fit the default matrix generated.
|
53
|
+
|
54
|
+
In order to use this new functionality, run:
|
55
|
+
|
56
|
+
`$: bundle exec matrix_from_metadata_v2 --custom-matrix matrix.json`
|
57
|
+
|
58
|
+
> Note: The file should contain a valid Array of JSON Objects (i.e. `[{"label":"AlmaLinux-8","provider":"provision_service","image":"almalinux-cloud/almalinux-8"}, {..}]`), otherwise it will throw an error.
|
59
|
+
|
49
60
|
## Documentation
|
50
61
|
|
51
62
|
For documentation, see our [Litmus Docs Site](https://puppetlabs.github.io/content-and-tooling-team/docs/litmus/).
|
@@ -98,7 +98,8 @@ module PuppetLitmus::RakeHelper
|
|
98
98
|
|
99
99
|
results = {}
|
100
100
|
targets.each do |node_name|
|
101
|
-
next if
|
101
|
+
# next if local host or provisioner fact empty/not set (GH-421)
|
102
|
+
next if node_name == 'litmus_localhost' || facts_from_node(inventory_hash, node_name)['provisioner'].nil?
|
102
103
|
|
103
104
|
result = tear_down(node_name, inventory_hash)
|
104
105
|
# Some provisioners tear_down targets that were created as a batch job.
|
@@ -327,7 +328,7 @@ module PuppetLitmus::RakeHelper
|
|
327
328
|
end
|
328
329
|
|
329
330
|
def start_spinner(message)
|
330
|
-
if (ENV['CI'] || '').casecmp('true').zero?
|
331
|
+
if (ENV['CI'] || '').casecmp('true').zero? || Gem.win_platform?
|
331
332
|
puts message
|
332
333
|
spinner = Thread.new do
|
333
334
|
# CI systems are strange beasts, we only output a '.' every wee while to keep the terminal alive.
|
@@ -345,7 +346,7 @@ module PuppetLitmus::RakeHelper
|
|
345
346
|
end
|
346
347
|
|
347
348
|
def stop_spinner(spinner)
|
348
|
-
if (ENV['CI'] || '').casecmp('true').zero?
|
349
|
+
if (ENV['CI'] || '').casecmp('true').zero? || Gem.win_platform?
|
349
350
|
Thread.kill(spinner)
|
350
351
|
else
|
351
352
|
spinner.success
|
@@ -75,6 +75,8 @@ namespace :litmus do
|
|
75
75
|
task :provision, [:provisioner, :platform, :inventory_vars] do |_task, args|
|
76
76
|
Rake::Task['spec_prep'].invoke
|
77
77
|
|
78
|
+
retry_count = 3
|
79
|
+
current_retry_count = 0
|
78
80
|
begin
|
79
81
|
spinner = start_spinner("Provisioning #{args[:platform]} using #{args[:provisioner]} provisioner.")
|
80
82
|
|
@@ -94,6 +96,13 @@ namespace :litmus do
|
|
94
96
|
check_connectivity?(inventory_hash_from_inventory_file, target)
|
95
97
|
end
|
96
98
|
end
|
99
|
+
rescue PuppetLitmus::RakeHelper::LitmusTimeoutError
|
100
|
+
current_retry_count += 1
|
101
|
+
Rake::Task['litmus:tear_down'].invoke(target_names.first)
|
102
|
+
raise if current_retry_count > retry_count
|
103
|
+
|
104
|
+
puts "Provision of node #{target_names.first} failed, Retrying #{current_retry_count} of #{retry_count}"
|
105
|
+
retry
|
97
106
|
ensure
|
98
107
|
stop_spinner(spinner)
|
99
108
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppet_litmus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Puppet, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-07-
|
11
|
+
date: 2023-07-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bolt
|