kitchen-vra 1.2.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +19 -0
- data/CHANGELOG.md +3 -0
- data/Rakefile +7 -0
- data/kitchen-vra.gemspec +1 -0
- data/lib/kitchen/driver/vra.rb +2 -2
- data/lib/kitchen/driver/vra_version.rb +1 -1
- data/spec/vra_spec.rb +25 -10
- metadata +17 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f24be35c67ff7449f53d115bc977df954498fb7
|
4
|
+
data.tar.gz: ce2936e60a813f39932306710c2834e269cbcc2d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e5f0fdcc45c8494a9e223eeb3fcb5e92634d2bd92483470ac307763492c2bf4170ae81638694abc2e611be2d258bd9a729ca945621c9bc0d5b177f51d217a5b6
|
7
|
+
data.tar.gz: 59571993d793ff192dc305486bb9ae0a626dec51556b9c1468a9a6d67cee98fa9f9d46d7c4407e00968a7e58c2b5cfcffa8e20a3b4822bc7f74ab22f35521451
|
data/.travis.yml
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
language: ruby
|
2
|
+
cache: bundler
|
3
|
+
sudo: false
|
4
|
+
|
5
|
+
rvm:
|
6
|
+
- 2.0.0
|
7
|
+
- 2.1
|
8
|
+
- 2.2
|
9
|
+
|
10
|
+
branches:
|
11
|
+
only:
|
12
|
+
- master
|
13
|
+
|
14
|
+
notifications:
|
15
|
+
slack:
|
16
|
+
on_success: change
|
17
|
+
on_failure: always
|
18
|
+
rooms:
|
19
|
+
secure: iESaLLqy5RK9os0fB83vXF0DgmMaWE8/tuhEg6rL6m2YlHq+mHwT5Hoc+YIFHbzl4PXS07i99ICFpGiUXuyHSn0jrNrI4z4BRA+3EZ+DLmhHGis3znWZJ1SxrCjYCZazj0SFG49mwaZjeggQNafPm/++sqzVVI5zJuLx+92Dwuztr4sa20Oa2UOKtCsgkNojmNwTKNqlN+bh+/pX7IH5rVUDMkd3k8Sdrd8Jk0AblztGvXJO/Sn+L6Ud9NAb38bVkC7Pw8Zows6Icw4ioCIwH4tl/AI6NwfvHJu33UqoEZu/8aBkSvgjGi+hTaztcwK9xMpK70AZlYEqNS4bVTAw/otAbw+xnqWUQfL3Kc2MjSpxdiLDXhELtV9jV/VlnDwX3L79B0sICKFdcLHrG8I4tMgCDxYTNjUHY+UcccHrPsYwXn01lkCc6Pa7LZnCqS69/2vVfdb8i2LOaEvMvj9uLeeADu2EHeqM0VV1Y58dRCef7Ls8cOiOZEqghG24H1Cu26vHKamLUMZu0ctYOOmxGP159j1iwCkygb2k10BXTGdFuMch3GE3RfwaPFk8UZoY+0tQNP5OGiHhhLyLo16yxXQuDyHq5kkSMuhT/34kdY2cZuJAi8U79YJkNb29CGPUeBJ1QqXulYg/xPKW03FBWxpbkPjdPr9WTbpMGOlhBwc=
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# kitchen-vra Changelog
|
2
2
|
|
3
|
+
## v1.3.0 (2016-01-25)
|
4
|
+
* [pr#10](https://github.com/chef-partners/kitchen-vra/pull/10) Capping the server wait_until_ready retry growth at 30 seconds.
|
5
|
+
|
3
6
|
## v1.2.0 (2015-11-25)
|
4
7
|
* [pr#7](https://github.com/chef-partners/kitchen-vra/pull/7) Added retry logic for wait_until_ready in cases where Test Kitchen would unwind (such as DNS issues). Added fallback logic for when a host has no IP address, complimenting the `use_dns` parameter.
|
5
8
|
|
data/Rakefile
CHANGED
data/kitchen-vra.gemspec
CHANGED
data/lib/kitchen/driver/vra.rb
CHANGED
@@ -103,7 +103,7 @@ module Kitchen
|
|
103
103
|
info("Server #{server.id} (#{server.name}) created. Waiting until ready...")
|
104
104
|
|
105
105
|
try = 0
|
106
|
-
sleep_time =
|
106
|
+
sleep_time = 0
|
107
107
|
|
108
108
|
begin
|
109
109
|
instance.transport.connection(state).wait_until_ready
|
@@ -111,7 +111,7 @@ module Kitchen
|
|
111
111
|
warn("Server #{server.id} (#{server.name}) not reachable: #{e.class} -- #{e.message}")
|
112
112
|
|
113
113
|
try += 1
|
114
|
-
sleep_time
|
114
|
+
sleep_time += 5 if sleep_time < 30
|
115
115
|
|
116
116
|
if try > config[:server_ready_retries]
|
117
117
|
error('Retries exceeded. Destroying server...')
|
data/spec/vra_spec.rb
CHANGED
@@ -260,8 +260,8 @@ describe Kitchen::Driver::Vra do
|
|
260
260
|
|
261
261
|
it 'displays a warning, sleeps once, retries, errors, destroys, and raises' do
|
262
262
|
expect(connection).to receive(:wait_until_ready).twice.and_raise(Timeout::Error)
|
263
|
-
expect(driver).to receive(:warn).once.with('Sleeping
|
264
|
-
expect(driver).to receive(:sleep).once.with(
|
263
|
+
expect(driver).to receive(:warn).once.with('Sleeping 5 seconds and retrying...')
|
264
|
+
expect(driver).to receive(:sleep).once.with(5)
|
265
265
|
expect(driver).to receive(:error).with('Retries exceeded. Destroying server...')
|
266
266
|
expect(driver).to receive(:destroy).with(state)
|
267
267
|
expect { driver.wait_for_server(state, resource1) }.to raise_error(Timeout::Error)
|
@@ -273,10 +273,10 @@ describe Kitchen::Driver::Vra do
|
|
273
273
|
|
274
274
|
it 'displays 2 warnings, sleeps twice, retries, errors, destroys, and raises' do
|
275
275
|
expect(connection).to receive(:wait_until_ready).exactly(3).times.and_raise(Timeout::Error)
|
276
|
-
expect(driver).to receive(:warn).once.with('Sleeping
|
277
|
-
expect(driver).to receive(:warn).once.with('Sleeping
|
278
|
-
expect(driver).to receive(:sleep).once.with(
|
279
|
-
expect(driver).to receive(:sleep).once.with(
|
276
|
+
expect(driver).to receive(:warn).once.with('Sleeping 5 seconds and retrying...')
|
277
|
+
expect(driver).to receive(:warn).once.with('Sleeping 10 seconds and retrying...')
|
278
|
+
expect(driver).to receive(:sleep).once.with(5)
|
279
|
+
expect(driver).to receive(:sleep).once.with(10)
|
280
280
|
expect(driver).to receive(:error).with('Retries exceeded. Destroying server...')
|
281
281
|
expect(driver).to receive(:destroy).with(state)
|
282
282
|
expect { driver.wait_for_server(state, resource1) }.to raise_error(Timeout::Error)
|
@@ -289,15 +289,30 @@ describe Kitchen::Driver::Vra do
|
|
289
289
|
it 'displays 2 warnings, sleeps twice, retries, but does not destroy or raise' do
|
290
290
|
expect(connection).to receive(:wait_until_ready).twice.and_raise(Timeout::Error)
|
291
291
|
expect(connection).to receive(:wait_until_ready).once.and_return(true)
|
292
|
-
expect(driver).to receive(:warn).once.with('Sleeping
|
293
|
-
expect(driver).to receive(:warn).once.with('Sleeping
|
294
|
-
expect(driver).to receive(:sleep).once.with(
|
295
|
-
expect(driver).to receive(:sleep).once.with(
|
292
|
+
expect(driver).to receive(:warn).once.with('Sleeping 5 seconds and retrying...')
|
293
|
+
expect(driver).to receive(:warn).once.with('Sleeping 10 seconds and retrying...')
|
294
|
+
expect(driver).to receive(:sleep).once.with(5)
|
295
|
+
expect(driver).to receive(:sleep).once.with(10)
|
296
296
|
expect(driver).not_to receive(:error)
|
297
297
|
expect(driver).not_to receive(:destroy)
|
298
298
|
expect { driver.wait_for_server(state, resource1) }.not_to raise_error
|
299
299
|
end
|
300
300
|
end
|
301
|
+
|
302
|
+
context 'when retries is 7, always erroring' do
|
303
|
+
let(:config) { { server_ready_retries: 8 } }
|
304
|
+
|
305
|
+
it 'caps the delays at 30 seconds' do
|
306
|
+
expect(connection).to receive(:wait_until_ready).exactly(9).times.and_raise(Timeout::Error)
|
307
|
+
expect(driver).to receive(:sleep).once.with(5)
|
308
|
+
expect(driver).to receive(:sleep).once.with(10)
|
309
|
+
expect(driver).to receive(:sleep).once.with(15)
|
310
|
+
expect(driver).to receive(:sleep).once.with(20)
|
311
|
+
expect(driver).to receive(:sleep).once.with(25)
|
312
|
+
expect(driver).to receive(:sleep).exactly(3).times.with(30)
|
313
|
+
expect { driver.wait_for_server(state, resource1) }.to raise_error(Timeout::Error)
|
314
|
+
end
|
315
|
+
end
|
301
316
|
end
|
302
317
|
|
303
318
|
describe '#destroy' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kitchen-vra
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chef Partner Engineering
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: test-kitchen
|
@@ -114,6 +114,20 @@ dependencies:
|
|
114
114
|
- - "~>"
|
115
115
|
- !ruby/object:Gem::Version
|
116
116
|
version: '1.21'
|
117
|
+
- !ruby/object:Gem::Dependency
|
118
|
+
name: rubocop
|
119
|
+
requirement: !ruby/object:Gem::Requirement
|
120
|
+
requirements:
|
121
|
+
- - "~>"
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: '0.35'
|
124
|
+
type: :development
|
125
|
+
prerelease: false
|
126
|
+
version_requirements: !ruby/object:Gem::Requirement
|
127
|
+
requirements:
|
128
|
+
- - "~>"
|
129
|
+
- !ruby/object:Gem::Version
|
130
|
+
version: '0.35'
|
117
131
|
description: A Test Kitchen driver for VMware vRealize Automation (vRA)
|
118
132
|
email:
|
119
133
|
- partnereng@chef.io
|
@@ -123,6 +137,7 @@ extra_rdoc_files: []
|
|
123
137
|
files:
|
124
138
|
- ".gitignore"
|
125
139
|
- ".rubocop.yml"
|
140
|
+
- ".travis.yml"
|
126
141
|
- CHANGELOG.md
|
127
142
|
- Gemfile
|
128
143
|
- LICENSE.txt
|