Skip to content
This repository has been archived by the owner on Jun 21, 2024. It is now read-only.

Commit

Permalink
fix capture CI (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
xvello authored May 2, 2024
1 parent bca9f84 commit db332e5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion capture/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ uuid = { workspace = true }

[dev-dependencies]
assert-json-diff = { workspace = true }
axum-test-helper = { git = "https://github.com/orphan-rs/axum-test-helper.git" } # TODO: remove, directly use reqwest like capture-server tests
axum-test-helper = { git = "https://github.com/posthog/axum-test-helper.git" } # TODO: remove, directly use reqwest like capture-server tests
9 changes: 8 additions & 1 deletion capture/tests/django_compat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,11 @@ async fn it_matches_django_capture_behaviour() -> anyhow::Result<()> {
if let Some(object) = expected.as_object_mut() {
// site_url is unused in the pipeline now, let's drop it
object.remove("site_url");

// Remove sent_at field if empty: Rust will skip marshalling it
if let Some(None) = object.get("sent_at").map(|v| v.as_str()) {
object.remove("sent_at");
}
}

let match_config = assert_json_diff::Config::new(assert_json_diff::CompareMode::Strict);
Expand All @@ -209,7 +214,9 @@ async fn it_matches_django_capture_behaviour() -> anyhow::Result<()> {
{
println!(
"record mismatch at line {}, event {}: {}",
line_number, event_number, e
line_number + 1,
event_number,
e
);
mismatches += 1;
}
Expand Down

0 comments on commit db332e5

Please sign in to comment.