mirror of
https://github.com/fluxcd/flux2.git
synced 2026-04-15 16:25:43 +00:00
implement testEnv for e2e tests
Signed-off-by: Chanwit Kaewkasi <chanwit@gmail.com>
This commit is contained in:
parent
cb96bca6aa
commit
8f78263455
26 changed files with 376 additions and 44 deletions
|
|
@ -1,3 +1,5 @@
|
|||
// +build !e2e
|
||||
|
||||
/*
|
||||
Copyright 2021 The Flux authors
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
// +build !e2e
|
||||
|
||||
/*
|
||||
Copyright 2020 The Flux CD contributors.
|
||||
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ package status
|
|||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"sort"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
|
|
@ -74,7 +75,13 @@ func (sc *StatusChecker) Assess(identifiers ...object.ObjMetadata) error {
|
|||
|
||||
<-done
|
||||
|
||||
for _, rs := range coll.ResourceStatuses {
|
||||
// we use sorted identifiers to loop over the resource statuses because a Go's map is unordered.
|
||||
// sorting identifiers by object's name makes sure that the logs look stable for every run
|
||||
sort.SliceStable(identifiers, func(i, j int) bool {
|
||||
return strings.Compare(identifiers[i].Name, identifiers[j].Name) < 0
|
||||
})
|
||||
for _, id := range identifiers {
|
||||
rs := coll.ResourceStatuses[id]
|
||||
switch rs.Status {
|
||||
case status.CurrentStatus:
|
||||
sc.logger.Successf("%s: %s ready", rs.Identifier.Name, strings.ToLower(rs.Identifier.GroupKind.Kind))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue