fog-google 0.0.6 → 0.0.7
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0511793f96bfb19f9b6aeb03d9255aa75e9e80bc
|
4
|
+
data.tar.gz: 11cad15a2d43d83bf7610a46868ecadba74035b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8dbfd29a46fadd9e640e0e9cca7c8bda8c7e213ada72badfff8f2e7f55ae3e25382efa6213590461745060d8918997fa8ec52128583a4c3cc950aff5236bd02f
|
7
|
+
data.tar.gz: 15b829e415184704289d27260d23472cc1a73907ac0afbb8cab6cc568a5042a92d80b3a77dfa2bc8848096b02819d42e289581ab4affcb01593a5730e5361e86
|
data/CONTRIBUTING.md
CHANGED
@@ -74,6 +74,16 @@ or just one:
|
|
74
74
|
$ rake test TEST=test/integration/compute/test_servers.rb TESTOPTS="--name=TestServers#test_bootstrap_ssh_destroy"
|
75
75
|
```
|
76
76
|
|
77
|
+
#### The transition from `shindo` to Minitest
|
78
|
+
|
79
|
+
Previously, [shindo](https://github.com/geemus/shindo) was the primary testing framework. We've started moving away from it, and to Minitest, but some artifacts remain.
|
80
|
+
|
81
|
+
- The `test` directory contains the new Minitest tests, which currently only cover live integration testing for `compute`.
|
82
|
+
- The `tests` directory contains the old `shindo` tests, which generally pass if mocking is turned on. No promises if mocking is off.
|
83
|
+
- Travis CI runs the mocked `shindo` tests, though hopefully in the long run it will run the unit and integration `Minitest` tests. Currently, Google maintains its own Jenkins instance that runs the Minitest integraiton tests.
|
84
|
+
|
85
|
+
Follow [#50](https://github.com/fog/fog-google/issues/50) for the status of the transition from `shindo` to Minitest.
|
86
|
+
|
77
87
|
#### Some notes about the tests as they stand
|
78
88
|
|
79
89
|
The live integration tests for resources, (servers, disks, etc.,) have a few components:
|
@@ -30,6 +30,7 @@ module Fog
|
|
30
30
|
attribute :external_ip, :aliases => 'externalIP'
|
31
31
|
attribute :auto_restart
|
32
32
|
attribute :on_host_maintenance
|
33
|
+
attribute :preemptible
|
33
34
|
|
34
35
|
# Security account scope aliases used by official gcloud utility
|
35
36
|
# List derived from 'gcloud compute instances create --help'
|
@@ -172,10 +173,10 @@ module Fog
|
|
172
173
|
Fog::Compute::Google::Operations.new(:service => service).get(data.body['name'], data.body['zone'])
|
173
174
|
end
|
174
175
|
|
175
|
-
def set_scheduling(on_host_maintenance, automatic_restart)
|
176
|
+
def set_scheduling(on_host_maintenance, automatic_restart, preemptible)
|
176
177
|
requires :identity, :zone
|
177
178
|
|
178
|
-
data = service.set_server_scheduling(identity, zone_name, on_host_maintenance, automatic_restart)
|
179
|
+
data = service.set_server_scheduling(identity, zone_name, on_host_maintenance, automatic_restart, preemptible)
|
179
180
|
Fog::Compute::Google::Operations.new(:service => service).get(data.body['name'], data.body['zone'])
|
180
181
|
end
|
181
182
|
|
@@ -270,6 +271,7 @@ module Fog
|
|
270
271
|
'tags' => tags,
|
271
272
|
'auto_restart' => auto_restart,
|
272
273
|
'on_host_maintenance' => on_host_maintenance,
|
274
|
+
'preemptible' => preemptible,
|
273
275
|
'can_ip_forward' => can_ip_forward
|
274
276
|
}.delete_if {|key, value| value.nil?}
|
275
277
|
|
@@ -151,12 +151,17 @@ module Fog
|
|
151
151
|
|
152
152
|
scheduling = {
|
153
153
|
'automaticRestart' => false,
|
154
|
-
'onHostMaintenance' => "MIGRATE"
|
154
|
+
'onHostMaintenance' => "MIGRATE",
|
155
|
+
'preemptible' => false
|
155
156
|
}
|
156
157
|
if options.key? 'auto_restart'
|
157
158
|
scheduling['automaticRestart'] = options.delete 'auto_restart'
|
158
159
|
scheduling['automaticRestart'] = scheduling['automaticRestart'].class == TrueClass
|
159
160
|
end
|
161
|
+
if options.key? 'preemptible'
|
162
|
+
scheduling['preemptible'] = options.delete 'preemptible'
|
163
|
+
scheduling['preemptible'] = scheduling['preemptible'].class == TrueClass
|
164
|
+
end
|
160
165
|
if options.key? 'on_host_maintenance'
|
161
166
|
ohm = options.delete 'on_host_maintenance'
|
162
167
|
scheduling['onHostMaintenance'] = (ohm.respond_to?("upcase") &&
|
@@ -2,13 +2,13 @@ module Fog
|
|
2
2
|
module Compute
|
3
3
|
class Google
|
4
4
|
class Mock
|
5
|
-
def set_server_scheduling(identity, zone, on_host_maintenance, automatic_restart)
|
5
|
+
def set_server_scheduling(identity, zone, on_host_maintenance, automatic_restart, preemptible)
|
6
6
|
Fog::Mock.not_implemented
|
7
7
|
end
|
8
8
|
end
|
9
9
|
|
10
10
|
class Real
|
11
|
-
def set_server_scheduling(identity, zone, on_host_maintenance, automatic_restart)
|
11
|
+
def set_server_scheduling(identity, zone, on_host_maintenance, automatic_restart, preemptible)
|
12
12
|
api_method = @compute.instances.set_scheduling
|
13
13
|
parameters = {
|
14
14
|
'project' => @project,
|
@@ -19,6 +19,7 @@ module Fog
|
|
19
19
|
body_object = {
|
20
20
|
'onHostMaintenance' => on_host_maintenance,
|
21
21
|
'automaticRestart' => automatic_restart,
|
22
|
+
'preemptible' => preemptible
|
22
23
|
}
|
23
24
|
|
24
25
|
request(api_method, parameters, body_object)
|
data/lib/fog/google/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fog-google
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nat Welch
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2015-06
|
13
|
+
date: 2015-07-06 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: fog-core
|