Skip to content

Commit

Permalink
OCM-10024 | ci: fix id:75150,73731,73492
Browse files Browse the repository at this point in the history
  • Loading branch information
aaraj7 committed Aug 5, 2024
1 parent ea34107 commit 868ddc8
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 24 deletions.
1 change: 1 addition & 0 deletions tests/ci/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ func init() {
NamePrefix: os.Getenv("NAME_PREFIX"),
SVPC_CREDENTIALS_FILE: os.Getenv("SHARED_VPC_AWS_SHARED_CREDENTIALS_FILE"),
ComputeMachineType: os.Getenv("COMPUTE_MACHINE_TYPE"),
OCM_LOGIN_ENV: os.Getenv("OCM_LOGIN_ENV"),
ClusterWaitingTime: waitingTime,
WaitSetupClusterReady: waitSetupClusterReady,
}
Expand Down
10 changes: 1 addition & 9 deletions tests/e2e/test_rosacli_cluster_post.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
. "github.com/onsi/gomega"
"github.com/openshift-online/ocm-common/pkg/aws/aws_client"

ciConfig "github.com/openshift/rosa/tests/ci/config"
"github.com/openshift/rosa/tests/ci/labels"
"github.com/openshift/rosa/tests/utils/common"
"github.com/openshift/rosa/tests/utils/common/constants"
Expand Down Expand Up @@ -370,14 +369,7 @@ var _ = Describe("Healthy check",
By("Check compute machine type")
jsonData, err := clusterService.GetJSONClusterDescription(clusterID)
Expect(err).To(BeNil())
if ciConfig.Test.GlobalENV.ComputeMachineType != "" {
Expect(jsonData.DigString("nodes", "compute_machine_type", "id")).To(
Equal(ciConfig.Test.GlobalENV.ComputeMachineType))
} else if profile.ClusterConfig.InstanceType == "" {
Expect(jsonData.DigString("nodes", "compute_machine_type", "id")).To(Equal(constants.DefaultInstanceType))
} else {
Expect(jsonData.DigString("nodes", "compute_machine_type", "id")).To(Equal(profile.ClusterConfig.InstanceType))
}
Expect(jsonData.DigString("nodes", "compute_machine_type", "id")).To(Equal(clusterConfig.Nodes.ComputeInstanceType))
})
})

Expand Down
17 changes: 6 additions & 11 deletions tests/e2e/test_rosacli_node_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

ciConfig "github.com/openshift/rosa/tests/ci/config"
"github.com/openshift/rosa/tests/ci/labels"
"github.com/openshift/rosa/tests/utils/common"
"github.com/openshift/rosa/tests/utils/common/constants"
Expand Down Expand Up @@ -1007,21 +1006,17 @@ var _ = Describe("Edit nodepool",
Expect(err).To(BeNil())
rosaClient.Runner.UnsetFormat()
organizationID := userInfo.OCMOrganizationID
ocmApi := userInfo.OCMApi

var OCMEnv string

By("Get OCM Env")
if ciConfig.Test.GlobalENV.OCM_LOGIN_ENV != "" {
OCM_LOGIN_ENV := ciConfig.Test.GlobalENV.OCM_LOGIN_ENV
if strings.Contains(OCM_LOGIN_ENV, "staging") ||
strings.Contains(OCM_LOGIN_ENV, "stage") {
OCMEnv = "staging"
} else if strings.Contains(OCM_LOGIN_ENV, "production") ||
strings.Contains(OCM_LOGIN_ENV, "prod") {
OCMEnv = "production"
}
if strings.Contains(ocmApi, "stage") {
OCMEnv = "staging"
} else if strings.Contains(ocmApi, "integration") {
OCMEnv = "integration"
} else {
OCMEnv = common.ReadENVWithDefaultValue("OCM_LOGIN_ENV", "staging")
OCMEnv = "production"
}

By("Get the cluster informations")
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/test_rosacli_upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ var _ = Describe("Cluster Upgrade testing",
output, err = upgradeService.Upgrade(
"-c", clusterID,
"--version", upgradingVersion,
"--mode", "auto", "--hosted-cp",
"--mode", "auto", "--control-plane",
"-y",
)
}
Expand Down
7 changes: 4 additions & 3 deletions tests/utils/config/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@ type Subnets struct {
}

type Nodes struct {
Replicas string `json:"replicas,omitempty"`
MinReplicas string `json:"min_replicas,omitempty"`
MaxReplicas string `json:"max_replicas,omitempty"`
Replicas string `json:"replicas,omitempty"`
MinReplicas string `json:"min_replicas,omitempty"`
MaxReplicas string `json:"max_replicas,omitempty"`
ComputeInstanceType string `json:"compute_instance_type,omitempty"`
}

type Autoscaling struct {
Expand Down
1 change: 1 addition & 0 deletions tests/utils/profilehandler/profile_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,7 @@ func GenerateClusterCreateFlags(profile *Profile, client *rosacli.Client) ([]str
}
if profile.ClusterConfig.InstanceType != "" {
flags = append(flags, "--compute-machine-type", profile.ClusterConfig.InstanceType)
clusterConfiguration.Nodes.ComputeInstanceType = profile.ClusterConfig.InstanceType
}
if profile.ClusterConfig.KMSKey {
kmsKeyArn, err := PrepareKMSKey(profile.Region, false, "rosacli", profile.ClusterConfig.HCP, false)
Expand Down

0 comments on commit 868ddc8

Please sign in to comment.