fog-google 1.15.0 → 1.16.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/.github/scripts/setup_creds.sh +10 -0
  3. data/.github/workflows/integration.yml +225 -0
  4. data/.github/workflows/stale.yml +1 -1
  5. data/.github/workflows/unit.yml +26 -0
  6. data/CHANGELOG.md +14 -0
  7. data/README.md +10 -9
  8. data/fog-google.gemspec +11 -2
  9. data/lib/fog/compute/google/models/address.rb +0 -0
  10. data/lib/fog/compute/google/models/addresses.rb +0 -0
  11. data/lib/fog/compute/google/models/network.rb +1 -1
  12. data/lib/fog/compute/google/models/region.rb +0 -0
  13. data/lib/fog/compute/google/models/regions.rb +0 -0
  14. data/lib/fog/compute/google/models/servers.rb +4 -1
  15. data/lib/fog/compute/google/models/subnetwork.rb +0 -0
  16. data/lib/fog/compute/google/requests/get_region.rb +0 -0
  17. data/lib/fog/compute/google/requests/insert_network.rb +1 -11
  18. data/lib/fog/google/version.rb +1 -1
  19. data/lib/fog/storage/google_json/models/file.rb +10 -1
  20. data/lib/fog/storage/google_json/models/files.rb +2 -2
  21. data/lib/fog/storage/google_json/real.rb +4 -4
  22. data/lib/fog/storage/google_json/requests/get_object_url.rb +2 -2
  23. data/test/helpers/integration_test_helper.rb +2 -2
  24. data/test/helpers/test_helper.rb +7 -3
  25. data/test/integration/compute/core_compute/test_servers.rb +2 -2
  26. data/test/integration/compute/core_networking/test_networks.rb +0 -11
  27. data/test/integration/factories/networks_factory.rb +4 -6
  28. metadata +97 -27
  29. data/.github/workflows/ruby.yml +0 -34
  30. data/ci/.gitignore +0 -1
  31. data/ci/README.md +0 -65
  32. data/ci/build-head-pipeline.yml +0 -173
  33. data/ci/credentials.yml.template +0 -28
  34. data/ci/docker-image/Dockerfile +0 -18
  35. data/ci/integration-pipeline.yml +0 -226
  36. data/ci/pipeline-dev.yml +0 -58
  37. data/ci/tasks/run-int.sh +0 -53
  38. data/ci/tasks/run-int.yml +0 -18
  39. data/ci/tasks/utils.sh +0 -10
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a6eea488c39dbca402a8a3a648ab1ebfbca31762c7b3f9d6828c3e2866b9e500
4
- data.tar.gz: ce03073c85ae8b82eb60c60f38e4ae400defd42964bf4eeb74e12dfc3f550732
3
+ metadata.gz: 3c2a96b4bd15024461fec8eef7f06eec40e0f3ea0ac38c4fe076a321f90af2d9
4
+ data.tar.gz: f05c9185882395140713d9ad79c10d6807c3e987ffac1e7b8b9852cf690671ab
5
5
  SHA512:
6
- metadata.gz: 1d53bdc28be406f9144ef15790f71dbece9444c44d06786ccf6a6aa35c7214bf5e5af28e26a45dbe7feef184c242c07cb90cc20dfadf869b79af6f9c330893a1
7
- data.tar.gz: 65a11e596a256e5d784ff63e0080615a5cfefc6d35628b77f131166ff00bc949858c96bed221ebef1860debe996bd7adf55cf0ffe2c3d4f065cd6f64d7bbf61c
6
+ metadata.gz: 2aab3e033028612e70daa467b0bd8f3701f3e4ffc5ced7c8a773d2d8766b3d100d0ec8f9d36d11d6b346241e4958c42d36c0a43bdcb32c6058aae296399439a3
7
+ data.tar.gz: 03b82d1bdeee36bbce9fcf9c73a001bd7364d8885e975ad323d71cab3d1cf0fbdace93cee9509edcdb2fc5e058bd604e6d7d8befaaea356943337f5d159e63de
@@ -0,0 +1,10 @@
1
+ #!/bin/bash
2
+
3
+ GOOGLE_PROJECT=$(curl "http://metadata.google.internal/computeMetadata/v1/project/project-id" -H "Metadata-Flavor: Google")
4
+
5
+ # fog needs the google project to be specified even if it uses application-default creds
6
+ cat >~/.fog <<EOL
7
+ test:
8
+ google_project: ${GOOGLE_PROJECT}
9
+ google_application_default: true
10
+ EOL
@@ -0,0 +1,225 @@
1
+ name: integration-tests
2
+
3
+ on:
4
+ push:
5
+ branches: [ master ]
6
+ pull_request:
7
+ branches: [ master ]
8
+ types: [ assigned, opened, synchronize, reopened, labeled ]
9
+
10
+ jobs:
11
+ test-compute-core:
12
+ runs-on: self-hosted
13
+ strategy:
14
+ matrix:
15
+ ruby-version: [ '2.7', '3.0' ]
16
+ # Integration tests from the same task cannot run in parallel yet due to cleanup
17
+ max-parallel: 1
18
+
19
+ steps:
20
+ - uses: actions/checkout@v2.3.4
21
+ - name: Set up Ruby
22
+ uses: ruby/setup-ruby@v1
23
+ env:
24
+ # Needs to be set up for self-hosted runners, see:
25
+ # https://github.com/ruby/setup-ruby#using-self-hosted-runners
26
+ # Image used in runners: summerwind/actions-runner
27
+ ImageOS: ubuntu20
28
+ with:
29
+ ruby-version: ${{ matrix.ruby-version }}
30
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
31
+ - name: Install dependencies
32
+ run: bundle install
33
+ - name: Run tests
34
+ run: >-
35
+ ./.github/scripts/setup_creds.sh &&
36
+ bundle exec rake test:compute-core_compute
37
+
38
+ test-compute-networking:
39
+ runs-on: self-hosted
40
+ strategy:
41
+ matrix:
42
+ ruby-version: [ '2.7', '3.0' ]
43
+ # Integration tests from the same task cannot run in parallel yet due to cleanup
44
+ max-parallel: 1
45
+
46
+ steps:
47
+ - uses: actions/checkout@v2.3.4
48
+ - name: Set up Ruby
49
+ uses: ruby/setup-ruby@v1
50
+ env:
51
+ # Needs to be set up for self-hosted runners, see:
52
+ # https://github.com/ruby/setup-ruby#using-self-hosted-runners
53
+ # Image used in runners: summerwind/actions-runner
54
+ ImageOS: ubuntu20
55
+ with:
56
+ ruby-version: ${{ matrix.ruby-version }}
57
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
58
+ - name: Install dependencies
59
+ run: bundle install
60
+ - name: Run tests
61
+ run: >-
62
+ ./.github/scripts/setup_creds.sh &&
63
+ bundle exec rake test:compute-core_networking
64
+
65
+ test-compute-instance_groups:
66
+ runs-on: self-hosted
67
+ strategy:
68
+ matrix:
69
+ ruby-version: [ '2.7', '3.0' ]
70
+ # Integration tests from the same task cannot run in parallel yet due to cleanup
71
+ max-parallel: 1
72
+
73
+ steps:
74
+ - uses: actions/checkout@v2.3.4
75
+ - name: Set up Ruby
76
+ uses: ruby/setup-ruby@v1
77
+ env:
78
+ # Needs to be set up for self-hosted runners, see:
79
+ # https://github.com/ruby/setup-ruby#using-self-hosted-runners
80
+ # Image used in runners: summerwind/actions-runner
81
+ ImageOS: ubuntu20
82
+ with:
83
+ ruby-version: ${{ matrix.ruby-version }}
84
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
85
+ - name: Install dependencies
86
+ run: bundle install
87
+ - name: Run tests
88
+ run: >-
89
+ ./.github/scripts/setup_creds.sh &&
90
+ bundle exec rake test:compute-instance_groups
91
+
92
+ test-compute-loadbalancing:
93
+ runs-on: self-hosted
94
+ strategy:
95
+ matrix:
96
+ ruby-version: [ '2.7', '3.0' ]
97
+ # Integration tests from the same task cannot run in parallel yet due to cleanup
98
+ max-parallel: 1
99
+
100
+ steps:
101
+ - uses: actions/checkout@v2.3.4
102
+ - name: Set up Ruby
103
+ uses: ruby/setup-ruby@v1
104
+ env:
105
+ # Needs to be set up for self-hosted runners, see:
106
+ # https://github.com/ruby/setup-ruby#using-self-hosted-runners
107
+ # Image used in runners: summerwind/actions-runner
108
+ ImageOS: ubuntu20
109
+ with:
110
+ ruby-version: ${{ matrix.ruby-version }}
111
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
112
+ - name: Install dependencies
113
+ run: bundle install
114
+ - name: Run tests
115
+ run: >-
116
+ ./.github/scripts/setup_creds.sh &&
117
+ bundle exec rake test:compute-loadbalancing
118
+
119
+ test-monitoring:
120
+ runs-on: self-hosted
121
+ strategy:
122
+ matrix:
123
+ ruby-version: [ '2.7', '3.0' ]
124
+ # Integration tests from the same task cannot run in parallel yet due to cleanup
125
+ max-parallel: 1
126
+
127
+ steps:
128
+ - uses: actions/checkout@v2.3.4
129
+ - name: Set up Ruby
130
+ uses: ruby/setup-ruby@v1
131
+ env:
132
+ # Needs to be set up for self-hosted runners, see:
133
+ # https://github.com/ruby/setup-ruby#using-self-hosted-runners
134
+ # Image used in runners: summerwind/actions-runner
135
+ ImageOS: ubuntu20
136
+ with:
137
+ ruby-version: ${{ matrix.ruby-version }}
138
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
139
+ - name: Install dependencies
140
+ run: bundle install
141
+ - name: Run tests
142
+ run: >-
143
+ ./.github/scripts/setup_creds.sh &&
144
+ bundle exec rake test:monitoring
145
+
146
+ test-storage:
147
+ runs-on: self-hosted
148
+ strategy:
149
+ matrix:
150
+ ruby-version: [ '2.7', '3.0' ]
151
+ # Integration tests from the same task cannot run in parallel yet due to cleanup
152
+ max-parallel: 1
153
+
154
+ steps:
155
+ - uses: actions/checkout@v2.3.4
156
+ - name: Set up Ruby
157
+ uses: ruby/setup-ruby@v1
158
+ env:
159
+ # Needs to be set up for self-hosted runners, see:
160
+ # https://github.com/ruby/setup-ruby#using-self-hosted-runners
161
+ # Image used in runners: summerwind/actions-runner
162
+ ImageOS: ubuntu20
163
+ with:
164
+ ruby-version: ${{ matrix.ruby-version }}
165
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
166
+ - name: Install dependencies
167
+ run: bundle install
168
+ - name: Run tests
169
+ run: >-
170
+ ./.github/scripts/setup_creds.sh &&
171
+ bundle exec rake test:storage
172
+
173
+ test-pubsub:
174
+ runs-on: self-hosted
175
+ strategy:
176
+ matrix:
177
+ ruby-version: [ '2.7', '3.0' ]
178
+ # Integration tests from the same task cannot run in parallel yet due to cleanup
179
+ max-parallel: 1
180
+
181
+ steps:
182
+ - uses: actions/checkout@v2.3.4
183
+ - name: Set up Ruby
184
+ uses: ruby/setup-ruby@v1
185
+ env:
186
+ # Needs to be set up for self-hosted runners, see:
187
+ # https://github.com/ruby/setup-ruby#using-self-hosted-runners
188
+ # Image used in runners: summerwind/actions-runner
189
+ ImageOS: ubuntu20
190
+ with:
191
+ ruby-version: ${{ matrix.ruby-version }}
192
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
193
+ - name: Install dependencies
194
+ run: bundle install
195
+ - name: Run tests
196
+ run: >-
197
+ ./.github/scripts/setup_creds.sh &&
198
+ bundle exec rake test:pubsub
199
+
200
+ test-sql:
201
+ runs-on: self-hosted
202
+ strategy:
203
+ matrix:
204
+ ruby-version: [ '2.7', '3.0' ]
205
+ # Integration tests from the same task cannot run in parallel yet due to cleanup
206
+ max-parallel: 1
207
+
208
+ steps:
209
+ - uses: actions/checkout@v2.3.4
210
+ - name: Set up Ruby
211
+ uses: ruby/setup-ruby@v1
212
+ env:
213
+ # Needs to be set up for self-hosted runners, see:
214
+ # https://github.com/ruby/setup-ruby#using-self-hosted-runners
215
+ # Image used in runners: summerwind/actions-runner
216
+ ImageOS: ubuntu20
217
+ with:
218
+ ruby-version: ${{ matrix.ruby-version }}
219
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
220
+ - name: Install dependencies
221
+ run: bundle install
222
+ - name: Run tests
223
+ run: >-
224
+ ./.github/scripts/setup_creds.sh &&
225
+ bundle exec rake test:sql
@@ -10,7 +10,7 @@ jobs:
10
10
  runs-on: ubuntu-latest
11
11
 
12
12
  steps:
13
- - uses: actions/stale@v3.0.18
13
+ - uses: actions/stale@v4
14
14
  with:
15
15
  repo-token: ${{ secrets.GITHUB_TOKEN }}
16
16
  days-before-stale: 60
@@ -0,0 +1,26 @@
1
+ name: unit-tests
2
+
3
+ on:
4
+ push:
5
+ branches: [ master ]
6
+ pull_request:
7
+ branches: [ master ]
8
+
9
+ jobs:
10
+ test-unit:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ matrix:
14
+ ruby-version: ['2.5', '2.6', '2.7', '3.0', 'head', 'truffleruby-head']
15
+
16
+ steps:
17
+ - uses: actions/checkout@v2.3.4
18
+ - name: Set up Ruby
19
+ uses: ruby/setup-ruby@v1
20
+ with:
21
+ ruby-version: ${{ matrix.ruby-version }}
22
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
23
+ - name: Install dependencies
24
+ run: bundle install
25
+ - name: Run tests
26
+ run: bundle exec rake
data/CHANGELOG.md CHANGED
@@ -6,6 +6,20 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html
6
6
 
7
7
  ## Next
8
8
 
9
+ ## 1.16.0
10
+
11
+ ### User-facing
12
+
13
+ #### Fixed
14
+
15
+ - \#540 Bring back integration tests for Fog-Google and fix an array of small bugs/regressions [temikus]
16
+
17
+ ### Development changes
18
+
19
+ #### Added
20
+
21
+ - \#532 Add Truffleruby head to CI [gogainda]
22
+
9
23
  ## 1.15.0
10
24
 
11
25
  ### User-facing
data/README.md CHANGED
@@ -1,12 +1,3 @@
1
- # ⚠️ ATTENTION ⚠️ HELP NEEDED WITH CI
2
-
3
- With both me and icco@ departing Google **fog-google no longer has a CI stack** as we don't have access to a sponsored GCP account anymore and I've been unsuccessful in finding someone who would volunteer to maintain this project or CI at the time of my departure.
4
-
5
- There is no easy way to say this but we need help as costs of running a CI stack that touches almost all GCP resources is significant. We know there's a lot of companies out there that are using this lib, as well as tooling based on it so if you want to help us with running a CI stack or provide sponsorship for a GCP account - please contact me at code \<at\> temik.me
6
-
7
- --
8
- Artem (temikus@) - Lead maintainer
9
-
10
1
  # Fog::Google
11
2
 
12
3
  [![Gem Version](https://badge.fury.io/rb/fog-google.svg)](http://badge.fury.io/rb/fog-google) [![Build Status](https://github.com/fog/fog-google/actions/workflows/ruby.yml/badge.svg)](https://github.com/fog/fog-google/actions/workflows/ruby.yml) [![codecov](https://codecov.io/gh/fog/fog-google/branch/master/graph/badge.svg)](https://codecov.io/gh/fog/fog-google) [![Dependabot Status](https://api.dependabot.com/badges/status?host=github&repo=fog/fog-google)](https://dependabot.com) [![Doc coverage](https://inch-ci.org/github/fog/fog-google.svg?branch=master)](https://inch-ci.org/github/fog/fog-google)
@@ -21,6 +12,16 @@ The main maintainers for the Google sections are @icco, @Temikus and @plribeiro3
21
12
 
22
13
  See **[MIGRATING.md](MIGRATING.md)** for migration between major versions.
23
14
 
15
+ # Sponsors
16
+
17
+ We're proud to be sponsored by MeisterLabs who are generously funding our CI stack. A small message from them:
18
+
19
+ <img align="right" width=100 height=100 src="https://user-images.githubusercontent.com/2083229/125146917-d965a680-e16b-11eb-8ad2-611b39056ca2.png">
20
+
21
+ *"As extensive users of fog-google we are excited to help! Meister is the company behind the productivity tools [MindMeister](https://www.mindmeister.com/), [MeisterTask](https://www.meistertask.com), and [MeisterNote](https://www.meisternote.com/). We are based in Vienna, Austria and we have a very talented international team who build our products on top of Ruby on Rails, Elixir, React and Redux. We are constantly looking for great talent in Engineering, so If you feel like taking on a new Ruby or Elixir challenge. get in touch, open jobs can be found [here](https://www.meisterlabs.com/jobs/)."*
22
+
23
+ # Usage
24
+
24
25
  ## Storage
25
26
 
26
27
  There are two ways to access [Google Cloud Storage](https://cloud.google.com/storage/). The old S3 API and the new JSON API. `Fog::Storage::Google` will automatically direct you to the appropriate API based on the credentials you provide it.
data/fog-google.gemspec CHANGED
@@ -25,11 +25,20 @@ Gem::Specification.new do |spec|
25
25
  spec.add_dependency "fog-json", "~> 1.2"
26
26
  spec.add_dependency "fog-xml", "~> 0.1.0"
27
27
 
28
- spec.add_dependency "google-api-client", ">= 0.44.2", "< 0.51"
28
+ spec.add_dependency "google-apis-storage_v1", "~> 0.6"
29
+ spec.add_dependency "google-apis-iamcredentials_v1", "~> 0.6"
30
+ spec.add_dependency "google-apis-compute_v1", "~> 0.14"
31
+ spec.add_dependency "google-apis-monitoring_v3", "~> 0.12"
32
+ spec.add_dependency "google-apis-dns_v1", "~> 0.12"
33
+ spec.add_dependency "google-apis-pubsub_v1", "~> 0.7"
34
+ spec.add_dependency "google-apis-sqladmin_v1beta4", "~> 0.13"
35
+
29
36
  spec.add_dependency "google-cloud-env", "~> 1.2"
30
37
 
31
38
  # Debugger
32
- spec.add_development_dependency "pry"
39
+ # Locked because pry-byebug is broken with 13+
40
+ # see: https://github.com/deivid-rodriguez/pry-byebug/issues/343
41
+ spec.add_development_dependency "pry", "= 0.13.0"
33
42
 
34
43
  # Testing gems
35
44
  spec.add_development_dependency "retriable"
File without changes
File without changes
@@ -27,7 +27,7 @@ module Fog
27
27
  alias_method :ipv4_range, :i_pv4_range
28
28
 
29
29
  def save
30
- requires :identity, :ipv4_range
30
+ requires :identity
31
31
 
32
32
  data = service.insert_network(identity, attributes)
33
33
  operation = Fog::Compute::Google::Operations.new(:service => service)
File without changes
File without changes
@@ -84,7 +84,10 @@ module Fog
84
84
  server.wait_for { ready? }
85
85
 
86
86
  # Set the disk to be autodeleted
87
- server.set_disk_auto_delete(true)
87
+ # true - autodelete setting
88
+ # nil - device name (not needed if there's only one disk)
89
+ # false - set async to false so set the property synchronously
90
+ server.set_disk_auto_delete(true, nil, false)
88
91
 
89
92
  server
90
93
  end
File without changes
File without changes
@@ -10,18 +10,8 @@ module Fog
10
10
  end
11
11
 
12
12
  class Real
13
- INSERTABLE_NETWORK_FIELDS = %i{
14
- auto_create_subnetworks
15
- description
16
- gateway_i_pv4
17
- i_pv4_range
18
- name
19
- routing_config
20
- }.freeze
21
-
22
13
  def insert_network(network_name, opts = {})
23
- opts = opts.select { |k, _| INSERTABLE_NETWORK_FIELDS.include? k }
24
- .merge(:name => network_name)
14
+ opts = opts.merge(:name => network_name)
25
15
 
26
16
  @compute.insert_network(
27
17
  @project,
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module Google
3
- VERSION = "1.15.0".freeze
3
+ VERSION = "1.16.0".freeze
4
4
  end
5
5
  end
@@ -45,7 +45,16 @@ module Fog
45
45
  end
46
46
 
47
47
  def body
48
- last_modified && (file = collection.get(identity)) ? attributes[:body] ||= file.body : attributes[:body] ||= ""
48
+ return attributes[:body] if attributes.key?(:body)
49
+
50
+ file = collection.get(identity)
51
+
52
+ attributes[:body] =
53
+ if file
54
+ file.attributes[:body]
55
+ else
56
+ ""
57
+ end
49
58
  end
50
59
 
51
60
  def body=(new_body)
@@ -42,12 +42,12 @@ module Fog
42
42
 
43
43
  def get_https_url(key, expires, options = {})
44
44
  requires :directory
45
- service.get_object_https_url(directory.key, key, expires, options)
45
+ service.get_object_https_url(directory.key, key, expires, **options)
46
46
  end
47
47
 
48
48
  def metadata(key, options = {})
49
49
  requires :directory
50
- data = service.get_object_metadata(directory.key, key, options).to_h
50
+ data = service.get_object_metadata(directory.key, key, **options).to_h
51
51
  new(data)
52
52
  rescue ::Google::Apis::ClientError
53
53
  nil
@@ -156,12 +156,12 @@ DATA
156
156
  # See https://cloud.google.com/storage/docs/access-control/signed-urls-v2
157
157
  # @return [String] Signature binary blob
158
158
  def iam_signer(string_to_sign)
159
- request = {
160
- "payload": string_to_sign
161
- }
159
+ request = ::Google::Apis::IamcredentialsV1::SignBlobRequest.new(
160
+ payload: string_to_sign
161
+ )
162
162
 
163
163
  resource = "projects/-/serviceAccounts/#{google_access_id}"
164
- response = @iam_service.sign_service_account_blob resource, request, {}
164
+ response = @iam_service.sign_service_account_blob(resource, request)
165
165
 
166
166
  return response.signed_blob
167
167
  end
@@ -6,14 +6,14 @@ module Fog
6
6
  # Deprecated, redirects to get_object_https_url.rb
7
7
  def get_object_url(bucket_name, object_name, expires, options = {})
8
8
  Fog::Logger.deprecation("Fog::Storage::Google => #get_object_url is deprecated, use #get_object_https_url instead[/] [light_black](#{caller(0..0)})")
9
- get_object_https_url(bucket_name, object_name, expires, options)
9
+ get_object_https_url(bucket_name, object_name, expires, **options)
10
10
  end
11
11
  end
12
12
 
13
13
  class Mock # :nodoc:all
14
14
  def get_object_url(bucket_name, object_name, expires, options = {})
15
15
  Fog::Logger.deprecation("Fog::Storage::Google => #get_object_url is deprecated, use #get_object_https_url instead[/] [light_black](#{caller(0..0)})")
16
- get_object_https_url(bucket_name, object_name, expires, options)
16
+ get_object_https_url(bucket_name, object_name, expires, **options)
17
17
  end
18
18
  end
19
19
  end
@@ -22,8 +22,8 @@ TEST_IMAGE_PROJECT = "debian-cloud".freeze
22
22
  TEST_IMAGE_FAMILY = "debian-9".freeze
23
23
 
24
24
  # XXX This depends on a public image in gs://fog-test-bucket; there may be a better way to do this
25
- # The image was created like so: https://cloud.google.com/compute/docs/images#export_an_image_to_google_cloud_storage
26
- TEST_RAW_DISK_SOURCE = "https://storage.googleapis.com/fog-testing-bucket/fog-test-raw-disk-source.image.tar.gz".freeze
25
+ # The image was created like so: https://cloud.google.com/compute/docs/images/export-image
26
+ TEST_RAW_DISK_SOURCE = "https://storage.googleapis.com/fog-test-assets-bucket/fog-test-raw-disk-source.image.tar.gz".freeze
27
27
 
28
28
  TEST_SQL_TIER = "db-n1-standard-1".freeze
29
29
  TEST_SQL_REGION = TEST_REGION
@@ -17,8 +17,12 @@ end
17
17
  # See https://github.com/seattlerb/minitest/#install
18
18
  gem "minitest"
19
19
  require "minitest/autorun"
20
- # Custom formatters
21
- require "minitest/reporters"
22
- Minitest::Reporters.use! Minitest::Reporters::SpecReporter.new
20
+
21
+ # This is a workaround for RubyMine debugger that doesn't play nice with Minitest::Reporters
22
+ unless ENV['RM_INFO']
23
+ # Custom formatters to make the tests more legible in CI
24
+ require "minitest/reporters"
25
+ Minitest::Reporters.use! Minitest::Reporters::SpecReporter.new
26
+ end
23
27
 
24
28
  require File.join(File.dirname(__FILE__), "../../lib/fog/google")
@@ -135,8 +135,8 @@ class TestServers < FogIntegrationTest
135
135
  def test_reset_windows_password
136
136
  win_disk = @disks.create(
137
137
  :name => "fog-test-1-testservers-test-reset-windows-password-2",
138
- :source_image => "windows-server-1909-dc-core-v20200310",
139
- :size_gb => 32
138
+ :source_image => "windows-server-2019-dc-v20210713",
139
+ :size_gb => 64
140
140
  )
141
141
  server = @factory.create(:disks => [win_disk])
142
142
  server.wait_for { ready? }
@@ -17,17 +17,6 @@ class TestNetworks < FogIntegrationTest
17
17
  super
18
18
  end
19
19
 
20
- def test_valid_range
21
- network = @factory.create
22
-
23
- octet = /\d{,2}|1\d{2}|2[0-4]\d|25[0-5]/
24
- netmask = /(\d{1}|1[0-9]|2[0-9]|3[0-2])/
25
- re = /\A#{octet}\.#{octet}\.#{octet}\.#{octet}\/#{netmask}\z/
26
-
27
- assert_match(re, network.ipv4_range,
28
- "Network range should be valid")
29
- end
30
-
31
20
  def test_run_instance
32
21
  network = @factory.create
33
22
  server = @servers.create(:network_interfaces => [network.get_as_interface_config])
@@ -2,15 +2,13 @@ require "integration/factories/collection_factory"
2
2
 
3
3
  class NetworksFactory < CollectionFactory
4
4
  def initialize(example)
5
- # We cannot have 2 networks with the same IP range so instantiating a
6
- # class variable holding a generator, ensuring that the factory gives
7
- # us a new network every time it's called
8
- @octet_generator = (0..255).each
9
5
  super(Fog::Compute[:google].networks, example)
10
6
  end
11
7
 
12
8
  def params
13
- { :name => resource_name,
14
- :ipv4_range => "172.16.#{@octet_generator.next}.0/24" }
9
+ {
10
+ :name => resource_name,
11
+ :auto_create_subnetworks => true
12
+ }
15
13
  end
16
14
  end