From 0c385c92fd63315225dde4092f46be0479ef296d Mon Sep 17 00:00:00 2001 From: Alexey Kazakov Date: Mon, 4 Nov 2024 23:35:56 -0800 Subject: [PATCH] Tests for intel-x-large tier (#1058) --- test/e2e/parallel/nstemplatetier_test.go | 6 +++--- testsupport/tiers/checks.go | 19 +++++++++++++++++-- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/test/e2e/parallel/nstemplatetier_test.go b/test/e2e/parallel/nstemplatetier_test.go index d2136ceb2..c2a3fc983 100644 --- a/test/e2e/parallel/nstemplatetier_test.go +++ b/test/e2e/parallel/nstemplatetier_test.go @@ -49,7 +49,7 @@ func TestNSTemplateTiers(t *testing.T) { space := user.Space // all tiers to check - keep the base as the last one, it will verify downgrade back to the default tier at the end of the test - tiersToCheck := []string{"advanced", "baseextendedidling", "baselarge", "test", "appstudio", "appstudiolarge", "appstudio-env", "base1ns", "base1nsnoidling", "base1ns6didler", "intelmedium", "intellarge", "base"} + tiersToCheck := []string{"advanced", "baseextendedidling", "baselarge", "test", "appstudio", "appstudiolarge", "appstudio-env", "base1ns", "base1nsnoidling", "base1ns6didler", "intelmedium", "intellarge", "intelxlarge", "base"} // when the tiers are created during the startup then we can verify them allTiers := &toolchainv1alpha1.NSTemplateTierList{} @@ -281,9 +281,9 @@ func TestTierTemplates(t *testing.T) { allTiers := &toolchainv1alpha1.TierTemplateList{} err = hostAwait.Client.List(context.TODO(), allTiers, client.InNamespace(hostAwait.Namespace), notCreatedByE2e) require.NoError(t, err) - // We have 27 tier templates (base: 3, base1ns: 2, base1nsnoidling: 2, base1ns6didler: 3, baselarge: 3, baseextendedidling: 3, advanced: 3, test: 3, appstudio: 3, appstudiolarge: 3, appstudio-env: 3, intelmedium: 2, intellarge: 2) + // We have 29 tier templates (base: 3, base1ns: 2, base1nsnoidling: 2, base1ns6didler: 3, baselarge: 3, baseextendedidling: 3, advanced: 3, test: 3, appstudio: 3, appstudiolarge: 3, appstudio-env: 3, intelmedium: 2, intellarge: 2, intelxlarge: 2) // But we cannot verify the exact number of tiers, because during the operator update it may happen that more TierTemplates are created - assert.GreaterOrEqual(t, len(allTiers.Items), 31) + assert.GreaterOrEqual(t, len(allTiers.Items), 33) } func TestFeatureToggles(t *testing.T) { diff --git a/testsupport/tiers/checks.go b/testsupport/tiers/checks.go index 43f44777d..2b1d274a0 100644 --- a/testsupport/tiers/checks.go +++ b/testsupport/tiers/checks.go @@ -39,6 +39,7 @@ const ( testTier = "test" intelMedium = "intelmedium" intelLarge = "intellarge" + intelXLarge = "intelxlarge" // common CPU limits baseCPULimit = "40000m" @@ -83,6 +84,8 @@ func NewChecksForTier(tier *toolchainv1alpha1.NSTemplateTier) (TierChecks, error return &intelMediumTierChecks{tierName: intelMedium}, nil case intelLarge: return &intelLargeTierChecks{intelMediumTierChecks{tierName: intelLarge}}, nil + case intelXLarge: + return &intelXLargeTierChecks{intelLargeTierChecks{intelMediumTierChecks{tierName: intelXLarge}}}, nil default: return nil, fmt.Errorf("no assertion implementation found for %s", tier.Name) } @@ -710,9 +713,21 @@ type intelLargeTierChecks struct { } func (a *intelLargeTierChecks) GetNamespaceObjectChecks(_ string) []namespaceObjectsCheck { + return getNamespaceObjectChecksForIntelLarge("32Gi") +} + +type intelXLargeTierChecks struct { + intelLargeTierChecks +} + +func (a *intelXLargeTierChecks) GetNamespaceObjectChecks(_ string) []namespaceObjectsCheck { + return getNamespaceObjectChecksForIntelLarge("64Gi") +} + +func getNamespaceObjectChecksForIntelLarge(memoryLimit string) []namespaceObjectsCheck { checks := []namespaceObjectsCheck{ - resourceQuotaComputeDeploy("16", "32Gi", "16", "32Gi"), - resourceQuotaComputeBuild("16", "32Gi", "16", "32Gi"), + resourceQuotaComputeDeploy("16", memoryLimit, "16", memoryLimit), + resourceQuotaComputeBuild("16", memoryLimit, "16", memoryLimit), resourceQuotaStorage("15Gi", "100Gi", "15Gi", "5"), limitRange("1", "1000Mi", "10m", "64Mi"), numberOfLimitRanges(1),