Skip to content

Commit 09bc3d8

Browse files
committed
tests: internal: opentelemetry: adjust test for flexible timestamp handling
Signed-off-by: Eduardo Silva <[email protected]>
1 parent 4142c20 commit 09bc3d8

File tree

2 files changed

+7
-47
lines changed

2 files changed

+7
-47
lines changed

tests/internal/data/opentelemetry/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ For error cases, use the `expected_error` field:
136136
"test_case_name": {
137137
"input": { ... },
138138
"expected_error": {
139-
"code": "FLB_OTEL_LOGS_ERR_MISSING_TIMESTAMP"
139+
"code": "FLB_OTEL_LOGS_ERR_UNEXPECTED_LOGRECORDS_ENTRY_TYPE"
140140
}
141141
}
142142
}

tests/internal/data/opentelemetry/test_cases.json

Lines changed: 6 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,12 @@
3737
},
3838

3939
"missing_timestamp": {
40-
"input": {"resourceLogs": [{"scopeLogs": [{"logRecords": [{}]}]}]},
41-
"expected_error": {
42-
"code": "FLB_OTEL_LOGS_ERR_MISSING_TIMESTAMP"
40+
"input": {"resourceLogs": [{"scopeLogs": [{"logRecords": [{"body": {"stringValue": "test"}}]}]}]},
41+
"expected": {
42+
"group_metadata": {"schema":"otlp","resource_id":0,"scope_id":0},
43+
"group_body": {"resource":{}},
44+
"log_metadata": {"otlp":{}},
45+
"log_body": {"log": "test"}
4346
}
4447
},
4548

@@ -988,49 +991,6 @@
988991
}
989992
},
990993

991-
"multiple_records_no_timestamp_after_valid_ones": {
992-
"input": {
993-
"resourceLogs": [{
994-
"resource": {
995-
"attributes": [
996-
{"key": "service.name", "value": {"stringValue": "test-service"}}
997-
]
998-
},
999-
"scopeLogs": [{
1000-
"scope": {
1001-
"name": "test-scope"
1002-
},
1003-
"logRecords": [
1004-
{
1005-
"timeUnixNano": "1640995200000000000",
1006-
"severityNumber": 9,
1007-
"severityText": "INFO",
1008-
"attributes": [
1009-
{"key": "user.id", "value": {"stringValue": "user123"}},
1010-
{"key": "action", "value": {"stringValue": "login"}}
1011-
],
1012-
"body": {"stringValue": "User login successful"}
1013-
},
1014-
{
1015-
"timeUnixNano": "1640995201000000000",
1016-
"severityNumber": 5,
1017-
"severityText": "DEBUG",
1018-
"body": {"stringValue": "Processing user session"}
1019-
},
1020-
{
1021-
"severityNumber": 13,
1022-
"severityText": "ERROR",
1023-
"body": {"stringValue": "This log is missing timestamp"}
1024-
}
1025-
]
1026-
}]
1027-
}]
1028-
},
1029-
"expected_error": {
1030-
"code": "FLB_OTEL_LOGS_ERR_MISSING_TIMESTAMP"
1031-
}
1032-
},
1033-
1034994
"large_structure_fails_at_resource_attributes": {
1035995
"input": {
1036996
"resourceLogs": [

0 commit comments

Comments
 (0)