From 2d1757038ff415a11e8d58740f14086404fe4d45 Mon Sep 17 00:00:00 2001 From: Dawid Rusnak Date: Thu, 26 Oct 2023 23:40:34 +0200 Subject: [PATCH] fix: total number of test suite executions should ignore paging filters (#4530) --- internal/app/api/v1/testsuites.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/app/api/v1/testsuites.go b/internal/app/api/v1/testsuites.go index 8a862b7d61..5c9e98ee63 100644 --- a/internal/app/api/v1/testsuites.go +++ b/internal/app/api/v1/testsuites.go @@ -5,6 +5,7 @@ import ( "context" "encoding/json" "fmt" + "math" "net/http" "sort" "strconv" @@ -622,8 +623,9 @@ func (s TestkubeAPI) ListTestSuiteExecutionsHandler() fiber.Handler { return s.Error(c, http.StatusInternalServerError, fmt.Errorf("%s: client could not get executions totals: %w", errPrefix, err)) } l.Debugw("got executions totals", "totals", executionsTotals, "time", time.Since(now)) - nameFilter := testresult.NewExecutionsFilter().WithName(c.Query("id", "")) - allExecutionsTotals, err := s.TestExecutionResults.GetExecutionsTotals(ctx, nameFilter) + filterAllTotals := *filter.(*testresult.FilterImpl) + filterAllTotals.WithPage(0).WithPageSize(math.MaxInt64) + allExecutionsTotals, err := s.TestExecutionResults.GetExecutionsTotals(ctx, filterAllTotals) if err != nil { return s.Error(c, http.StatusInternalServerError, fmt.Errorf("%s: client could not get all executions totals: %w", errPrefix, err)) }