Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ jobs:
image: rust:1.81-bookworm
env:
DATABASE_URL: postgres://postgres@postgres:5432
CI: true
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Cache dependencies
Expand Down
12 changes: 7 additions & 5 deletions Cargo.lock

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

6 changes: 6 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,9 @@ rev = "9fd4beb"
[patch.crates-io.tap_graph]
git = "https://github.com/semiotic-ai/timeline-aggregation-protocol"
rev = "9fd4beb"

# Insta benefits from being compiled in release mode, even as dev dependency
# see https://insta.rs/docs/quickstart
[profile.dev.package]
insta.opt-level = 3
similar.opt-level = 3
1 change: 1 addition & 0 deletions crates/tap-agent/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,4 @@ test-assets = { path = "../test-assets" }
test-log.workspace = true
rstest = "0.24.0"
stdext = "0.3.3"
insta = "1.42.2"
22 changes: 3 additions & 19 deletions crates/tap-agent/src/agent/sender_account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1527,10 +1527,7 @@ pub mod tests {
))
.unwrap();
let message = msg_receiver.recv().await.expect("Channel failed");
assert_eq!(
message,
SenderAccountMessage::UpdateAllocationIds(allocation_ids)
);
insta::assert_debug_snapshot!(message);

// verify if create sender account
let sender_allocation_id = format!("{}:{}:{}", prefix.clone(), SENDER.1, ALLOCATION_ID_0);
Expand All @@ -1541,17 +1538,7 @@ pub mod tests {
.cast(SenderAccountMessage::UpdateAllocationIds(HashSet::new()))
.unwrap();
let message = msg_receiver.recv().await.expect("Channel failed");
assert_eq!(
message,
SenderAccountMessage::UpdateReceiptFees(
ALLOCATION_ID_0,
ReceiptFees::UpdateValue(UnaggregatedReceipts {
value: 0,
last_id: 0,
counter: 0,
})
)
);
insta::assert_debug_snapshot!(message);

let actor_ref = ActorRef::<SenderAllocationMessage>::where_is(sender_allocation_id.clone());
assert!(actor_ref.is_some());
Expand Down Expand Up @@ -1582,10 +1569,7 @@ pub mod tests {
.cast(SenderAccountMessage::UpdateAllocationIds(HashSet::new()))
.unwrap();
let msg = msg_receiver.recv().await.expect("Channel failed");
assert_eq!(
msg,
SenderAccountMessage::UpdateAllocationIds(HashSet::new())
);
insta::assert_debug_snapshot!(msg);

let actor_ref = ActorRef::<SenderAllocationMessage>::where_is(sender_allocation_id.clone());
assert!(actor_ref.is_none());
Expand Down
10 changes: 3 additions & 7 deletions crates/tap-agent/src/agent/sender_accounts_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -948,9 +948,7 @@ mod tests {
use crate::{
agent::{
sender_account::SenderAccountMessage,
sender_accounts_manager::{
handle_notification, AllocationId, NewReceiptNotification, SenderType,
},
sender_accounts_manager::{handle_notification, NewReceiptNotification, SenderType},
},
test::{
actors::{DummyActor, MockSenderAccount, MockSenderAllocation, TestableActor},
Expand Down Expand Up @@ -1316,10 +1314,8 @@ mod tests {
.await
.unwrap();

assert_eq!(
rx.recv().await.unwrap(),
SenderAccountMessage::NewAllocationId(AllocationId::Legacy(ALLOCATION_ID_0))
);
let new_alloc_msg = rx.recv().await.unwrap();
insta::assert_debug_snapshot!(new_alloc_msg);
sender_account.stop_and_wait(None, None).await.unwrap();
join_handle.await.unwrap();
}
Expand Down
Loading
Loading