Skip to content

Commit

Permalink
Remove baremetal-branch flag from the integration test CLI (#8967)
Browse files Browse the repository at this point in the history
  • Loading branch information
sp1999 authored Nov 2, 2024
1 parent 121b808 commit 2e24af1
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 17 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
15 changes: 12 additions & 3 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,7 +88,7 @@ func RunTestsInParallel(conf ParallelRunConf) error {

// For Tinkerbell tests, get hardware inventory pool
var invCatalogue map[string]*hardwareCatalogue
if strings.EqualFold(conf.BranchName, conf.BaremetalBranchName) {
if containsTinkerbellTest(testsList) {
nonAirgappedHardwareInv, err := getNonAirgappedHardwarePool(conf.StorageBucket)
if err != nil {
return fmt.Errorf("failed to get non-airgapped hardware inventory for Tinkerbell Tests: %v", err)
Expand Down Expand Up @@ -411,7 +410,7 @@ 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) {
if containsTinkerbellTest(testsList) {
tinkerbellIPManager := newE2EIPManager(conf.Logger, os.Getenv(tinkerbellControlPlaneNetworkCidrEnvVar))
runConfs, err = appendNonAirgappedTinkerbellRunConfs(awsSession, testsList, conf, testRunnerConfig, runConfs, tinkerbellIPManager)
if err != nil {
Expand Down Expand Up @@ -588,3 +587,13 @@ func logTinkerbellTestHardwareInfo(conf *instanceRunConf, action string) {
}
conf.Logger.V(1).Info(action+" hardware for TestRunner", "hardwarePool", strings.Join(hardwareInfo, ", "))
}

func containsTinkerbellTest(testsList []string) bool {
tinkerbellTestsRe := regexp.MustCompile(tinkerbellTestsRe)
for _, testName := range testsList {
if tinkerbellTestsRe.MatchString(testName) {
return true
}
}
return false
}
1 change: 0 additions & 1 deletion scripts/e2e_test_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ $BIN_FOLDER/test e2e run \
-r ${TEST_REGEX} \
--bundles-override=${BUNDLES_OVERRIDE} \
--test-report-folder=${TEST_REPORT_FOLDER} \
--baremetal-branch="" \
-v4

# Faking cross-platform versioned folders for dry-run
Expand Down

0 comments on commit 2e24af1

Please sign in to comment.