Skip to content

Commit 22d4ef3

Browse files
update tests
1 parent 445f013 commit 22d4ef3

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

src/otel/traces.rs

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -444,9 +444,9 @@ mod tests {
444444
fn test_flatten_status_code_mapping() {
445445
// Test that status codes are correctly mapped to descriptions
446446
let test_cases = vec![
447-
(0, "STATUS_CODE_UNSET"),
448-
(1, "STATUS_CODE_OK"),
449-
(2, "STATUS_CODE_ERROR"),
447+
(0, "UNSET"),
448+
(1, "OK"),
449+
(2, "ERROR"),
450450
(999, ""), // Unknown status code should return empty string
451451
];
452452

@@ -481,12 +481,12 @@ mod tests {
481481
fn test_flatten_span_kind_mapping() {
482482
// Test that span kinds are correctly mapped to descriptions
483483
let test_cases = vec![
484-
(0, "SPAN_KIND_UNSPECIFIED"),
485-
(1, "SPAN_KIND_INTERNAL"),
486-
(2, "SPAN_KIND_SERVER"),
487-
(3, "SPAN_KIND_CLIENT"),
488-
(4, "SPAN_KIND_PRODUCER"),
489-
(5, "SPAN_KIND_CONSUMER"),
484+
(0, "UNSPECIFIED"),
485+
(1, "INTERNAL"),
486+
(2, "SERVER"),
487+
(3, "CLIENT"),
488+
(4, "PRODUCER"),
489+
(5, "CONSUMER"),
490490
(999, ""), // Unknown kind should return empty string
491491
];
492492

@@ -511,10 +511,10 @@ mod tests {
511511
fn test_flatten_flags_mapping() {
512512
// Test that flags are correctly mapped to descriptions
513513
let test_cases = vec![
514-
(0, "SPAN_FLAGS_DO_NOT_USE"),
515-
(255, "SPAN_FLAGS_TRACE_FLAGS_MASK"),
516-
(256, "SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK"),
517-
(512, "SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK"),
514+
(0, "DO_NOT_USE"),
515+
(255, "TRACE_FLAGS_MASK"),
516+
(256, "CONTEXT_HAS_IS_REMOTE_MASK"),
517+
(512, "CONTEXT_IS_REMOTE_MASK"),
518518
(999, ""), // Unknown flag should return empty string
519519
];
520520

@@ -686,7 +686,7 @@ mod tests {
686686
);
687687
assert_eq!(
688688
record.get("span_kind_description").unwrap(),
689-
&Value::String("SPAN_KIND_SERVER".to_string()),
689+
&Value::String("SERVER".to_string()),
690690
"All records should contain span kind description"
691691
);
692692
assert!(
@@ -927,7 +927,7 @@ mod tests {
927927
);
928928
assert_eq!(
929929
record.get("span_kind_description").unwrap(),
930-
&Value::String("SPAN_KIND_CLIENT".to_string()),
930+
&Value::String("CLIENT".to_string()),
931931
"Should contain span kind description"
932932
);
933933
assert_eq!(
@@ -937,7 +937,7 @@ mod tests {
937937
);
938938
assert_eq!(
939939
record.get("span_status_description").unwrap(),
940-
&Value::String("STATUS_CODE_OK".to_string()),
940+
&Value::String("OK".to_string()),
941941
"Should contain status description"
942942
);
943943
}
@@ -964,12 +964,14 @@ mod tests {
964964
"event_name",
965965
"event_time_unix_nano",
966966
"event_dropped_attributes_count",
967+
"event_duration_ms",
967968
"link_span_id",
968969
"link_trace_id",
969970
"link_dropped_attributes_count",
970971
"span_dropped_events_count",
971972
"span_dropped_links_count",
972973
"span_dropped_attributes_count",
974+
"span_duration_ms",
973975
"span_trace_state",
974976
"span_flags",
975977
"span_flags_description",

0 commit comments

Comments
 (0)