Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support fog-core 2.5 and up #636

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Conversation

stanhu
Copy link
Contributor

@stanhu stanhu commented Mar 19, 2025

fog-core v2.2 and up now requires Fog::Google:<service> instead of Fog::<service>::Google: fog/fog-core#241

This pull request eliminates these deprecation warnings:

[fog][DEPRECATION] Unable to require fog/google/storage
[fog][DEPRECATION] Falling back to deprecated path fog/storage/google. The preferred file path format has changed from service/provider to provider/service. Please update this service provider to use the preferred format.
[fog][DEPRECATION] Unable to load Fog::Google::Storage
[fog][DEPRECATION] Falling back to deprecated constant Fog::Storage::Google. The preferred format of service provider constants has changed from service::provider to provider::service. Please update this service provider to use the preferred format.

This fixes #421.

stanhu and others added 6 commits March 19, 2025 10:26
This is needed to support fog-core 2.2 and up due to this change:
fog/fog-core#241
This is needed to support fog-core 2.2 and up due to this change:
fog/fog-core#241
This is needed to support fog-core 2.2 and up due to this change:
fog/fog-core#241
This lines up more with Ruby best practices for module and class
locations.
@stanhu
Copy link
Contributor Author

stanhu commented Mar 19, 2025

@Temikus I first ran the storage integration tests:

$ bundle exec rake test:storage

/home/stanhu/.local/share/mise/installs/ruby/3.3.7/bin/ruby -I"lib:test" /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/rake_test_loader.rb "test/integration/storage/test_buckets.rb" "test/integration/storage/test_coverage.rb" "test/integration/storage/test_directories.rb" "test/integration/storage/test_files.rb" "test/integration/storage/test_objects.rb"
Started with run options --seed 58113

TestStorageRequests
  test_list_object_acl                                            PASS (2.61s)
  test_put_bucket                                                 PASS (0.86s)
  test_files_public_url                                           PASS (1.28s)
  test_get_object                                                 PASS (1.38s)
  test_files_all                                                  PASS (2.77s)
  test_delete_object                                              PASS (1.50s)
  test_put_object_paperclip                                       PASS (1.08s)
  test_put_object_invalid_predefined_acl                          PASS (1.05s)
  test_files_set_body_string                                      PASS (1.71s)
  test_files_destroy                                              PASS (1.66s)
  test_files_get_https_url                                        PASS (0.78s)
  test_files_create_file                                          PASS (1.45s)
  test_object_metadata                                            PASS (2.69s)
  test_directories_destroy                                        PASS (2.76s)
  test_copy_object_with_object_property                           PASS (1.56s)
  test_files_copy                                                 PASS (1.74s)
  test_put_object_string                                          PASS (1.26s)
  test_files_create_string                                        PASS (1.57s)
  test_put_object_file                                            PASS (1.23s)
  test_get_object_https_url                                       PASS (1.32s)
  test_put_bucket_invalid_predefined_acl                          PASS (0.06s)
  test_files_each                                                 PASS (2.26s)
  test_put_object_nil                                             PASS (0.86s)
  test_directory_files                                            PASS (1.21s)
  test_copy_object                                                PASS (1.70s)
  test_files_get                                                  PASS (1.11s)
  test_files_set_body_file                                        PASS (1.64s)

  test_list_objects                                               PASS (2.38s)
  test_directories_get                                            PASS (0.90s)
  test_list_bucket_acl                                            PASS (1.60s)
  test_put_object_acl                                             PASS (1.21s)
  test_copy_object_with_request_options                           PASS (1.50s)
  test_put_bucket_acl                                             PASS (1.38s)
  test_files_create_predefined_acl                                PASS (1.18s)
  test_directories_all                                            PASS (0.97s)
  test_files_get_https_url_whitespace                             PASS (0.85s)
  test_files_metadata                                             PASS (2.00s)
  test_get_bucket_acl                                             PASS (1.80s)
  test_directory_public_url                                       PASS (1.00s)
  test_directories_put_invalid_predefined_acl                     PASS (0.05s)
  test_copy_object_predefined_acl                                 PASS (1.54s)
  test_get_bucket                                                 PASS (0.81s)
  test_directories_put                                            PASS (0.89s)
  test_get_object_acl                                             PASS (1.26s)
  test_put_object_predefined_acl                                  PASS (1.03s)
  test_get_object_http_url                                        PASS (1.10s)
  test_put_object_url                                             PASS (0.76s)
  test_directories_put_predefined_acl                             PASS (0.62s)
  test_put_object_contradictory_content_type                      PASS (1.29s)
  test_list_buckets                                               PASS (1.03s)
  test_delete_bucket                                              PASS (0.92s)
  test_files_create_invalid_predefined_acl                        PASS (1.20s)
  test_put_bucket_predefined_acl                                  PASS (0.70s)

Finished in 71.09225s
53 tests, 66 assertions, 0 failures, 0 errors, 0 skips

Then I ran all the integration tests. It looks like the errors are unrelated to these changes:

$ bundle exec rake test:parallel
/home/stanhu/.local/share/mise/installs/ruby/3.3.7/bin/ruby -I"lib:test" /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/rake_test_loader.rb "test/integration/storage/test_buckets.rb" "test/integration/storage/test_coverage.rb" "test/integration/storage/test_directories.rb" "test/integration/storage/test_files.rb" "test/integration/storage/test_objects.rb"
/home/stanhu/.local/share/mise/installs/ruby/3.3.7/bin/ruby -I"lib:test" /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/rake_test_loader.rb
/home/stanhu/.local/share/mise/installs/ruby/3.3.7/bin/ruby -I"lib:test" /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/rake_test_loader.rb "test/integration/monitoring/test_coverage.rb" "test/integration/monitoring/test_metric_descriptors.rb" "test/integration/monitoring/test_monitored_resource_descriptors.rb" "test/integration/monitoring/test_timeseries.rb"
/home/stanhu/.local/share/mise/installs/ruby/3.3.7/bin/ruby -I"lib:test" /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/rake_test_loader.rb "test/integration/pubsub/test_coverage.rb" "test/integration/pubsub/test_pubsub_models.rb" "test/integration/pubsub/test_pubsub_requests.rb"
/home/stanhu/.local/share/mise/installs/ruby/3.3.7/bin/ruby -I"lib:test" /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/rake_test_loader.rb "test/integration/compute/core_compute/test_client_options.rb" "test/integration/compute/core_compute/test_coverage.rb" "test/integration/compute/core_compute/test_disk_types.rb" "test/integration/compute/core_compute/test_disks.rb" "test/integration/compute/core_compute/test_images.rb" "test/integration/compute/core_compute/test_machine_types.rb" "test/integration/compute/core_compute/test_operations.rb" "test/integration/compute/core_compute/test_projects.rb" "test/integration/compute/core_compute/test_regions.rb" "test/integration/compute/core_compute/test_servers.rb" "test/integration/compute/core_compute/test_snapshots.rb" "test/integration/compute/core_compute/test_zones.rb"
/home/stanhu/.local/share/mise/installs/ruby/3.3.7/bin/ruby -I"lib:test" /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/rake_test_loader.rb
/home/stanhu/.local/share/mise/installs/ruby/3.3.7/bin/ruby -I"lib:test" /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/rake_test_loader.rb
Started with run options --seed 49265

TestPubsubModels
Started with run options --seed 61051

TestStorageRequests
Started with run options --seed 35580

TestMetricDescriptors
Started with run options --seed 53883

TestComputeClient
/home/stanhu/.local/share/mise/installs/ruby/3.3.7/bin/ruby -I"lib:test" /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/rake_test_loader.rb
/home/stanhu/.local/share/mise/installs/ruby/3.3.7/bin/ruby -I"lib:test" /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/rake_test_loader.rb
/home/stanhu/.local/share/mise/installs/ruby/3.3.7/bin/ruby -I"lib:test" /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/rake_test_loader.rb
/home/stanhu/.local/share/mise/installs/ruby/3.3.7/bin/ruby -I"lib:test" /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/rake_test_loader.rb "test/integration/sql/test_certs.rb" "test/integration/sql/test_common_flags.rb" "test/integration/sql/test_common_tiers.rb" "test/integration/sql/test_coverage.rb" "test/integration/sql/test_instances.rb" "test/integration/sql/test_users.rb"
  test_client_options                                             PASS (3.61s)

TestServers
Started with run options --seed 14970

TestCommonFlags
  test_copy_object_with_object_property                           PASS (4.46s)
  test_metric_descriptors_all_page_size                           PASS (5.03s)
  test_create_custom_metric_descriptors                           PASS (0.11s)
  test_files_create_invalid_predefined_acl                        PASS (0.85s)
  test_all                                                        PASS (0.27s)
  test_topic_delete                                               PASS (5.52s)
  test_all                                                        PASS (1.98s)
  test_list                                                       PASS (0.29s)

TestSQLV2Instances
  test_put_object_url                                             PASS (1.03s)
  test_get_returns_nil_if_resource_does_not_exist                 PASS (0.27s)
  test_topics_get                                                 PASS (1.79s)
  test_copy_object_predefined_acl                                 PASS (1.48s)
  test_multiple_timeseries                                        PASS (2.58s)
  test_topic_publish_string                                       PASS (1.73s)
  test_files_create_string                                        PASS (1.37s)
  test_list_object_acl                                            PASS (1.04s)
  test_topic_publish_hash                                         PASS (2.53s)
  test_files_create_file                                          PASS (1.47s)
  test_files_public_url                                           PASS (1.47s)
  test_directories_destroy                                        PASS (1.07s)
  test_list_metric_descriptors                                    PASS (6.42s)
  test_subscriptions_get                                          PASS (3.17s)
  test_list_and_get                                               PASS (0.27s)
  test_put_object_predefined_acl                                  PASS (2.66s)
  test_topics_all                                                 PASS (2.38s)
  test_message_acknowledge                                        PASS (6.25s)
  test_files_each                                                 PASS (7.81s)
  test_copy_object_with_request_options                           PASS (1.11s)
  test_list_buckets                                               PASS (0.88s)
  test_subscription_delete                                        PASS (3.54s)
  test_files_get                                                  PASS (1.27s)
  test_files_get_https_url                                        PASS (0.94s)
  test_files_all                                                  PASS (1.21s)
  test_delete_bucket                                              PASS (1.21s)
  test_get_object_acl                                             PASS (1.35s)
  test_subscription_acknowledge                                   PASS (6.28s)
  test_put_object_nil                                             PASS (0.57s)
  test_put_object_file                                            PASS (1.14s)
  test_put_bucket_acl                                             PASS (1.32s)
  test_subscription_pull                                          PASS (4.76s)
  test_directory_files                                            PASS (2.35s)
  test_put_object_contradictory_content_type                      PASS (2.71s)
  test_directories_put_invalid_predefined_acl                     PASS (0.05s)
  test_directories_put_predefined_acl                             PASS (1.05s)
  test_get_object_http_url                                        PASS (0.95s)
  test_bootstrap_fail                                             PASS (39.42s)
  test_subscriptions_create                                       PASS (5.61s)
  test_files_destroy                                              PASS (1.80s)
  test_topics_create                                              PASS (1.72s)
  test_delete_object                                              PASS (1.20s)
  test_directories_all                                            PASS (0.76s)
  test_list_objects                                               PASS (1.05s)
  test_subscriptions_list                                         PASS (2.97s)

TestPubsubRequests
  test_files_get_https_url_whitespace                             PASS (1.29s)
  test_timeseries_collection                                      PASS (34.43s)
  test_files_copy                                                 PASS (1.77s)
  test_list_subscriptions                                         PASS (3.87s)
  test_files_metadata                                             PASS (1.40s)
  test_metric_descriptors_all                                     PASS (4.24s)
  test_metric_descriptors_get                                     PASS (0.08s)
  test_get                                                        PASS (0.06s)

Finished in 53.50655s
10 tests, 27 assertions, 0 failures, 0 errors, 0 skips
  test_files_set_body_file                                        PASS (1.76s)
  test_list_topics                                                PASS (1.83s)
  test_directories_put                                            PASS (0.84s)
  test_put_object_acl                                             PASS (1.24s)
  test_put_bucket_invalid_predefined_acl                          PASS (0.05s)
  test_get_bucket                                                 PASS (1.04s)
  test_put_bucket                                                 PASS (0.61s)
  test_get_subscription                                           PASS (4.29s)
  test_put_object_paperclip                                       PASS (1.49s)
  test_object_metadata                                            PASS (1.13s)
  test_publish_topic                                              PASS (2.43s)
  test_put_object_string                                          PASS (1.14s)
  test_put_object_invalid_predefined_acl                          PASS (0.69s)
  test_put_bucket_predefined_acl                                  PASS (0.80s)
  test_files_create_predefined_acl                                PASS (1.54s)
  test_files_set_body_string                                      PASS (1.62s)
  test_directories_get                                            PASS (1.09s)
  test_get_object                                                 PASS (2.16s)
  test_copy_object                                                PASS (1.18s)
  test_get_object_https_url                                       PASS (1.14s)
  test_get_bucket_acl                                             PASS (2.51s)
  test_list_bucket_acl                                            PASS (2.61s)
  test_directory_public_url                                       PASS (1.99s)

Finished in 78.72131s
53 tests, 66 assertions, 0 failures, 0 errors, 0 skips
  test_acknowledge_subscription                                   PASS (22.64s)
  test_create_topic                                               PASS (2.19s)
  test_create_subscription                                        PASS (8.85s)
  test_pull_subscription                                          PASS (9.27s)
  test_start_stop_reboot                                         ERROR (241.30s)
Minitest::UnexpectedError:         Google::Apis::ClientError: notFound: The resource 'projects/stan-745c536c/zones/us-central1-f/instances/fog-test-1-testservers-test-start-stop-reboot' was not found
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/google-apis-core-0.16.0/lib/google/apis/core/http_command.rb:244:in `check_status'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/google-apis-core-0.16.0/lib/google/apis/core/api_command.rb:135:in `check_status'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/google-apis-core-0.16.0/lib/google/apis/core/http_command.rb:207:in `process_response'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/google-apis-core-0.16.0/lib/google/apis/core/http_command.rb:331:in `execute_once'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/google-apis-core-0.16.0/lib/google/apis/core/http_command.rb:131:in `block (2 levels) in do_retry'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/retriable-3.1.2/lib/retriable.rb:61:in `block in retriable'
            <internal:numeric>:237:in `times'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/retriable-3.1.2/lib/retriable.rb:56:in `retriable'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/google-apis-core-0.16.0/lib/google/apis/core/http_command.rb:128:in `block in do_retry'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/retriable-3.1.2/lib/retriable.rb:61:in `block in retriable'
            <internal:numeric>:237:in `times'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/retriable-3.1.2/lib/retriable.rb:56:in `retriable'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/google-apis-core-0.16.0/lib/google/apis/core/http_command.rb:118:in `do_retry'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/google-apis-core-0.16.0/lib/google/apis/core/http_command.rb:109:in `execute'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/google-apis-core-0.16.0/lib/google/apis/core/base_service.rb:477:in `execute_or_queue_command'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/google-apis-compute_v1-0.116.0/lib/google/apis/compute_v1/service.rb:12982:in `get_instance'
            lib/fog/google/compute/requests/get_server.rb:14:in `get_server'
            lib/fog/google/compute/models/server.rb:501:in `reload'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/fog-core-2.6.0/lib/fog/core/model.rb:104:in `block in wait_for'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/fog-core-2.6.0/lib/fog/core/wait_for.rb:7:in `block in wait_for'
            <internal:kernel>:187:in `loop'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/fog-core-2.6.0/lib/fog/core/wait_for.rb:6:in `wait_for'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/fog-core-2.6.0/lib/fog/core/model.rb:103:in `wait_for'
            test/integration/compute/core_compute/test_servers.rb:120:in `test_start_stop_reboot'

  test_reset_windows_password                                    ERROR (70.97s)
Minitest::UnexpectedError:         ArgumentError: self_link is required for this operation
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/fog-core-2.6.0/lib/fog/core/attributes.rb:191:in `requires'
            lib/fog/google/compute/models/disk.rb:105:in `attached_disk_obj'
            lib/fog/google/compute/requests/insert_server.rb:23:in `block in process_disks'
            lib/fog/google/compute/requests/insert_server.rb:22:in `map'
            lib/fog/google/compute/requests/insert_server.rb:22:in `process_disks'
            lib/fog/google/compute/requests/insert_server.rb:75:in `insert_server'
            lib/fog/google/compute/models/server.rb:560:in `save'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/fog-core-2.6.0/lib/fog/core/collection.rb:53:in `create'
            test/integration/factories/collection_factory.rb:38:in `create'
            test/integration/compute/core_compute/test_servers.rb:227:in `test_reset_windows_password'

  test_delete_subscription                                        PASS (19.29s)
  test_delete_topic                                               PASS (1.39s)
  test_get_topic                                                  PASS (1.82s)

Finished in 126.14189s
24 tests, 16 assertions, 0 failures, 0 errors, 0 skips
  test_get_returns_nil_if_resource_does_not_exist                 PASS (18.14s)
  test_reset_windows_password                                    ERROR (23.02s)
Minitest::UnexpectedError:         ArgumentError: self_link is required for this operation
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/fog-core-2.6.0/lib/fog/core/attributes.rb:191:in `requires'
            lib/fog/google/compute/models/disk.rb:105:in `attached_disk_obj'
            lib/fog/google/compute/requests/insert_server.rb:23:in `block in process_disks'
            lib/fog/google/compute/requests/insert_server.rb:22:in `map'
            lib/fog/google/compute/requests/insert_server.rb:22:in `process_disks'
            lib/fog/google/compute/requests/insert_server.rb:75:in `insert_server'
            lib/fog/google/compute/models/server.rb:560:in `save'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/fog-core-2.6.0/lib/fog/core/collection.rb:53:in `create'
            test/integration/factories/collection_factory.rb:38:in `create'
            test/integration/compute/core_compute/test_servers.rb:227:in `test_reset_windows_password'

  test_set_machine_type_fail                                     ERROR (4.40s)
Minitest::UnexpectedError:         Google::Apis::ClientError: invalid: Invalid value for field 'resource.disks[0].source': 'https://www.googleapis.com/compute/v1/projects/stan-745c536c/zones/us-central1-f/disks/fog-test-1-testservers-test-set-machine-type-fail'. The referenced disk resource cannot be found.
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/google-apis-core-0.16.0/lib/google/apis/core/http_command.rb:244:in `check_status'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/google-apis-core-0.16.0/lib/google/apis/core/api_command.rb:135:in `check_status'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/google-apis-core-0.16.0/lib/google/apis/core/http_command.rb:207:in `process_response'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/google-apis-core-0.16.0/lib/google/apis/core/http_command.rb:331:in `execute_once'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/google-apis-core-0.16.0/lib/google/apis/core/http_command.rb:131:in `block (2 levels) in do_retry'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/retriable-3.1.2/lib/retriable.rb:61:in `block in retriable'
            <internal:numeric>:237:in `times'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/retriable-3.1.2/lib/retriable.rb:56:in `retriable'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/google-apis-core-0.16.0/lib/google/apis/core/http_command.rb:128:in `block in do_retry'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/retriable-3.1.2/lib/retriable.rb:61:in `block in retriable'
            <internal:numeric>:237:in `times'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/retriable-3.1.2/lib/retriable.rb:56:in `retriable'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/google-apis-core-0.16.0/lib/google/apis/core/http_command.rb:118:in `do_retry'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/google-apis-core-0.16.0/lib/google/apis/core/http_command.rb:109:in `execute'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/google-apis-core-0.16.0/lib/google/apis/core/base_service.rb:477:in `execute_or_queue_command'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/google-apis-compute_v1-0.116.0/lib/google/apis/compute_v1/service.rb:13312:in `insert_instance'
            lib/fog/google/compute/requests/insert_server.rb:121:in `insert_server'
            lib/fog/google/compute/models/server.rb:560:in `save'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/fog-core-2.6.0/lib/fog/core/collection.rb:53:in `create'
            test/integration/factories/collection_factory.rb:38:in `create'
            test/integration/compute/core_compute/test_servers.rb:32:in `test_set_machine_type_fail'

  test_ip_address_methods                                        ERROR (6.21s)
Minitest::UnexpectedError:         ArgumentError: self_link is required for this operation
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/fog-core-2.6.0/lib/fog/core/attributes.rb:191:in `requires'
            lib/fog/google/compute/models/disk.rb:105:in `attached_disk_obj'
            lib/fog/google/compute/requests/insert_server.rb:23:in `block in process_disks'
            lib/fog/google/compute/requests/insert_server.rb:22:in `map'
            lib/fog/google/compute/requests/insert_server.rb:22:in `process_disks'
            lib/fog/google/compute/requests/insert_server.rb:75:in `insert_server'
            lib/fog/google/compute/models/server.rb:560:in `save'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/fog-core-2.6.0/lib/fog/core/collection.rb:53:in `create'
            test/integration/factories/collection_factory.rb:38:in `create'
            test/integration/compute/core_compute/test_servers.rb:100:in `test_ip_address_methods'

  test_nil_get                                                    PASS (9.72s)
  test_image_name                                                ERROR (204.00s)
Minitest::UnexpectedError:         Google::Apis::ClientError: notFound: The resource 'projects/stan-745c536c/zones/us-central1-f/instances/fog-test-1-testservers-test-lifecycle' was not found
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/google-apis-core-0.16.0/lib/google/apis/core/http_command.rb:244:in `check_status'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/google-apis-core-0.16.0/lib/google/apis/core/api_command.rb:135:in `check_status'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/google-apis-core-0.16.0/lib/google/apis/core/http_command.rb:207:in `process_response'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/google-apis-core-0.16.0/lib/google/apis/core/http_command.rb:331:in `execute_once'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/google-apis-core-0.16.0/lib/google/apis/core/http_command.rb:131:in `block (2 levels) in do_retry'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/retriable-3.1.2/lib/retriable.rb:61:in `block in retriable'
            <internal:numeric>:237:in `times'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/retriable-3.1.2/lib/retriable.rb:56:in `retriable'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/google-apis-core-0.16.0/lib/google/apis/core/http_command.rb:128:in `block in do_retry'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/retriable-3.1.2/lib/retriable.rb:61:in `block in retriable'
            <internal:numeric>:237:in `times'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/retriable-3.1.2/lib/retriable.rb:56:in `retriable'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/google-apis-core-0.16.0/lib/google/apis/core/http_command.rb:118:in `do_retry'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/google-apis-core-0.16.0/lib/google/apis/core/http_command.rb:109:in `execute'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/google-apis-core-0.16.0/lib/google/apis/core/base_service.rb:477:in `execute_or_queue_command'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/google-apis-compute_v1-0.116.0/lib/google/apis/compute_v1/service.rb:12833:in `delete_instance'
            lib/fog/google/compute/requests/delete_server.rb:14:in `delete_server'
            lib/fog/google/compute/models/server.rb:209:in `destroy'
            test/integration/factories/collection_factory.rb:21:in `block in cleanup'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/fog-core-2.6.0/lib/fog/core/collection.rb:19:in `each'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/fog-core-2.6.0/lib/fog/core/collection.rb:19:in `each'
            test/integration/factories/collection_factory.rb:21:in `cleanup'
            test/integration/factories/servers_factory.rb:12:in `cleanup'
            test/integration/compute/core_compute/test_servers.rb:19:in `teardown'

  test_start_stop_reboot                                         ERROR (209.78s)
Minitest::UnexpectedError:         Google::Apis::ClientError: notFound: The resource 'projects/stan-745c536c/zones/us-central1-f/instances/fog-test-1-testservers-test-start-stop-reboot' was not found
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/google-apis-core-0.16.0/lib/google/apis/core/http_command.rb:244:in `check_status'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/google-apis-core-0.16.0/lib/google/apis/core/api_command.rb:135:in `check_status'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/google-apis-core-0.16.0/lib/google/apis/core/http_command.rb:207:in `process_response'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/google-apis-core-0.16.0/lib/google/apis/core/http_command.rb:331:in `execute_once'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/google-apis-core-0.16.0/lib/google/apis/core/http_command.rb:131:in `block (2 levels) in do_retry'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/retriable-3.1.2/lib/retriable.rb:61:in `block in retriable'
            <internal:numeric>:237:in `times'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/retriable-3.1.2/lib/retriable.rb:56:in `retriable'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/google-apis-core-0.16.0/lib/google/apis/core/http_command.rb:128:in `block in do_retry'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/retriable-3.1.2/lib/retriable.rb:61:in `block in retriable'
            <internal:numeric>:237:in `times'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/retriable-3.1.2/lib/retriable.rb:56:in `retriable'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/google-apis-core-0.16.0/lib/google/apis/core/http_command.rb:118:in `do_retry'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/google-apis-core-0.16.0/lib/google/apis/core/http_command.rb:109:in `execute'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/google-apis-core-0.16.0/lib/google/apis/core/base_service.rb:477:in `execute_or_queue_command'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/google-apis-compute_v1-0.116.0/lib/google/apis/compute_v1/service.rb:12982:in `get_instance'
            lib/fog/google/compute/requests/get_server.rb:14:in `get_server'
            lib/fog/google/compute/models/server.rb:501:in `reload'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/fog-core-2.6.0/lib/fog/core/model.rb:104:in `block in wait_for'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/fog-core-2.6.0/lib/fog/core/wait_for.rb:7:in `block in wait_for'
            <internal:kernel>:187:in `loop'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/fog-core-2.6.0/lib/fog/core/wait_for.rb:6:in `wait_for'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/fog-core-2.6.0/lib/fog/core/model.rb:103:in `wait_for'
            test/integration/compute/core_compute/test_servers.rb:120:in `test_start_stop_reboot'

  test_nil_get                                                    PASS (1.59s)
  test_enumerable                                                 PASS (1.50s)
  test_lifecycle                                                 ERROR (418.98s)
Minitest::UnexpectedError:         Google::Apis::ClientError: resourceInUseByAnotherResource: The disk resource 'projects/stan-745c536c/zones/us-central1-f/disks/fog-test-1-testservers-test-detach-disk' is already being used by 'projects/stan-745c536c/zones/us-central1-f/instances/fog-test-1-testservers-test-detach-disk'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/google-apis-core-0.16.0/lib/google/apis/core/http_command.rb:244:in `check_status'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/google-apis-core-0.16.0/lib/google/apis/core/api_command.rb:135:in `check_status'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/google-apis-core-0.16.0/lib/google/apis/core/http_command.rb:207:in `process_response'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/google-apis-core-0.16.0/lib/google/apis/core/http_command.rb:331:in `execute_once'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/google-apis-core-0.16.0/lib/google/apis/core/http_command.rb:131:in `block (2 levels) in do_retry'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/retriable-3.1.2/lib/retriable.rb:61:in `block in retriable'
            <internal:numeric>:237:in `times'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/retriable-3.1.2/lib/retriable.rb:56:in `retriable'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/google-apis-core-0.16.0/lib/google/apis/core/http_command.rb:128:in `block in do_retry'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/retriable-3.1.2/lib/retriable.rb:61:in `block in retriable'
            <internal:numeric>:237:in `times'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/retriable-3.1.2/lib/retriable.rb:56:in `retriable'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/google-apis-core-0.16.0/lib/google/apis/core/http_command.rb:118:in `do_retry'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/google-apis-core-0.16.0/lib/google/apis/core/http_command.rb:109:in `execute'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/google-apis-core-0.16.0/lib/google/apis/core/base_service.rb:477:in `execute_or_queue_command'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/google-apis-compute_v1-0.116.0/lib/google/apis/compute_v1/service.rb:3228:in `delete_disk'
            lib/fog/google/compute/requests/delete_disk.rb:20:in `delete_disk'
            lib/fog/google/compute/models/disk.rb:64:in `destroy'
            test/integration/factories/collection_factory.rb:21:in `block in cleanup'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/fog-core-2.6.0/lib/fog/core/collection.rb:19:in `each'
            /home/stanhu/.local/share/mise/installs/ruby/3.3.7/lib/ruby/gems/3.3.0/gems/fog-core-2.6.0/lib/fog/core/collection.rb:19:in `each'
            test/integration/factories/collection_factory.rb:21:in `cleanup'
            test/integration/factories/servers_factory.rb:13:in `cleanup'
            test/integration/compute/core_compute/test_servers.rb:19:in `teardown'

Do you think we can go ahead and merge this?

@@ -24,25 +24,25 @@ def class_for(key)

def [](service)
@@connections ||= Hash.new do |hash, key|
hash[key] = case key
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the Ruby LSP on VSCode reformatted this. I don't see an issue here, but I can revert this if you prefer to avoid any unnecessary changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Full Support of fog-core version 2
2 participants