From 57b41010d4e0b37e9cafb347bfbf196a7a7503d2 Mon Sep 17 00:00:00 2001 From: Ann Marie Fred Date: Tue, 5 Dec 2023 16:24:46 -0500 Subject: [PATCH 01/11] new appstudio limits and quotas --- testsupport/tiers/checks.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/testsupport/tiers/checks.go b/testsupport/tiers/checks.go index 54c9f7629..f21e6a453 100644 --- a/testsupport/tiers/checks.go +++ b/testsupport/tiers/checks.go @@ -440,10 +440,10 @@ type appstudioTierChecks struct { func (a *appstudioTierChecks) GetNamespaceObjectChecks(_ string) []namespaceObjectsCheck { checks := []namespaceObjectsCheck{ - resourceQuotaComputeDeploy("20", "32Gi", "1750m", "32Gi"), - resourceQuotaComputeBuild("120", "128Gi", "12", "64Gi"), + resourceQuotaComputeDeploy("0", "32Gi", "1750m", "32Gi"), + resourceQuotaComputeBuild("0", "128Gi", "12", "64Gi"), resourceQuotaStorage("50Gi", "200Gi", "50Gi", "30"), - limitRange("2", "2Gi", "10m", "256Mi"), + limitRange("0", "2Gi", "10m", "256Mi"), numberOfLimitRanges(1), gitOpsServiceLabel(), appstudioWorkSpaceNameLabel(), @@ -539,6 +539,7 @@ type appstudiolargeTierChecks struct { func (a *appstudiolargeTierChecks) GetClusterObjectChecks() []clusterObjectsCheck { return clusterObjectsChecks( + resourceQuotaComputeBuild("", "512Gi", "24", "128Gi"), clusterResourceQuotaDeploymentCount("300", "100"), clusterResourceQuotaReplicaCount("100"), clusterResourceQuotaRouteCount("100"), From e7b7961cb0f619307c02682c0769ea37957b77ab Mon Sep 17 00:00:00 2001 From: Ann Marie Fred Date: Tue, 5 Dec 2023 16:26:17 -0500 Subject: [PATCH 02/11] update large tier test --- testsupport/tiers/checks.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsupport/tiers/checks.go b/testsupport/tiers/checks.go index f21e6a453..6161514e6 100644 --- a/testsupport/tiers/checks.go +++ b/testsupport/tiers/checks.go @@ -539,7 +539,7 @@ type appstudiolargeTierChecks struct { func (a *appstudiolargeTierChecks) GetClusterObjectChecks() []clusterObjectsCheck { return clusterObjectsChecks( - resourceQuotaComputeBuild("", "512Gi", "24", "128Gi"), + resourceQuotaComputeBuild("0", "512Gi", "24", "128Gi"), clusterResourceQuotaDeploymentCount("300", "100"), clusterResourceQuotaReplicaCount("100"), clusterResourceQuotaRouteCount("100"), From 686da300cc2f372ee8c64fba75a229d7ae31cd47 Mon Sep 17 00:00:00 2001 From: Ann Marie Fred Date: Thu, 14 Dec 2023 12:29:18 -0500 Subject: [PATCH 03/11] increase default CPU request --- testsupport/tiers/checks.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsupport/tiers/checks.go b/testsupport/tiers/checks.go index 6161514e6..e6e92242d 100644 --- a/testsupport/tiers/checks.go +++ b/testsupport/tiers/checks.go @@ -443,7 +443,7 @@ func (a *appstudioTierChecks) GetNamespaceObjectChecks(_ string) []namespaceObje resourceQuotaComputeDeploy("0", "32Gi", "1750m", "32Gi"), resourceQuotaComputeBuild("0", "128Gi", "12", "64Gi"), resourceQuotaStorage("50Gi", "200Gi", "50Gi", "30"), - limitRange("0", "2Gi", "10m", "256Mi"), + limitRange("0", "2Gi", "200m", "256Mi"), numberOfLimitRanges(1), gitOpsServiceLabel(), appstudioWorkSpaceNameLabel(), From 3e457cbb908a465b2d2fc20df84ea0a5825dfe86 Mon Sep 17 00:00:00 2001 From: Ann Marie Fred Date: Thu, 14 Dec 2023 13:16:07 -0500 Subject: [PATCH 04/11] test differently for appstudiolarge --- testsupport/tiers/checks.go | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/testsupport/tiers/checks.go b/testsupport/tiers/checks.go index e6e92242d..a28ba9699 100644 --- a/testsupport/tiers/checks.go +++ b/testsupport/tiers/checks.go @@ -539,7 +539,6 @@ type appstudiolargeTierChecks struct { func (a *appstudiolargeTierChecks) GetClusterObjectChecks() []clusterObjectsCheck { return clusterObjectsChecks( - resourceQuotaComputeBuild("0", "512Gi", "24", "128Gi"), clusterResourceQuotaDeploymentCount("300", "100"), clusterResourceQuotaReplicaCount("100"), clusterResourceQuotaRouteCount("100"), @@ -557,6 +556,25 @@ type appstudioEnvTierChecks struct { tierName string } +func (a *appstudioLargeTierChecks) GetNamespaceObjectChecks(_ string) []namespaceObjectsCheck { + checks := []namespaceObjectsCheck{ + resourceQuotaComputeDeploy("0", "32Gi", "1750m", "32Gi"), + resourceQuotaComputeBuild("0", "512Gi", "24", "128Gi"), + resourceQuotaStorage("50Gi", "200Gi", "50Gi", "30"), + limitRange("0", "2Gi", "200m", "256Mi"), + numberOfLimitRanges(1), + namespaceManagerSA(), + additionalArgocdReadRole(), + namespaceManagerSaAdditionalArgocdReadRoleBinding(), + namespaceManagerSaEditRoleBinding(), + gitOpsServiceLabel(), + appstudioWorkSpaceNameLabel(), + } + + checks = append(checks, append(commonNetworkPolicyChecks(), networkPolicyAllowFromCRW(), numberOfNetworkPolicies(6))...) + return checks +} + func (a *appstudioEnvTierChecks) GetNamespaceObjectChecks(_ string) []namespaceObjectsCheck { checks := []namespaceObjectsCheck{ resourceQuotaComputeDeploy("20", "32Gi", "1750m", "32Gi"), From 38d6704e24eebf4cbe52c3157e29ce0f5822e739 Mon Sep 17 00:00:00 2001 From: Ann Marie Fred Date: Fri, 15 Dec 2023 09:49:18 -0500 Subject: [PATCH 05/11] refactor --- testsupport/tiers/checks.go | 45 +++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/testsupport/tiers/checks.go b/testsupport/tiers/checks.go index a28ba9699..5a1211919 100644 --- a/testsupport/tiers/checks.go +++ b/testsupport/tiers/checks.go @@ -438,16 +438,11 @@ type appstudioTierChecks struct { tierName string } -func (a *appstudioTierChecks) GetNamespaceObjectChecks(_ string) []namespaceObjectsCheck { - checks := []namespaceObjectsCheck{ - resourceQuotaComputeDeploy("0", "32Gi", "1750m", "32Gi"), - resourceQuotaComputeBuild("0", "128Gi", "12", "64Gi"), - resourceQuotaStorage("50Gi", "200Gi", "50Gi", "30"), - limitRange("0", "2Gi", "200m", "256Mi"), - numberOfLimitRanges(1), + +func commonAppstudioTierChecks() []namespaceObjectsCheck { + return []namespaceObjectsCheck{ gitOpsServiceLabel(), appstudioWorkSpaceNameLabel(), - environment("development"), resourceQuotaToolchainCrds("32"), resourceQuotaAppstudioCrds("512", "512", "512"), resourceQuotaAppstudioCrdsBuild("512"), @@ -457,10 +452,21 @@ func (a *appstudioTierChecks) GetNamespaceObjectChecks(_ string) []namespaceObje resourceQuotaAppstudioCrdsEnterpriseContract("512"), resourceQuotaAppstudioCrdsSPI("512", "512", "512", "512", "512"), pipelineServiceAccount(), - pipelineRunnerRoleBinding(), + pipelineRunnerRoleBinding() } +} - checks = append(checks, append(commonNetworkPolicyChecks(), networkPolicyAllowFromCRW(), numberOfNetworkPolicies(6))...) +func (a *appstudioTierChecks) GetNamespaceObjectChecks(_ string) []namespaceObjectsCheck { + checks := []namespaceObjectsCheck{ + resourceQuotaComputeDeploy("0", "32Gi", "1750m", "32Gi"), + resourceQuotaComputeBuild("0", "128Gi", "12", "64Gi"), + resourceQuotaStorage("50Gi", "200Gi", "50Gi", "30"), + limitRange("0", "2Gi", "200m", "256Mi"), + numberOfLimitRanges(1), + environment("development") + } + + checks = append(checks, append(commonNetworkPolicyChecks(), networkPolicyAllowFromCRW(), numberOfNetworkPolicies(6), commonAppstudioTierChecks())...) return checks } @@ -552,29 +558,24 @@ func (a *appstudiolargeTierChecks) GetClusterObjectChecks() []clusterObjectsChec pipelineRunnerClusterRole()) } -type appstudioEnvTierChecks struct { - tierName string -} - -func (a *appstudioLargeTierChecks) GetNamespaceObjectChecks(_ string) []namespaceObjectsCheck { +func (a *appstudiolargeTierChecks) GetNamespaceObjectChecks(_ string) []namespaceObjectsCheck { checks := []namespaceObjectsCheck{ resourceQuotaComputeDeploy("0", "32Gi", "1750m", "32Gi"), resourceQuotaComputeBuild("0", "512Gi", "24", "128Gi"), resourceQuotaStorage("50Gi", "200Gi", "50Gi", "30"), limitRange("0", "2Gi", "200m", "256Mi"), numberOfLimitRanges(1), - namespaceManagerSA(), - additionalArgocdReadRole(), - namespaceManagerSaAdditionalArgocdReadRoleBinding(), - namespaceManagerSaEditRoleBinding(), - gitOpsServiceLabel(), - appstudioWorkSpaceNameLabel(), + environment("development") } - checks = append(checks, append(commonNetworkPolicyChecks(), networkPolicyAllowFromCRW(), numberOfNetworkPolicies(6))...) + checks = append(checks, append(commonNetworkPolicyChecks(), networkPolicyAllowFromCRW(), numberOfNetworkPolicies(6), commonAppstudioTierChecks())...) return checks } +type appstudioEnvTierChecks struct { + tierName string +} + func (a *appstudioEnvTierChecks) GetNamespaceObjectChecks(_ string) []namespaceObjectsCheck { checks := []namespaceObjectsCheck{ resourceQuotaComputeDeploy("20", "32Gi", "1750m", "32Gi"), From 1af1e1071abb805ca5c23cadb092e3c1b2f03d0c Mon Sep 17 00:00:00 2001 From: Ann Marie Fred Date: Fri, 15 Dec 2023 11:08:27 -0500 Subject: [PATCH 06/11] clean up syntax --- testsupport/tiers/checks.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/testsupport/tiers/checks.go b/testsupport/tiers/checks.go index 5a1211919..a352f791d 100644 --- a/testsupport/tiers/checks.go +++ b/testsupport/tiers/checks.go @@ -452,7 +452,7 @@ func commonAppstudioTierChecks() []namespaceObjectsCheck { resourceQuotaAppstudioCrdsEnterpriseContract("512"), resourceQuotaAppstudioCrdsSPI("512", "512", "512", "512", "512"), pipelineServiceAccount(), - pipelineRunnerRoleBinding() + pipelineRunnerRoleBinding(), } } @@ -463,10 +463,11 @@ func (a *appstudioTierChecks) GetNamespaceObjectChecks(_ string) []namespaceObje resourceQuotaStorage("50Gi", "200Gi", "50Gi", "30"), limitRange("0", "2Gi", "200m", "256Mi"), numberOfLimitRanges(1), - environment("development") + environment("development"), } - checks = append(checks, append(commonNetworkPolicyChecks(), networkPolicyAllowFromCRW(), numberOfNetworkPolicies(6), commonAppstudioTierChecks())...) + checks = append(checks, commonAppstudioTierChecks()...) + checks = append(checks, append(commonNetworkPolicyChecks(), networkPolicyAllowFromCRW(), numberOfNetworkPolicies(6))...) return checks } @@ -565,10 +566,12 @@ func (a *appstudiolargeTierChecks) GetNamespaceObjectChecks(_ string) []namespac resourceQuotaStorage("50Gi", "200Gi", "50Gi", "30"), limitRange("0", "2Gi", "200m", "256Mi"), numberOfLimitRanges(1), - environment("development") + environment("development"), } - checks = append(checks, append(commonNetworkPolicyChecks(), networkPolicyAllowFromCRW(), numberOfNetworkPolicies(6), commonAppstudioTierChecks())...) + + checks = append(checks, commonAppstudioTierChecks()...) + checks = append(checks, append(commonNetworkPolicyChecks(), networkPolicyAllowFromCRW(), numberOfNetworkPolicies(6))...) return checks } From 0d9ffbe00e8350c50677c3e39a7b06a47441310d Mon Sep 17 00:00:00 2001 From: Ann Marie Fred Date: Mon, 18 Dec 2023 12:27:59 -0500 Subject: [PATCH 07/11] added tests for appstudiolarge tier --- test/migration/setup_runner.go | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/test/migration/setup_runner.go b/test/migration/setup_runner.go index 4e798bc9e..0d1384de2 100644 --- a/test/migration/setup_runner.go +++ b/test/migration/setup_runner.go @@ -28,9 +28,11 @@ const ( DeactivatedUser = "mig-deact" BannedUser = "mig-banned" AppStudioProvisionedUser = "mig-appst" + AppStudioProvisionedUserLarge = "mig-appst-large" SecondMemberProvisionedUser = "mig-m2-user" ProvisionedAppStudioSpace = "mig-appst-space" + ProvisionedAppStudioSpaceLarge = "mig-appst-large-space" SecondMemberProvisionedSpace = "mig-m2-space" ProvisionedSpaceRequest = "mig-space-request" ProvisionedParentSpace = "mig-parent-space" @@ -46,13 +48,15 @@ func (r *SetupMigrationRunner) Run(t *testing.T) { toRun := []func(t *testing.T){ r.prepareAppStudioProvisionedSpace, + r.prepareAppStudioProvisionedSpaceLarge, r.prepareSecondMemberProvisionedSpace, r.prepareProvisionedSubspace, r.prepareProvisionedUser, r.prepareSecondMemberProvisionedUser, r.prepareDeactivatedUser, r.prepareBannedUser, - r.prepareAppStudioProvisionedUser} + r.prepareAppStudioProvisionedUser, + r.prepareAppStudioProvisionedUserLarge} for _, funcToRun := range toRun { wg.Add(1) @@ -69,6 +73,10 @@ func (r *SetupMigrationRunner) prepareAppStudioProvisionedSpace(t *testing.T) { r.createAndWaitForSpace(t, ProvisionedAppStudioSpace, "appstudio", r.Awaitilities.Member1()) } +func (r *SetupMigrationRunner) prepareAppStudioProvisionedSpaceLarge(t *testing.T) { + r.createAndWaitForSpace(t, ProvisionedAppStudioSpaceLarge, "appstudiolarge", r.Awaitilities.Member1()) +} + func (r *SetupMigrationRunner) prepareSecondMemberProvisionedSpace(t *testing.T) { r.createAndWaitForSpace(t, SecondMemberProvisionedSpace, "base", r.Awaitilities.Member2()) } @@ -198,6 +206,21 @@ func (r *SetupMigrationRunner) prepareAppStudioProvisionedUser(t *testing.T) { require.NoError(t, err) } +func (r *SetupMigrationRunner) prepareAppStudioProvisionedUserLarge(t *testing.T) { + usersignup := r.prepareUser(t, AppStudioProvisionedUserLarge, r.Awaitilities.Member1()) + hostAwait := r.Awaitilities.Host() + + // promote to appstudio + tiers.MoveSpaceToTier(t, hostAwait, usersignup.Status.CompliantUsername, "appstudiolarge") + + t.Logf("user %s was promoted to appstudiolarge tier", AppStudioProvisionedUserLarge) + + // verify that it's promoted + _, err := r.Awaitilities.Host().WaitForMasterUserRecord(t, usersignup.Status.CompliantUsername, + wait.UntilMasterUserRecordHasConditions(wait.Provisioned(), wait.ProvisionedNotificationCRCreated())) + require.NoError(t, err) +} + func (r *SetupMigrationRunner) prepareUser(t *testing.T, name string, targetCluster *wait.MemberAwaitility) *toolchainv1alpha1.UserSignup { requestBuilder := testsupport.NewSignupRequest(r.Awaitilities). Username(name). From a16271a9ad68c7c87aca80fd5f4dd564e79ad236 Mon Sep 17 00:00:00 2001 From: Ann Marie Fred Date: Mon, 18 Dec 2023 17:03:19 -0500 Subject: [PATCH 08/11] different check for no cpu limit --- test/migration/setup_runner.go | 2 +- testsupport/tiers/checks.go | 29 ++++++++++++++++++----------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/test/migration/setup_runner.go b/test/migration/setup_runner.go index 0d1384de2..f302871d0 100644 --- a/test/migration/setup_runner.go +++ b/test/migration/setup_runner.go @@ -210,7 +210,7 @@ func (r *SetupMigrationRunner) prepareAppStudioProvisionedUserLarge(t *testing.T usersignup := r.prepareUser(t, AppStudioProvisionedUserLarge, r.Awaitilities.Member1()) hostAwait := r.Awaitilities.Host() - // promote to appstudio + // promote to appstudiolarge tiers.MoveSpaceToTier(t, hostAwait, usersignup.Status.CompliantUsername, "appstudiolarge") t.Logf("user %s was promoted to appstudiolarge tier", AppStudioProvisionedUserLarge) diff --git a/testsupport/tiers/checks.go b/testsupport/tiers/checks.go index a352f791d..9f34b9ced 100644 --- a/testsupport/tiers/checks.go +++ b/testsupport/tiers/checks.go @@ -438,7 +438,6 @@ type appstudioTierChecks struct { tierName string } - func commonAppstudioTierChecks() []namespaceObjectsCheck { return []namespaceObjectsCheck{ gitOpsServiceLabel(), @@ -458,10 +457,10 @@ func commonAppstudioTierChecks() []namespaceObjectsCheck { func (a *appstudioTierChecks) GetNamespaceObjectChecks(_ string) []namespaceObjectsCheck { checks := []namespaceObjectsCheck{ - resourceQuotaComputeDeploy("0", "32Gi", "1750m", "32Gi"), - resourceQuotaComputeBuild("0", "128Gi", "12", "64Gi"), + resourceQuotaComputeDeploy("", "32Gi", "1750m", "32Gi"), + resourceQuotaComputeBuild("", "128Gi", "12", "64Gi"), resourceQuotaStorage("50Gi", "200Gi", "50Gi", "30"), - limitRange("0", "2Gi", "200m", "256Mi"), + limitRange("", "2Gi", "200m", "256Mi"), numberOfLimitRanges(1), environment("development"), } @@ -561,10 +560,10 @@ func (a *appstudiolargeTierChecks) GetClusterObjectChecks() []clusterObjectsChec func (a *appstudiolargeTierChecks) GetNamespaceObjectChecks(_ string) []namespaceObjectsCheck { checks := []namespaceObjectsCheck{ - resourceQuotaComputeDeploy("0", "32Gi", "1750m", "32Gi"), - resourceQuotaComputeBuild("0", "512Gi", "24", "128Gi"), + resourceQuotaComputeDeploy("", "32Gi", "1750m", "32Gi"), + resourceQuotaComputeBuild("", "512Gi", "24", "128Gi"), resourceQuotaStorage("50Gi", "200Gi", "50Gi", "30"), - limitRange("0", "2Gi", "200m", "256Mi"), + limitRange("", "2Gi", "200m", "256Mi"), numberOfLimitRanges(1), environment("development"), } @@ -755,8 +754,10 @@ func resourceQuotaComputeDeploy(cpuLimit, memoryLimit, cpuRequest, memoryRequest Scopes: []corev1.ResourceQuotaScope{corev1.ResourceQuotaScopeNotTerminating}, Hard: make(map[corev1.ResourceName]resource.Quantity), } - spec.Hard[corev1.ResourceLimitsCPU], err = resource.ParseQuantity(cpuLimit) - require.NoError(t, err) + if cpuLimit != "" { + spec.Hard[corev1.ResourceLimitsCPU], err = resource.ParseQuantity(cpuLimit) + require.NoError(t, err) + } spec.Hard[corev1.ResourceLimitsMemory], err = resource.ParseQuantity(memoryLimit) require.NoError(t, err) spec.Hard[corev1.ResourceRequestsCPU], err = resource.ParseQuantity(cpuRequest) @@ -777,8 +778,10 @@ func resourceQuotaComputeBuild(cpuLimit, memoryLimit, cpuRequest, memoryRequest Scopes: []corev1.ResourceQuotaScope{corev1.ResourceQuotaScopeTerminating}, Hard: make(map[corev1.ResourceName]resource.Quantity), } - spec.Hard[corev1.ResourceLimitsCPU], err = resource.ParseQuantity(cpuLimit) - require.NoError(t, err) + if cpuLimit != "" { + spec.Hard[corev1.ResourceLimitsCPU], err = resource.ParseQuantity(cpuLimit) + require.NoError(t, err) + } spec.Hard[corev1.ResourceLimitsMemory], err = resource.ParseQuantity(memoryLimit) require.NoError(t, err) spec.Hard[corev1.ResourceRequestsCPU], err = resource.ParseQuantity(cpuRequest) @@ -990,6 +993,10 @@ func limitRange(cpuLimit, memoryLimit, cpuRequest, memoryRequest string) namespa lr, err := memberAwait.WaitForLimitRange(t, ns, "resource-limits") require.NoError(t, err) def := make(map[corev1.ResourceName]resource.Quantity) + if cpuLimit != "" { + def[corev1.ResourceCPU], err = resource.ParseQuantity(cpuLimit) + require.NoError(t, err) + } def[corev1.ResourceCPU], err = resource.ParseQuantity(cpuLimit) require.NoError(t, err) def[corev1.ResourceMemory], err = resource.ParseQuantity(memoryLimit) From 6a3158498be22cb1f8cf145a4bd74603bfbb8a29 Mon Sep 17 00:00:00 2001 From: Ann Marie Fred Date: Mon, 18 Dec 2023 19:23:32 -0500 Subject: [PATCH 09/11] fixed a typo --- testsupport/tiers/checks.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/testsupport/tiers/checks.go b/testsupport/tiers/checks.go index 9f34b9ced..d8a0798d7 100644 --- a/testsupport/tiers/checks.go +++ b/testsupport/tiers/checks.go @@ -568,7 +568,6 @@ func (a *appstudiolargeTierChecks) GetNamespaceObjectChecks(_ string) []namespac environment("development"), } - checks = append(checks, commonAppstudioTierChecks()...) checks = append(checks, append(commonNetworkPolicyChecks(), networkPolicyAllowFromCRW(), numberOfNetworkPolicies(6))...) return checks @@ -997,8 +996,6 @@ func limitRange(cpuLimit, memoryLimit, cpuRequest, memoryRequest string) namespa def[corev1.ResourceCPU], err = resource.ParseQuantity(cpuLimit) require.NoError(t, err) } - def[corev1.ResourceCPU], err = resource.ParseQuantity(cpuLimit) - require.NoError(t, err) def[corev1.ResourceMemory], err = resource.ParseQuantity(memoryLimit) require.NoError(t, err) defReq := make(map[corev1.ResourceName]resource.Quantity) From 16f3fb30f0bf962bf3535af0d71c2c3af11cfa66 Mon Sep 17 00:00:00 2001 From: Ann Marie Fred Date: Tue, 19 Dec 2023 00:20:03 -0500 Subject: [PATCH 10/11] removed broken test --- test/migration/setup_runner.go | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/test/migration/setup_runner.go b/test/migration/setup_runner.go index f302871d0..4e798bc9e 100644 --- a/test/migration/setup_runner.go +++ b/test/migration/setup_runner.go @@ -28,11 +28,9 @@ const ( DeactivatedUser = "mig-deact" BannedUser = "mig-banned" AppStudioProvisionedUser = "mig-appst" - AppStudioProvisionedUserLarge = "mig-appst-large" SecondMemberProvisionedUser = "mig-m2-user" ProvisionedAppStudioSpace = "mig-appst-space" - ProvisionedAppStudioSpaceLarge = "mig-appst-large-space" SecondMemberProvisionedSpace = "mig-m2-space" ProvisionedSpaceRequest = "mig-space-request" ProvisionedParentSpace = "mig-parent-space" @@ -48,15 +46,13 @@ func (r *SetupMigrationRunner) Run(t *testing.T) { toRun := []func(t *testing.T){ r.prepareAppStudioProvisionedSpace, - r.prepareAppStudioProvisionedSpaceLarge, r.prepareSecondMemberProvisionedSpace, r.prepareProvisionedSubspace, r.prepareProvisionedUser, r.prepareSecondMemberProvisionedUser, r.prepareDeactivatedUser, r.prepareBannedUser, - r.prepareAppStudioProvisionedUser, - r.prepareAppStudioProvisionedUserLarge} + r.prepareAppStudioProvisionedUser} for _, funcToRun := range toRun { wg.Add(1) @@ -73,10 +69,6 @@ func (r *SetupMigrationRunner) prepareAppStudioProvisionedSpace(t *testing.T) { r.createAndWaitForSpace(t, ProvisionedAppStudioSpace, "appstudio", r.Awaitilities.Member1()) } -func (r *SetupMigrationRunner) prepareAppStudioProvisionedSpaceLarge(t *testing.T) { - r.createAndWaitForSpace(t, ProvisionedAppStudioSpaceLarge, "appstudiolarge", r.Awaitilities.Member1()) -} - func (r *SetupMigrationRunner) prepareSecondMemberProvisionedSpace(t *testing.T) { r.createAndWaitForSpace(t, SecondMemberProvisionedSpace, "base", r.Awaitilities.Member2()) } @@ -206,21 +198,6 @@ func (r *SetupMigrationRunner) prepareAppStudioProvisionedUser(t *testing.T) { require.NoError(t, err) } -func (r *SetupMigrationRunner) prepareAppStudioProvisionedUserLarge(t *testing.T) { - usersignup := r.prepareUser(t, AppStudioProvisionedUserLarge, r.Awaitilities.Member1()) - hostAwait := r.Awaitilities.Host() - - // promote to appstudiolarge - tiers.MoveSpaceToTier(t, hostAwait, usersignup.Status.CompliantUsername, "appstudiolarge") - - t.Logf("user %s was promoted to appstudiolarge tier", AppStudioProvisionedUserLarge) - - // verify that it's promoted - _, err := r.Awaitilities.Host().WaitForMasterUserRecord(t, usersignup.Status.CompliantUsername, - wait.UntilMasterUserRecordHasConditions(wait.Provisioned(), wait.ProvisionedNotificationCRCreated())) - require.NoError(t, err) -} - func (r *SetupMigrationRunner) prepareUser(t *testing.T, name string, targetCluster *wait.MemberAwaitility) *toolchainv1alpha1.UserSignup { requestBuilder := testsupport.NewSignupRequest(r.Awaitilities). Username(name). From 77da8e00a793a2dda0c2f570df5e5553db5673bb Mon Sep 17 00:00:00 2001 From: Ann Marie Fred Date: Wed, 20 Dec 2023 09:08:20 -0500 Subject: [PATCH 11/11] add creation of appstudiolarge tier space --- test/e2e/parallel/space_test.go | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/test/e2e/parallel/space_test.go b/test/e2e/parallel/space_test.go index 46fde9074..b7873b83a 100644 --- a/test/e2e/parallel/space_test.go +++ b/test/e2e/parallel/space_test.go @@ -25,7 +25,7 @@ func TestCreateSpace(t *testing.T) { hostAwait := awaitilities.Host() memberAwait := awaitilities.Member1() - t.Run("create space", func(t *testing.T) { + t.Run("create appstudio tier space", func(t *testing.T) { // when space, _, _ := CreateSpace(t, awaitilities, testspace.WithTierName("appstudio"), testspace.WithSpecTargetCluster(memberAwait.ClusterName)) // then @@ -49,6 +49,30 @@ func TestCreateSpace(t *testing.T) { }) }) + t.Run("create appstudiolarge tier space", func(t *testing.T) { + // when + space, _, _ := CreateSpace(t, awaitilities, testspace.WithTierName("appstudiolarge"), testspace.WithSpecTargetCluster(memberAwait.ClusterName)) + // then + VerifyResourcesProvisionedForSpace(t, awaitilities, space.Name, UntilSpaceHasStatusTargetCluster(memberAwait.ClusterName)) + + t.Run("delete space", func(t *testing.T) { + // now, delete the Space and expect that the NSTemplateSet will be deleted as well, + // along with its associated namespace + + // when + err := hostAwait.Client.Delete(context.TODO(), space) + + // then + require.NoError(t, err) + err = hostAwait.WaitUntilSpaceAndSpaceBindingsDeleted(t, space.Name) + require.NoError(t, err) + err = memberAwait.WaitUntilNSTemplateSetDeleted(t, space.Name) + require.NoError(t, err) + err = memberAwait.WaitUntilNamespaceDeleted(t, space.Name, "appstudiolarge") + require.NoError(t, err) + }) + }) + t.Run("failed to create space - unknown target member cluster", func(t *testing.T) { // given & when s, _, _ := CreateSpace(t, awaitilities, testspace.WithTierName("appstudio"), testspace.WithSpecTargetCluster("unknown"))