test/plugin/constants.rb in fluent-plugin-google-cloud-0.12.10 vs test/plugin/constants.rb in fluent-plugin-google-cloud-0.12.11

- old
+ new

@@ -1,6 +1,5 @@ -# coding: utf-8 # Copyright 2017 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -226,17 +225,15 @@ DETECT_JSON_CONFIG = %( detect_json true ).freeze - # rubocop:disable Metrics/LineLength PRIVATE_KEY_CONFIG = %( auth_method private_key private_key_email 271661262351-ft99kc9kjro9rrihq3k2n3s2inbplu0q@developer.gserviceaccount.com private_key_path test/plugin/data/c31e573fd7f62ed495c9ca3821a5a85cb036dee1-privatekey.p12 ).freeze - # rubocop:enable Metrics/LineLength REQUIRE_VALID_TAGS_CONFIG = %( require_valid_tags true ).freeze @@ -431,11 +428,10 @@ CONFIG_UNKNOWN_MONITORING_TYPE = %( enable_monitoring true monitoring_type not_prometheus ).freeze - # rubocop:disable Metrics/LineLength CONFIG_METRICS_RESOURCE_JSON = %( enable_monitoring true monitoring_type opencensus metrics_resource {"type":"custom_resource","labels":{"label1":"123","label2":"abc"}} ).freeze @@ -479,11 +475,10 @@ CONFIG_METRICS_RESOURCE_JSON_BAD_KEYS_NO_LABELS = %( enable_monitoring true monitoring_type opencensus metrics_resource {"type":"custom_resource","labels.label1":"123","random":"x"} ).freeze - # rubocop:enable Metrics/LineLength # For statusz. CONFIG_STATUSZ = %( statusz_port 5678 @@ -1026,33 +1021,40 @@ partial_errors = Google::Logging::V2::WriteLogEntriesPartialErrors.new( log_entry_errors: { 0 => Google::Rpc::Status.new( code: GRPC::Core::StatusCodes::PERMISSION_DENIED, message: 'User not authorized.', - details: []), + details: [] + ), 1 => Google::Rpc::Status.new( code: GRPC::Core::StatusCodes::INVALID_ARGUMENT, message: 'Log name contains illegal character :', - details: []), + details: [] + ), 3 => Google::Rpc::Status.new( code: GRPC::Core::StatusCodes::INVALID_ARGUMENT, message: 'Log name contains illegal character :', - details: []) - }) + details: [] + ) + } + ) status = Google::Rpc::Status.new( message: 'User not authorized.', - details: [Google::Protobuf::Any.pack(partial_errors)]) + details: [Google::Protobuf::Any.pack(partial_errors)] + ) debug_info = Google::Rpc::DebugInfo.new( detail: '[ORIGINAL ERROR] generic::permission_denied: User not' \ ' authorized. [google.rpc.error_details_ext] { message:' \ " #{status.message.inspect} details { type_url:" \ " #{status.details[0].type_url.inspect} value:" \ - " #{status.details[0].value.inspect_octal} } }") + " #{status.details[0].value.inspect_octal} } }" + ) status_details = Google::Rpc::Status.new( code: 7, message: 'User not authorized.', details: [Google::Protobuf::Any.pack(partial_errors), - Google::Protobuf::Any.pack(debug_info)]) + Google::Protobuf::Any.pack(debug_info)] + ) { 'google.logging.v2.writelogentriespartialerrors-bin' => partial_errors.to_proto, 'google.rpc.debuginfo-bin' => debug_info.to_proto, 'grpc-status-details-bin' => status_details.to_proto @@ -1076,13 +1078,15 @@ }.freeze PARSE_ERROR_GRPC_METADATA = begin debug_info = Google::Rpc::DebugInfo.new( detail: '[ORIGINAL ERROR] RPC::CLIENT_ERROR: server could not parse' \ - " request sent by client; initialization error is: ''") + " request sent by client; initialization error is: ''" + ) status_details = Google::Rpc::Status.new( code: 3, message: 'internal client error', - details: [Google::Protobuf::Any.pack(debug_info)]) + details: [Google::Protobuf::Any.pack(debug_info)] + ) { 'google.rpc.debuginfo-bin' => debug_info.to_proto, 'grpc-status-details-bin' => status_details.to_proto }.freeze end