test/plugin/base_test.rb in fluent-plugin-google-cloud-0.6.8.pre.1 vs test/plugin/base_test.rb in fluent-plugin-google-cloud-0.6.8.pre.2
- old
+ new
@@ -1121,32 +1121,13 @@
new_stub_context do
setup_gce_metadata_stubs
setup_metadata_agent_stubs
d = create_driver(ENABLE_METADATA_AGENT_CONFIG)
assert_true d.instance.instance_variable_get(:@enable_metadata_agent)
- assert_requested_metadata_agent_stub(IMPLICIT_LOCAL_RESOURCE_ID)
end
end
- # Test that an implicit monitored resource can be retrieved from Metadata
- # Agent with an empty string as the local_resource_id.
- def test_retrieve_implicit_monitored_resource
- # GCE metadata stubs has VM_ID and ZONE, while the Metadata Agent stub has
- # METADATA_VM_ID and METADATA_ZONE.
- new_stub_context do
- setup_gce_metadata_stubs
- setup_metadata_agent_stubs
- setup_logging_stubs do
- d = create_driver(ENABLE_METADATA_AGENT_CONFIG)
- d.emit('message' => log_entry(0))
- d.run
- end
- verify_log_entries(1, COMPUTE_PARAMS_WITH_METADATA_VM_ID_AND_ZONE)
- assert_requested_metadata_agent_stub(IMPLICIT_LOCAL_RESOURCE_ID)
- end
- end
-
# Docker Container.
# Test textPayload logs from Docker container stdout / stderr.
def test_docker_container_stdout_stderr_logs_text_payload
[1, 2, 3, 5, 11, 50].each do |n|
@@ -1159,11 +1140,10 @@
d.emit(docker_container_stdout_stderr_log_entry(log_entry(i)))
end
d.run
end
verify_log_entries(n, DOCKER_CONTAINER_PARAMS)
- assert_requested_metadata_agent_stub(IMPLICIT_LOCAL_RESOURCE_ID)
assert_requested_metadata_agent_stub("container.#{DOCKER_CONTAINER_ID}")
end
end
end
@@ -1189,11 +1169,10 @@
assert_equal 3, fields.size, entry
assert_equal "test log entry #{n}", get_string(fields['msg']), entry
assert_equal 'test', get_string(fields['tag2']), entry
assert_equal 5000, get_number(fields['data']), entry
end
- assert_requested_metadata_agent_stub(IMPLICIT_LOCAL_RESOURCE_ID)
assert_requested_metadata_agent_stub("container.#{DOCKER_CONTAINER_ID}")
end
end
end
@@ -1210,11 +1189,10 @@
d = create_driver(ENABLE_METADATA_AGENT_CONFIG)
d.emit(docker_container_application_log_entry(log_entry(0)))
d.run
end
verify_log_entries(1, DOCKER_CONTAINER_PARAMS_NO_STREAM)
- assert_requested_metadata_agent_stub(IMPLICIT_LOCAL_RESOURCE_ID)
assert_requested_metadata_agent_stub(
"containerName.#{DOCKER_CONTAINER_NAME}")
end
end
@@ -1235,11 +1213,10 @@
assert_equal DOCKER_CONTAINER_SECONDS_EPOCH,
entry['timestamp']['seconds'], entry
assert_equal DOCKER_CONTAINER_NANOS,
entry['timestamp']['nanos'], entry
end
- assert_requested_metadata_agent_stub(IMPLICIT_LOCAL_RESOURCE_ID)
assert_requested_metadata_agent_stub(
"containerName.#{DOCKER_CONTAINER_NAME}")
end
end
@@ -1287,10 +1264,9 @@
d.emit(gke_container_log_entry(log_entry(i)))
end
d.run
end
verify_log_entries(n, CONTAINER_FROM_APPLICATION_PARAMS)
- assert_requested_metadata_agent_stub(IMPLICIT_LOCAL_RESOURCE_ID)
assert_requested_metadata_agent_stub(
"gke_containerName.#{CONTAINER_NAMESPACE_ID}.#{CONTAINER_POD_NAME}." \
"#{CONTAINER_CONTAINER_NAME}")
end
end