Skip to content

Commit

Permalink
Remove baremetal-branch flag from the integration test CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
sp1999 committed Nov 2, 2024
1 parent fd108f5 commit c15e109
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ phases:
--cleanup-resources=true
--test-report-folder=reports
--branch-name=${BRANCH_NAME}
--baremetal-branch=${BAREMETAL_BRANCH}
post_build:
commands:
- unset AWS_SDK_LOAD_CONFIG AWS_PROFILE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ phases:
--bundles-override=${BUNDLES_OVERRIDE}
--test-report-folder=reports
--branch-name=${BRANCH_NAME}
--baremetal-branch=${BAREMETAL_BRANCH}
reports:
e2e-reports:
files:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ phases:
--cleanup-resources=true
--test-report-folder=reports
--branch-name=${BRANCH_NAME}
--baremetal-branch=${BAREMETAL_BRANCH}
post_build:
commands:
- >
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ env:
T_TINKERBELL_CP_NETWORK_CIDR: "tinkerbell_ci:cp_network_cidr"
T_TINKERBELL_S3_INVENTORY_CSV_KEY: "tinkerbell_ci:s3_inventory_csv"
T_TINKERBELL_S3_AG_INVENTORY_CSV_KEY: "tinkerbell_ci:s3_ag_inventory_csv"
BAREMETAL_BRANCH: "tinkerbell_ci:baremetal_branch"
TEST_RUNNER_GOVC_USERNAME: "tinkerbell_ci:govc_username"
TEST_RUNNER_GOVC_PASSWORD: "tinkerbell_ci:govc_password"
TEST_RUNNER_GOVC_URL: "tinkerbell_ci:govc_url"
Expand Down Expand Up @@ -237,7 +236,6 @@ phases:
--cleanup-resources=true
--test-report-folder=reports
--branch-name=${BRANCH_NAME}
--baremetal-branch=${BAREMETAL_BRANCH}
post_build:
commands:
- unset AWS_SDK_LOAD_CONFIG AWS_PROFILE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ phases:
--cleanup-resources=true
--test-report-folder=reports
--branch-name=${BRANCH_NAME}
--baremetal-branch=${BAREMETAL_BRANCH}
reports:
e2e-reports:
files:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ env:
T_TINKERBELL_CP_NETWORK_CIDR: "tinkerbell_ci:cp_network_cidr"
T_TINKERBELL_S3_INVENTORY_CSV_KEY: "tinkerbell_ci:s3_inventory_csv"
T_TINKERBELL_S3_AG_INVENTORY_CSV_KEY: "tinkerbell_ci:s3_ag_inventory_csv"
BAREMETAL_BRANCH: "tinkerbell_ci:baremetal_branch"
TEST_RUNNER_GOVC_USERNAME: "tinkerbell_ci:govc_username"
TEST_RUNNER_GOVC_PASSWORD: "tinkerbell_ci:govc_password"
TEST_RUNNER_GOVC_URL: "tinkerbell_ci:govc_url"
Expand Down Expand Up @@ -106,7 +105,6 @@ phases:
--cleanup-resources=true
--test-report-folder=reports
--branch-name=${BRANCH_NAME}
--baremetal-branch=${BAREMETAL_BRANCH}
reports:
e2e-reports:
files:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ phases:
--cleanup-resources=true
--test-report-folder=reports
--branch-name=${BRANCH_NAME}
--baremetal-branch=${BAREMETAL_BRANCH}
post_build:
commands:
- unset AWS_SDK_LOAD_CONFIG AWS_PROFILE
Expand Down
4 changes: 0 additions & 4 deletions cmd/integration_test/cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ const (
testReportFolderFlagName = "test-report-folder"
branchNameFlagName = "branch-name"
instanceConfigFlagName = "instance-config"
baremetalBranchFlagName = "baremetal-branch"
)

var runE2ECmd = &cobra.Command{
Expand Down Expand Up @@ -67,7 +66,6 @@ func init() {
runE2ECmd.Flags().Bool(cleanupResourcesFlagName, false, "Flag to indicate if test resources should be cleaned up automatically as tests complete")
runE2ECmd.Flags().String(testReportFolderFlagName, "", "Folder destination for JUnit tests reports")
runE2ECmd.Flags().String(branchNameFlagName, "main", "EKS-A origin branch from where the tests are being run")
runE2ECmd.Flags().String(baremetalBranchFlagName, "main", "Branch for baremetal tests to run on")

for _, flag := range requiredFlags {
if err := runE2ECmd.MarkFlagRequired(flag); err != nil {
Expand All @@ -88,7 +86,6 @@ func runE2E(ctx context.Context) error {
cleanupResources := viper.GetBool(cleanupResourcesFlagName)
testReportFolder := viper.GetString(testReportFolderFlagName)
branchName := viper.GetString(branchNameFlagName)
baremetalBranchName := viper.GetString(baremetalBranchFlagName)

runConf := e2e.ParallelRunConf{
MaxConcurrentTests: maxConcurrentTests,
Expand All @@ -102,7 +99,6 @@ func runE2E(ctx context.Context) error {
TestReportFolder: testReportFolder,
BranchName: branchName,
TestInstanceConfigFile: instanceConfigFile,
BaremetalBranchName: baremetalBranchName,
Logger: logger.Get(),
}

Expand Down
47 changes: 21 additions & 26 deletions internal/test/e2e/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ type ParallelRunConf struct {
CleanupResources bool
TestReportFolder string
BranchName string
BaremetalBranchName string
Logger logr.Logger
}

Expand Down Expand Up @@ -89,21 +88,19 @@ func RunTestsInParallel(conf ParallelRunConf) error {

// For Tinkerbell tests, get hardware inventory pool
var invCatalogue map[string]*hardwareCatalogue
if strings.EqualFold(conf.BranchName, conf.BaremetalBranchName) {
nonAirgappedHardwareInv, err := getNonAirgappedHardwarePool(conf.StorageBucket)
if err != nil {
return fmt.Errorf("failed to get non-airgapped hardware inventory for Tinkerbell Tests: %v", err)
}
nonAirgappedInvCatalogue := newHardwareCatalogue(nonAirgappedHardwareInv)
airgappedHardwareInv, err := getAirgappedHardwarePool(conf.StorageBucket)
if err != nil {
return fmt.Errorf("failed to get airgapped hardware inventory for Tinkerbell Tests: %v", err)
}
airgappedInvCatalogue := newHardwareCatalogue(airgappedHardwareInv)
invCatalogue = map[string]*hardwareCatalogue{
nonAirgappedHardware: nonAirgappedInvCatalogue,
airgappedHardware: airgappedInvCatalogue,
}
nonAirgappedHardwareInv, err := getNonAirgappedHardwarePool(conf.StorageBucket)
if err != nil {
return fmt.Errorf("failed to get non-airgapped hardware inventory for Tinkerbell Tests: %v", err)
}
nonAirgappedInvCatalogue := newHardwareCatalogue(nonAirgappedHardwareInv)
airgappedHardwareInv, err := getAirgappedHardwarePool(conf.StorageBucket)
if err != nil {
return fmt.Errorf("failed to get airgapped hardware inventory for Tinkerbell Tests: %v", err)
}
airgappedInvCatalogue := newHardwareCatalogue(airgappedHardwareInv)
invCatalogue = map[string]*hardwareCatalogue{
nonAirgappedHardware: nonAirgappedInvCatalogue,
airgappedHardware: airgappedInvCatalogue,
}

work := make(chan instanceRunConf)
Expand Down Expand Up @@ -411,17 +408,15 @@ func splitTests(testsList []string, conf ParallelRunConf) ([]instanceRunConf, er
runConfs = append(runConfs, newInstanceRunConf(awsSession, conf, len(runConfs), testName, ips, []*api.Hardware{}, 0, false, Ec2TestRunnerType, testRunnerConfig))
}

if strings.EqualFold(conf.BranchName, conf.BaremetalBranchName) {
tinkerbellIPManager := newE2EIPManager(conf.Logger, os.Getenv(tinkerbellControlPlaneNetworkCidrEnvVar))
runConfs, err = appendNonAirgappedTinkerbellRunConfs(awsSession, testsList, conf, testRunnerConfig, runConfs, tinkerbellIPManager)
if err != nil {
return nil, fmt.Errorf("failed to split Tinkerbell tests: %v", err)
}
tinkerbellIPManager := newE2EIPManager(conf.Logger, os.Getenv(tinkerbellControlPlaneNetworkCidrEnvVar))
runConfs, err = appendNonAirgappedTinkerbellRunConfs(awsSession, testsList, conf, testRunnerConfig, runConfs, tinkerbellIPManager)
if err != nil {
return nil, fmt.Errorf("failed to split Tinkerbell tests: %v", err)
}

runConfs, err = appendAirgappedTinkerbellRunConfs(awsSession, testsList, conf, testRunnerConfig, runConfs, tinkerbellIPManager)
if err != nil {
return nil, fmt.Errorf("failed to run airgapped Tinkerbell tests: %v", err)
}
runConfs, err = appendAirgappedTinkerbellRunConfs(awsSession, testsList, conf, testRunnerConfig, runConfs, tinkerbellIPManager)
if err != nil {
return nil, fmt.Errorf("failed to run airgapped Tinkerbell tests: %v", err)
}

return runConfs, nil
Expand Down

0 comments on commit c15e109

Please sign in to comment.