Skip to content

Commit

Permalink
remove generated json
Browse files Browse the repository at this point in the history
  • Loading branch information
lalitb committed Jun 13, 2024
1 parent bfbd517 commit d9ab817
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 140 deletions.

This file was deleted.

20 changes: 15 additions & 5 deletions opentelemetry-otlp/tests/integration_test/tests/traces.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,25 @@ pub fn test_assert_span_eq() {

#[test]
pub fn test_serde() {
let spans = read_spans_from_json(File::open("./expected/traces.json").expect("Failed to read traces.json"));
let json = serde_json::to_string_pretty(&TracesData { resource_spans: spans }).expect("Failed to serialize spans to json");
let spans = read_spans_from_json(
File::open("./expected/traces.json").expect("Failed to read traces.json"),
);
let json = serde_json::to_string_pretty(&TracesData {
resource_spans: spans,
})
.expect("Failed to serialize spans to json");

// Write to file.
let mut file = File::create("./expected/serialized_traces.json").unwrap();
file.write_all(json.as_bytes()).unwrap();

let left = read_spans_from_json(File::open("./expected/traces.json").expect("Failed to read traces.json"));
let right = read_spans_from_json(File::open("./expected/serialized_traces.json").expect("Failed to read serialized_traces.json"));
let left = read_spans_from_json(
File::open("./expected/traces.json").expect("Failed to read traces.json"),
);
let right = read_spans_from_json(
File::open("./expected/serialized_traces.json")
.expect("Failed to read serialized_traces.json"),
);

TraceAsserter::new(left, right).assert();
}
}

0 comments on commit d9ab817

Please sign in to comment.