mirror of
https://gitlab.com/TECHNOFAB/nixtest.git
synced 2025-12-12 02:00:18 +01:00
feat: sort suites and tests alphabetically in the console summary
This commit is contained in:
parent
f59d92791b
commit
7bb5c65259
1 changed files with 9 additions and 1 deletions
|
|
@ -2,8 +2,11 @@ package main
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"maps"
|
||||
"os"
|
||||
"regexp"
|
||||
"slices"
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
"github.com/jedib0t/go-pretty/v6/table"
|
||||
|
|
@ -67,7 +70,9 @@ func printSummary(results Results, successCount int, totalCount int) {
|
|||
|
||||
log.Info().Msg("Summary:")
|
||||
|
||||
for suite, suiteResults := range results {
|
||||
suitesSorted := slices.Sorted(maps.Keys(results))
|
||||
for _, suite := range suitesSorted {
|
||||
suiteResults := results[suite]
|
||||
suiteTotal := len(suiteResults)
|
||||
suiteSuccess := 0
|
||||
|
||||
|
|
@ -83,6 +88,9 @@ func printSummary(results Results, successCount int, totalCount int) {
|
|||
fmt.Sprintf("%d/%d", suiteSuccess, suiteTotal),
|
||||
"",
|
||||
})
|
||||
sort.Slice(suiteResults, func(i, j int) bool {
|
||||
return suiteResults[i].Spec.Name < suiteResults[j].Spec.Name
|
||||
})
|
||||
for _, res := range suiteResults {
|
||||
symbol := "❌"
|
||||
if res.Status == StatusSuccess {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue