Unable to test labels for Google Cloud Run Service

I’ve been trying to write unit tests for a Cloud Run Service using Chef Inspec. I’ve managed to get a few working tests but one of the tests I need is to make sure the Service is labeled properly. I’ve spent days trying to get this working but I haven’t had any success. Every test I try throws an error so I have constructed the following test to try help find a way forward:

title "Test GCP Cloud Run Service"

require "json"
file = File.read("./integration_tests/files/terraform.json")
cloudrun_json = JSON.parse(file)

project_id = input("project_id")
region = input("region")
service_name = cloudrun_json.dig("cloud_run_service", "value", "service_name")
full_service_name = "projects/#{project_id}/locations/#{region}/services/#{service_name}"

control "debug_labels" do
  impact 1.0
  title "Debug Labels Attribute"
  describe google_run_service(name: full_service_name) do
    it "prints the labels attribute" do
      labels = subject.labels
      puts "Available methods for Labels: #{labels.inspect}"
      puts "Available methods for labels: #{labels.methods.sort.inspect}"
    end
  end
end

This is the output of the command when tested against a service that I know has 4 labels:

Labels: #<#<Class:0x000000000a75ed60>::GoogleInSpec::Run::Property::ServiceLabels:0x0000000008fd64b8 @parent_identifier="Service projects/<google-project>/locations/europe-west2/services/<service-name>", @additional_properties=nil>
Available methods for labels: [:!, :!=, :!~, :<=>, :==, :===, :=~, :LittlePlugger, :__id__, :__send__, :additional_properties, :as_null_object, :blank?, :class, :clone, :define_singleton_method, :display, :dup, :enum_for, :eql?, :equal?, :extend, :freeze, :frozen?, :hash, :inspect, :instance_eval, :instance_exec, :instance_of?, :instance_variable_defined?, :instance_variable_get, :instance_variable_set, :instance_variables, :is_a?, :itself, :kind_of?, :method, :methods, :nil?, :null_object?, :object_id, :pretty_inspect, :pretty_print, :pretty_print_cycle, :pretty_print_inspect, :pretty_print_instance_variables, :private_methods, :protected_methods, :public_method, :public_methods, :public_send, :received_message?, :remove_instance_variable, :respond_to?, :send, :should, :should_not, :should_not_receive, :should_receive, :singleton_class, :singleton_method, :singleton_methods, :stub, :stub_chain, :taint, :tainted?, :tap, :then, :to_enum, :to_json, :to_s, :to_yaml, :trust, :unstub, :untaint, :untrust, :untrusted?, :yield_self]

I’ve tested every useful keyword I could find here to_s, to_yaml and to_json all didn’t manage to get any further info out of the labels property. As far as I can tell its empty.

Has anyone managed to get any inspec tests working for Labels on Cloud Run? I am completely out of ideas, feels like the inspec resource is just a dud at this point.

Ideally I would be able to run

control "cloud_run_service" do
  impact 1.0
  title "Check if the Service exists and is healthy"
  describe google_run_service(name: full_service_name) do
    its("labels") { should include "owner" }
  end
end

However, when I try that I get:

×  Service projects/XXXXXX/locations/europe-west2/services/XXXXX labels is expected to include "owner"
     expected #<#<Class:0x00000001108dec10>::GoogleInSpec::Run::Property::ServiceLabels:0x0000000109bc65b0> to include "owner", but it does not respond to `include?`
     Diff:
     @@ -1 +1 @@
     -["owner"]
     +#<#<Class:0x00000001108dec10>::GoogleInSpec::Run::Property::ServiceLabels:0x0000000109bc65b0>

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật