1
0
mirror of synced 2026-02-06 19:05:55 +00:00

implement testEnv for e2e tests

Signed-off-by: Chanwit Kaewkasi <chanwit@gmail.com>
This commit is contained in:
Chanwit Kaewkasi
2021-08-08 00:54:42 +07:00
parent cb96bca6aa
commit 8f78263455
26 changed files with 376 additions and 44 deletions

View File

@@ -1,3 +1,5 @@
// +build !e2e
/*
Copyright 2021 The Flux authors

View File

@@ -1,3 +1,5 @@
// +build !e2e
/*
Copyright 2020 The Flux CD contributors.

View File

@@ -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))