Skip to content

Commit 2718198

Browse files
committed
test_in_opentelemetry: add test for empty request
This commit check following specification > If the server receives an empty request the server SHOULD respond with success. Signed-off-by: Shizuo Fujita <fujita@clear-code.com>
1 parent edd1e1e commit 2718198

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

test/fluent/plugin/test_in_opentelemetry.rb

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,25 @@ def config
117117
request_data: TestData::JSON::LOGS_CONTAINED_UNKNOWN_FIELD,
118118
record_type: Fluent::Plugin::Opentelemetry::RECORD_TYPE_LOGS,
119119
record_data: TestData::JSON::LOGS
120-
})
120+
},
121+
"metrics with empty request" => {
122+
request_path: "/v1/metrics",
123+
request_data: "{}",
124+
record_type: Fluent::Plugin::Opentelemetry::RECORD_TYPE_METRICS,
125+
record_data: "{}"
126+
},
127+
"traces with empty request" => {
128+
request_path: "/v1/traces",
129+
request_data: "{}",
130+
record_type: Fluent::Plugin::Opentelemetry::RECORD_TYPE_TRACES,
131+
record_data: "{}"
132+
},
133+
"logs with empty request" => {
134+
request_path: "/v1/logs",
135+
request_data: "{}",
136+
record_type: Fluent::Plugin::Opentelemetry::RECORD_TYPE_LOGS,
137+
record_data: "{}"
138+
}, )
121139
def test_receive_json(data)
122140
d = create_driver
123141
res = d.run(expect_records: 1) do

0 commit comments

Comments
 (0)