vagrant-cucumber 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 57634e161f698537816146c12edbec81975b6fbe
4
- data.tar.gz: 142c2e58f896134d3d9b1fbacee8e1d21ef299cd
3
+ metadata.gz: 0de77638a2311e90762aa7c72ea61e552383a47f
4
+ data.tar.gz: 4aa80e3e8498aee3d964e663de85a66f96410a56
5
5
  SHA512:
6
- metadata.gz: 1abfea63a425e331044613e5d3057a83acfad59989bbdbf41e4a42fd82be97f64b5eadd71206cbcd8c26947ec4b6e7c5ab54ca59b8988033075db95aaf338795
7
- data.tar.gz: 648f16d2dec025ef169e97843cc6929c9fd12b04e32c555485293c90b2479ee4c992bd325eb1ff4f725393cab85ddb5acfcb0a3ab816aad2812acbf1f9305b03
6
+ metadata.gz: bda45949dc846751a038e3ebb1257923c56856eb2e413146d20befcd1183df4816d9f6baa60be3ad0df1759f5bde58e2276061a1dceb158e551e144c07cb0598
7
+ data.tar.gz: 18ad2b90f094c62dcded36006315ec82f749e12fab9777c73c62ff6e79820bc15a29a5c7679f98d25567b4490b57dff53b92c45afa76755afa2b598374fed656
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.1.1 (26 July, 2016)
2
+
3
+ * Retry snapshot operations on lock failure.
4
+
1
5
  ## 0.1.0 (21 July, 2016)
2
6
 
3
7
  * Removed `vagrant-multiprovider-snap` dependency. Vagrant now has all
@@ -1,25 +1,39 @@
1
1
  require 'to_regexp'
2
2
 
3
+ def push_snapshot(vmname)
4
+ vagrant_glue.vagrant_env.cli('snapshot', 'push', vmname)
5
+ rescue Vagrant::Errors::EnvironmentLockedError
6
+ sleep 0.2
7
+ retry
8
+ end
9
+
10
+ def pop_snapshot(vmname = nil)
11
+ args = [
12
+ 'snapshot',
13
+ 'pop',
14
+ '--no-provision',
15
+ '--no-delete',
16
+ ]
17
+ args << vmname unless vmname.nil?
18
+
19
+ vagrant_glue.vagrant_env.cli(*args)
20
+ rescue Vagrant::Errors::EnvironmentLockedError
21
+ sleep 0.2
22
+ retry
23
+ end
24
+
3
25
  Given /^there is a running VM called "([^"]*)"$/ do |vmname|
4
26
  machine = vagrant_glue.get_vm(vmname)
5
27
 
6
28
  machine.action(:up)
7
29
 
8
- if machine.provider.capability(:snapshot_list).empty?
9
- vagrant_glue.vagrant_env.cli('snapshot', 'push', vmname)
10
- end
30
+ push_snapshot(vmname) if machine.provider.capability(:snapshot_list).empty?
11
31
  end
12
32
 
13
33
  When /^I roll back the VM called "([^"]*)"$/ do |vmname|
14
34
  machine = vagrant_glue.get_vm(vmname)
15
35
 
16
- vagrant_glue.vagrant_env.cli(
17
- 'snapshot',
18
- 'pop',
19
- '--no-provision',
20
- '--no-delete',
21
- vmname,
22
- )
36
+ pop_snapshot(vmname)
23
37
  end
24
38
 
25
39
  Then /^(?:running|I run) the shell command `(.*)`(| as root)(#{VMRE})(?:|, it) should (succeed|fail)$/ do |command, as_root, vmre, condition|
@@ -82,12 +96,7 @@ end
82
96
 
83
97
  After('~@norollback') do |_scenario|
84
98
  puts 'Rolling back VM states'
85
- vagrant_glue.vagrant_env.cli(
86
- 'snapshot',
87
- 'pop',
88
- '--no-provision',
89
- '--no-delete',
90
- )
99
+ pop_snapshot
91
100
  end
92
101
 
93
102
  After('@norollback') do |_scenario|
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module Cucumber
3
- VERSION = '0.1.0'
3
+ VERSION = '0.1.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-cucumber
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Topper
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-22 00:00:00.000000000 Z
11
+ date: 2016-07-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cucumber