From 6c977998421c4958bee1cc2e3e93d73e14e8c188 Mon Sep 17 00:00:00 2001 From: Artem Fetishev Date: Tue, 28 Apr 2026 10:45:07 +0200 Subject: [PATCH] fix search test Signed-off-by: Artem Fetishev --- lib/storage/search_test.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/storage/search_test.go b/lib/storage/search_test.go index c287db9be0..661d859b89 100644 --- a/lib/storage/search_test.go +++ b/lib/storage/search_test.go @@ -32,7 +32,12 @@ func TestSearchQueryMarshalUnmarshal(t *testing.T) { // Skip nil sq1. continue } - buf = sq1.Marshal(buf[:0]) + tt := TenantToken{ + AccountID: sq1.AccountID, + ProjectID: sq1.ProjectID, + } + buf = tt.Marshal(buf[:0]) + buf = sq1.MarshalWithoutTenant(buf) tail, err := sq2.Unmarshal(buf) if err != nil { @@ -41,6 +46,12 @@ func TestSearchQueryMarshalUnmarshal(t *testing.T) { if len(tail) > 0 { t.Fatalf("unexpected tail left after SearchQuery unmarshaling; tail (len=%d): %q", len(tail), tail) } + if sq2.AccountID != sq1.AccountID { + t.Fatalf("unexpected AccountID; got %d; want %d", sq2.AccountID, sq1.AccountID) + } + if sq2.ProjectID != sq1.ProjectID { + t.Fatalf("unexpected ProjectID; got %d; want %d", sq2.ProjectID, sq1.ProjectID) + } if sq1.MinTimestamp != sq2.MinTimestamp { t.Fatalf("unexpected MinTimestamp; got %d; want %d", sq2.MinTimestamp, sq1.MinTimestamp) }