Skip to content

Commit

Permalink
feat(STONEBLD-2371): Multi platform controller tests
Browse files Browse the repository at this point in the history
Add in-repo tests for multi platform controller
  • Loading branch information
stuartwdouglas committed Apr 30, 2024
1 parent 317aa01 commit ed7235a
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 24 deletions.
9 changes: 6 additions & 3 deletions magefiles/magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ func (ci CI) TestE2E() error {
}

func RunE2ETests() error {
labelFilter := utils.GetEnv("E2E_TEST_SUITE_LABEL", "!upgrade-create && !upgrade-verify && !upgrade-cleanup && !release-pipelines")
labelFilter := utils.GetEnv("E2E_TEST_SUITE_LABEL", "!upgrade-create && !upgrade-verify && !upgrade-cleanup && !release-pipelines && !multi-platform-dynamic")
return runTests(labelFilter, "e2e-report.xml")
}

Expand Down Expand Up @@ -485,6 +485,9 @@ func setRequiredEnvVars() error {
envVarPrefix = "MULTI_PLATFORM_CONTROLLER"
imageTagSuffix = "multi-platform-controller"
testSuiteLabel = "multi-platform"
im := strings.Split(os.Getenv("OTP_SERVER_IMAGE"), "@")
os.Setenv("MULTI_PLATFORM_CONTROLLER_OTP_IMAGE_REPO", im[0])
os.Setenv("MULTI_PLATFORM_CONTROLLER_OTP_IMAGE_TAG", im[1])
requiresMultiPlatformTests = true
}

Expand All @@ -503,12 +506,12 @@ func setRequiredEnvVars() error {
requiresSprayProxyRegistering = true
os.Setenv("INFRA_DEPLOYMENTS_ORG", pr.RemoteName)
os.Setenv("INFRA_DEPLOYMENTS_BRANCH", pr.BranchName)
/* Disabling "build tests" temporary due:
/* Disabling "build tests" and multi-platform tests temporary due:
TODO: Enable when issues are done:
https://issues.redhat.com/browse/RHTAPBUGS-992, https://issues.redhat.com/browse/RHTAPBUGS-991, https://issues.redhat.com/browse/RHTAPBUGS-989,
https://issues.redhat.com/browse/RHTAPBUGS-978,https://issues.redhat.com/browse/RHTAPBUGS-956
*/
os.Setenv("E2E_TEST_SUITE_LABEL", "e2e-demo,rhtap-demo,spi-suite,remote-secret,integration-service,ec,byoc,build-templates,multi-platform")
os.Setenv("E2E_TEST_SUITE_LABEL", "e2e-demo,rhtap-demo,spi-suite,remote-secret,integration-service,ec,byoc,build-templates")
} else if strings.Contains(jobName, "release-service-catalog") { // release-service-catalog jobs (pull, rehearsal)
envVarPrefix := "RELEASE_SERVICE"
os.Setenv("E2E_TEST_SUITE_LABEL", "release-pipelines")
Expand Down
43 changes: 22 additions & 21 deletions tests/build/multi-platform.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,23 @@ import (
)

const (
Ec2ArmTag = "multi-platform-e2e-arm64"
HostConfig = "host-config"
ControllerNamespace = "multi-platform-controller"
AwsSecretName = "awskeys"
IbmSecretName = "ibmkey"
IbmKey = "multi-platform-tests"
SshSecretName = "sshkeys"
Ec2User = "ec2-user"
AwsRegion = "us-east-1"
AwsPlatform = "linux/arm64"
DynamicMaxInstances = "1"
IbmZUrl = "https://us-east.iaas.cloud.ibm.com/v1"
IbmPUrl = "https://us-south.power-iaas.cloud.ibm.com"
CRN = "crn:v1:bluemix:public:power-iaas:dal10:a/934e118c399b4a28a70afdf2210d708f:8c9ef568-16a5-4aa2-bfd5-946349c9aeac::"
MultiPlatformSecretKey = "build.appstudio.redhat.com/multi-platform-secret"
MultiPlatformConfigKey = "build.appstudio.redhat.com/multi-platform-config"
Ec2ArmTag = "multi-platform-e2e-arm64"
HostConfig = "host-config"
ControllerNamespace = "multi-platform-controller"
AwsSecretName = "awskeys"
IbmSecretName = "ibmkey"
IbmKey = "multi-platform-tests"
SshSecretName = "sshkeys"
Ec2User = "ec2-user"
AwsRegion = "us-east-1"
AwsPlatform = "linux/arm64"
DynamicMaxInstances = "1"
IbmZUrl = "https://us-east.iaas.cloud.ibm.com/v1"
IbmPUrl = "https://us-south.power-iaas.cloud.ibm.com"
CRN = "crn:v1:bluemix:public:power-iaas:dal10:a/934e118c399b4a28a70afdf2210d708f:8c9ef568-16a5-4aa2-bfd5-946349c9aeac::"
MultiPlatformSecretKey = "build.appstudio.redhat.com/multi-platform-secret"
MultiPlatformConfigKey = "build.appstudio.redhat.com/multi-platform-config"
MultiPlatformDynamicLabel = "multi-platform-dynamic"
)

var (
Expand All @@ -62,7 +63,7 @@ var (
interval = 10 * time.Second
)

var _ = framework.MultiPlatformBuildSuiteDescribe("Multi Platform Controller E2E tests", Pending, Label("multi-platform"), func() {
var _ = framework.MultiPlatformBuildSuiteDescribe("Multi Platform Controller E2E tests", Label("multi-platform"), func() {
var f *framework.Framework
AfterEach(framework.ReportFailure(&f))
var err error
Expand Down Expand Up @@ -181,7 +182,7 @@ var _ = framework.MultiPlatformBuildSuiteDescribe("Multi Platform Controller E2E
})
})
})
Describe("aws dynamic allocation", Label("aws-dynamic"), func() {
Describe("aws dynamic allocation", Label("aws-dynamic"), Label(MultiPlatformDynamicLabel), func() {
var testNamespace, applicationName, componentName, multiPlatformSecretName, multiPlatformTaskName, dynamicInstanceTag, instanceId string
var component *appservice.Component

Expand Down Expand Up @@ -266,7 +267,7 @@ var _ = framework.MultiPlatformBuildSuiteDescribe("Multi Platform Controller E2E
})
})
// TODO: Enable the test after https://issues.redhat.com/browse/KFLUXBUGS-1179 is fixed
Describe("ibm system z dynamic allocation", Label("ibmz-dynamic"), Pending, func() {
Describe("ibm system z dynamic allocation", Label("ibmz-dynamic"), Label(MultiPlatformDynamicLabel), Pending, func() {
var testNamespace, applicationName, componentName, multiPlatformSecretName, multiPlatformTaskName, dynamicInstanceTag, instanceId string
var component *appservice.Component

Expand Down Expand Up @@ -348,7 +349,7 @@ var _ = framework.MultiPlatformBuildSuiteDescribe("Multi Platform Controller E2E
})
})
// TODO: Enable the test after https://issues.redhat.com/browse/KFLUXBUGS-1179 is fixed
Describe("ibm power pc dynamic allocation", Label("ibmp-dynamic"), Pending, func() {
Describe("ibm power pc dynamic allocation", Label("ibmp-dynamic"), Label(MultiPlatformDynamicLabel), Pending, func() {
var testNamespace, applicationName, componentName, multiPlatformSecretName, multiPlatformTaskName, dynamicInstanceTag, instanceId string
var component *appservice.Component

Expand Down Expand Up @@ -900,7 +901,7 @@ func createConfigMapForDynamicInstance(f *framework.Framework, instanceTag strin
hostConfig.Data["dynamic.linux-arm64.region"] = AwsRegion
hostConfig.Data["dynamic.linux-arm64.ami"] = "ami-09d5d0912f52f9514"
hostConfig.Data["dynamic.linux-arm64.instance-type"] = "t4g.micro"
hostConfig.Data["dynamic.linux-arm64.key-name"] = "multi-platform-e2e"
hostConfig.Data["dynamic.linux-arm64.key-name"] = "multi-platform-e2e-tests"
hostConfig.Data["dynamic.linux-arm64.aws-secret"] = AwsSecretName
hostConfig.Data["dynamic.linux-arm64.ssh-secret"] = SshSecretName
hostConfig.Data["dynamic.linux-arm64.security-group"] = "launch-wizard-7"
Expand Down

0 comments on commit ed7235a

Please sign in to comment.