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

Commit

Permalink
Merge branch 'main' of github.com:PostHog/hog-rs into flag-boilerplate
Browse files Browse the repository at this point in the history
  • Loading branch information
neilkakkar committed May 2, 2024
2 parents b3308d3 + c6d5c67 commit 27e69e9
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,6 @@ jobs:
- name: Run cargo test
run: cargo test --all-features

- name: Run cargo check
run: cargo check --all-features

linting:
runs-on: depot-ubuntu-22.04-4

Expand All @@ -89,12 +86,15 @@ jobs:
~/.cargo/git
target
key: ${{ runner.os }}-cargo-debug-${{ hashFiles('**/Cargo.lock') }}


- name: Check format
run: cargo fmt -- --check

- name: Run clippy
run: cargo clippy -- -D warnings

- name: Check format
run: cargo fmt -- --check
- name: Run cargo check
run: cargo check --all-features

shear:
runs-on: depot-ubuntu-22.04-4
Expand Down
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 27e69e9

Please sign in to comment.