Merge pull request #19727 from prezha/fix-TestMultiControlPlane

fix cluster status check in TestMultiControlPlane
pull/19736/head
Steven Powell 2024-09-30 12:08:54 -07:00 committed by GitHub
commit 2129659800
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 5 deletions

View File

@ -68,7 +68,7 @@ const (
// 2xx signifies that the API Server is able to service requests
OK = 200
OKHAppy = 201
HAppy = 201
Warning = 203
Degraded = 204
@ -99,7 +99,7 @@ var (
103: "Deleting",
200: "OK",
201: "OKHAppy",
201: "HAppy",
203: "Warning",
204: "Degraded",
@ -343,7 +343,7 @@ func GetState(sts []*Status, profile string, cc *config.ClusterConfig) State {
case healthyCPs == 2:
cs.StatusCode = Degraded
default:
cs.StatusCode = OKHAppy
cs.StatusCode = HAppy
}
}

View File

@ -300,8 +300,10 @@ func validateHAStatusHAppy(ctx context.Context, t *testing.T, profile string) {
if profileObject == nil {
t.Errorf("expected the json of 'profile list' to include %q but got *%q*. args: %q", profile, rr.Stdout.String(), rr.Command())
} else if expected, numNodes := 4, len(profileObject.Config.Nodes); numNodes != expected {
t.Errorf("expected profile %q in json of 'profile list' to include %d nodes but have %d nodes. got *%q*. args: %q", profile, expected, numNodes, rr.Stdout.String(), rr.Command())
} else {
if expected, numNodes := 4, len(profileObject.Config.Nodes); numNodes != expected {
t.Errorf("expected profile %q in json of 'profile list' to include %d nodes but have %d nodes. got *%q*. args: %q", profile, expected, numNodes, rr.Stdout.String(), rr.Command())
}
if expected, status := "HAppy", profileObject.Status; status != expected {
t.Errorf("expected profile %q in json of 'profile list' to have %q status but have %q status. got *%q*. args: %q", profile, expected, status, rr.Stdout.String(), rr.Command())