Skip to content
This repository was archived by the owner on Sep 4, 2025. It is now read-only.
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
9 changes: 5 additions & 4 deletions cmd/gcp_pubsub_receiver/pubsub_receiver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,17 @@ func TestPubsubReceiver(t *testing.T) {
a.NotNil(psr)

t.Run("Test Pub/Sub Receiver UpdateMeasurements()", func(t *testing.T) {
// To read the published message from the Pub/Sub server.
sub, err := CreateSubscription(psr)
a.NoError(err)

msg := testutils.GetTestMeasurementEnvelope()
reply, err := psr.UpdateMeasurements(context.Background(), msg)
psr.publisher.Flush()

a.NoError(err)
a.Equal(reply.GetLogmsg(), "Message published.")

// Try read the published message from the Pub/Sub server.
sub, err := CreateSubscription(psr)
a.NoError(err)

ctx, cancel := context.WithCancel(context.Background())
err = sub.Receive(ctx, func(ctx context.Context, m *pubsub.Message) {
var recvd_msg map[string]any
Expand Down
4 changes: 2 additions & 2 deletions cmd/llama_receiver/llama_receiver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ func TestLLamaReceiver(t *testing.T) {
})

t.Run("Update Measurements Multiple", func(t *testing.T) {
for range 10 {
for range 3 {
_, err := recv.UpdateMeasurements(ctx, msg)
assert.NoError(t, err, "error encountered while updating measurements")
}
Expand All @@ -151,7 +151,7 @@ func TestLLamaReceiver(t *testing.T) {
err := conn.QueryRow(recv.Ctx, "SELECT COUNT(*) FROM insights;").Scan(&newInsightsCount)

assert.NoError(t, err)
assert.Greater(t, newInsightsCount, 1, "No new entries inserted in insights table")
assert.GreaterOrEqual(t, newInsightsCount, 1, "No new entries inserted in insights table")
})

t.Run("LLama SyncMetricHandler", func(t *testing.T) {
Expand Down