Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
phacops committed May 12, 2024
1 parent f648c13 commit c694fc2
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rust_snuba/src/processors/profile_chunks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub fn process_message(
let payload_bytes = payload.payload().context("Expected payload")?;
let msg: InputMessage = serde_json::from_slice(payload_bytes)?;

let mut row = ProfileChunk {
let mut row = Chunk {
chunk: msg,
offset: metadata.offset,
partition: metadata.partition,
Expand Down Expand Up @@ -47,7 +47,7 @@ struct InputMessage {
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
struct Chunk {
#[serde(flatten)]
Chunk: InputMessage,
chunk: InputMessage,

#[serde(default)]
offset: u64,
Expand All @@ -72,7 +72,7 @@ mod tests {
"project_id": 1,
"received": 1694357860,
"retention_days": 30,
"start_timestamp": 1710805688.1234567,
"start_timestamp": 1710805688.1234567
}"#;
let payload = KafkaPayload::new(None, None, Some(data.as_bytes().to_vec()));
let meta = KafkaMessageMetadata {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
source: src/processors/mod.rs
description: "{\n \"project_id\": 1,\n \"profiler_id\": \"4d229f1d3807421ba62a5f8bc295d836\",\n \"chunk_id\": \"0432a0a4c25f4697bf9f0a2fcbe6a814\",\n \"start_timestamp\": 1710805688.1234567,\n \"end_timestamp\": 1710805689.1234567,\n \"received\": 1694357860,\n \"retention_days\": 30\n}\n"
expression: snapshot_payload
---
[
{
"chunk_id": "0432a0a4-c25f-4697-bf9f-0a2fcbe6a814",
"end_timestamp": 1710805689.1234567,
"offset": 1,
"partition": 0,
"profiler_id": "4d229f1d-3807-421b-a62a-5f8bc295d836",
"project_id": 1,
"received": 1694357860,
"retention_days": 30,
"start_timestamp": 1710805688.1234567
}
]

0 comments on commit c694fc2

Please sign in to comment.