kitchen-localhost 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.kitchen.yml +5 -5
- data/.travis.yml +1 -1
- data/CHANGELOG.md +5 -0
- data/README.md +4 -0
- data/kitchen-localhost.gemspec +1 -1
- data/lib/kitchen/driver/localhost.rb +30 -1
- data/lib/kitchen/localhost/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34a54cce816185c98766b75a8b87fbd38677418f
|
4
|
+
data.tar.gz: b02ef1f249dc4107d3d589940995a56bce2df255
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b2a53692d0a32a238e7a05bc3e4cbe45033a5e74b8d8703054309a93a0b78299b6da601b4f64d60cc93c8e788a2562f8fbad2cb859a775a919b8e103bf5bcb01
|
7
|
+
data.tar.gz: ba7c44f78e10903888be572d4fc1f4a3032974263d299d31a7baaf70ae2f613c0700ca77625baa6c6df8ac082c08d4ab34c0398b6c6be4ff451319b400070a78
|
data/.kitchen.yml
CHANGED
@@ -9,9 +9,9 @@ platforms:
|
|
9
9
|
- name: localhost
|
10
10
|
|
11
11
|
suites:
|
12
|
-
- name:
|
12
|
+
- name: create_file
|
13
13
|
run_list:
|
14
|
-
- recipe[kitchen-localhost-test]
|
15
|
-
|
16
|
-
|
17
|
-
|
14
|
+
- recipe[kitchen-localhost-test::create_file]
|
15
|
+
- name: delete_file
|
16
|
+
run_list:
|
17
|
+
- recipe[kitchen-localhost-test::delete_file]
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
Kitchen-Localhost CHANGELOG
|
2
2
|
===========================
|
3
3
|
|
4
|
+
v0.2.0 (2015-05-31)
|
5
|
+
-------------------
|
6
|
+
* Try to catch instances where Kitchen is running in concurrency mode and force
|
7
|
+
instances of this driver to run serially.
|
8
|
+
|
4
9
|
v0.1.1 (2015-04-29)
|
5
10
|
-------------------
|
6
11
|
* Bump Kitchen dependency to the final 1.4 release
|
data/README.md
CHANGED
@@ -29,6 +29,10 @@ understanding that this driver will be running against _your local machine_. If
|
|
29
29
|
you write a cookbook that formats a hard drive and run it with this driver, bad
|
30
30
|
things will happen.
|
31
31
|
|
32
|
+
Also note that this driver's very nature makes it likely there will be problems
|
33
|
+
if you try to do a Test Kitchen run with multiple suites and/or with
|
34
|
+
concurrency enabled.
|
35
|
+
|
32
36
|
Installation and Setup
|
33
37
|
----------------------
|
34
38
|
|
data/kitchen-localhost.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.authors = ['Jonathan Hartman']
|
11
11
|
spec.email = %w(j@p4nt5.com)
|
12
12
|
spec.description = 'A Test Kitchen Driver for localhost'
|
13
|
-
spec.summary = 'Use Test Kitchen
|
13
|
+
spec.summary = 'Use Test Kitchen on your local machine!'
|
14
14
|
spec.homepage = 'https://github.com/test-kitchen/kitchen-localhost'
|
15
15
|
spec.license = 'Apache 2.0'
|
16
16
|
|
@@ -31,14 +31,42 @@ module Kitchen
|
|
31
31
|
# @author Jonathan Hartman <j@p4nt5.com>
|
32
32
|
class Localhost < Kitchen::Driver::Base
|
33
33
|
kitchen_driver_api_version 2
|
34
|
-
|
35
34
|
plugin_version Kitchen::Localhost::VERSION
|
36
35
|
|
36
|
+
#
|
37
|
+
# Define a Mutex at the class level so we can prevent instances using
|
38
|
+
# this driver from colliding.
|
39
|
+
#
|
40
|
+
# @return [Mutex]
|
41
|
+
#
|
42
|
+
def self.lock
|
43
|
+
@lock ||= Mutex.new
|
44
|
+
end
|
45
|
+
|
46
|
+
#
|
47
|
+
# Lock the class-level Mutex, whatever state it's in currently.
|
48
|
+
#
|
49
|
+
def self.lock!
|
50
|
+
lock.lock
|
51
|
+
end
|
52
|
+
|
53
|
+
#
|
54
|
+
# Unlock the class-level Mutex, whatever state it's in currently.
|
55
|
+
#
|
56
|
+
def self.unlock!
|
57
|
+
# Mutex#unlock raises an exception if lock is owned by another thread
|
58
|
+
# and Mutex#owned? isn't available in Ruby 1.9.
|
59
|
+
lock.unlock if lock.locked?
|
60
|
+
rescue ThreadError
|
61
|
+
nil
|
62
|
+
end
|
63
|
+
|
37
64
|
#
|
38
65
|
# Create the temp dirs on the local filesystem for Kitchen.
|
39
66
|
#
|
40
67
|
# (see Base#create)
|
41
68
|
def create(state)
|
69
|
+
self.class.lock!
|
42
70
|
state[:hostname] = Socket.gethostname
|
43
71
|
logger.info("[Localhost] Instance #{instance} ready.")
|
44
72
|
end
|
@@ -56,6 +84,7 @@ module Kitchen
|
|
56
84
|
FileUtils.rm_rf(p)
|
57
85
|
logger.info("[Localhost] Deleted temp dir '#{p}'.")
|
58
86
|
end
|
87
|
+
self.class.unlock!
|
59
88
|
end
|
60
89
|
end
|
61
90
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kitchen-localhost
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Hartman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-06-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: test-kitchen
|
@@ -210,6 +210,6 @@ rubyforge_project:
|
|
210
210
|
rubygems_version: 2.4.6
|
211
211
|
signing_key:
|
212
212
|
specification_version: 4
|
213
|
-
summary: Use Test Kitchen
|
213
|
+
summary: Use Test Kitchen on your local machine!
|
214
214
|
test_files: []
|
215
215
|
has_rdoc:
|