Add sorting and paging to JobStatsGrouped

This commit is contained in:
2023-08-25 13:14:34 +02:00
parent 13d99a6ae0
commit d7117f3d49
6 changed files with 158 additions and 74 deletions

View File

@@ -7,6 +7,8 @@ package repository
import (
"fmt"
"testing"
"github.com/ClusterCockpit/cc-backend/internal/graph/model"
)
func TestBuildJobStatsQuery(t *testing.T) {
@@ -19,3 +21,17 @@ func TestBuildJobStatsQuery(t *testing.T) {
fmt.Printf("SQL: %s\n", sql)
}
func TestJobStats(t *testing.T) {
r := setup(t)
filter := &model.JobFilter{}
var err error
var stats []*model.JobsStatistics
stats, err = r.testJobsStats([]*model.JobFilter{filter})
noErr(t, err)
if stats[0].TotalJobs != 98 {
t.Fatalf("Want 98, Got %d", stats[0].TotalJobs)
}
}