diff --git a/cmd/integration_test/build/buildspecs/cloudstack-test-eks-a-cli.yml b/cmd/integration_test/build/buildspecs/cloudstack-test-eks-a-cli.yml index d44484f32e65..7ddb782a208c 100644 --- a/cmd/integration_test/build/buildspecs/cloudstack-test-eks-a-cli.yml +++ b/cmd/integration_test/build/buildspecs/cloudstack-test-eks-a-cli.yml @@ -2,7 +2,6 @@ version: 0.2 env: variables: - INTEGRATION_TEST_MAX_EC2_COUNT: 180 INTEGRATION_TEST_MAX_CONCURRENT_TEST_COUNT: 50 T_CLOUDSTACK_CIDR: "10.80.214.0/23" CLOUDSTACK_PROVIDER: true @@ -101,7 +100,6 @@ phases: -s ${INTEGRATION_TEST_STORAGE_BUCKET} -j ${JOB_ID} -i ${INTEGRATION_TEST_INSTANCE_PROFILE} - -m ${INTEGRATION_TEST_MAX_EC2_COUNT} -p ${INTEGRATION_TEST_MAX_CONCURRENT_TEST_COUNT} -r 'Test' -v 4 diff --git a/cmd/integration_test/build/buildspecs/conformance-eks-a-cli.yml b/cmd/integration_test/build/buildspecs/conformance-eks-a-cli.yml index ac56be6ad915..e84604388557 100644 --- a/cmd/integration_test/build/buildspecs/conformance-eks-a-cli.yml +++ b/cmd/integration_test/build/buildspecs/conformance-eks-a-cli.yml @@ -2,7 +2,6 @@ version: 0.2 env: variables: - INTEGRATION_TEST_MAX_EC2_COUNT: 25 INTEGRATION_TEST_MAX_CONCURRENT_TEST_COUNT: 25 T_TINKERBELL_MAX_HARDWARE_PER_TEST: 2 T_CLOUDSTACK_CIDR: "10.80.191.0/24" @@ -168,7 +167,6 @@ phases: -s ${INTEGRATION_TEST_STORAGE_BUCKET} -j ${JOB_ID} -i ${INTEGRATION_TEST_INSTANCE_PROFILE} - -m ${INTEGRATION_TEST_MAX_EC2_COUNT} -p ${INTEGRATION_TEST_MAX_CONCURRENT_TEST_COUNT} -r 'Test' -v 4 diff --git a/cmd/integration_test/build/buildspecs/docker-test-eks-a-cli.yml b/cmd/integration_test/build/buildspecs/docker-test-eks-a-cli.yml index a0a25e0abced..139fe825092c 100644 --- a/cmd/integration_test/build/buildspecs/docker-test-eks-a-cli.yml +++ b/cmd/integration_test/build/buildspecs/docker-test-eks-a-cli.yml @@ -2,7 +2,6 @@ version: 0.2 env: variables: - INTEGRATION_TEST_MAX_EC2_COUNT: 180 INTEGRATION_TEST_MAX_CONCURRENT_TEST_COUNT: 180 EKSA_GIT_KNOWN_HOSTS: "/tmp/known_hosts" EKSA_GIT_PRIVATE_KEY: "/tmp/private-key" @@ -51,7 +50,6 @@ phases: -s ${INTEGRATION_TEST_STORAGE_BUCKET} -j ${JOB_ID} -i ${INTEGRATION_TEST_INSTANCE_PROFILE} - -m ${INTEGRATION_TEST_MAX_EC2_COUNT} -p ${INTEGRATION_TEST_MAX_CONCURRENT_TEST_COUNT} -r 'Test' -v 4 diff --git a/cmd/integration_test/build/buildspecs/nutanix-test-eks-a-cli.yml b/cmd/integration_test/build/buildspecs/nutanix-test-eks-a-cli.yml index efcb438a6ce4..b72f7d7cb6ba 100644 --- a/cmd/integration_test/build/buildspecs/nutanix-test-eks-a-cli.yml +++ b/cmd/integration_test/build/buildspecs/nutanix-test-eks-a-cli.yml @@ -2,7 +2,6 @@ version: 0.2 env: variables: - INTEGRATION_TEST_MAX_EC2_COUNT: 180 INTEGRATION_TEST_MAX_CONCURRENT_TEST_COUNT: 50 EKSA_GIT_KNOWN_HOSTS: "/tmp/known_hosts" EKSA_GIT_PRIVATE_KEY: "/tmp/private-key" @@ -84,7 +83,6 @@ phases: -s ${INTEGRATION_TEST_STORAGE_BUCKET} -j ${JOB_ID} -i ${INTEGRATION_TEST_INSTANCE_PROFILE} - -m ${INTEGRATION_TEST_MAX_EC2_COUNT} -p ${INTEGRATION_TEST_MAX_CONCURRENT_TEST_COUNT} -r 'Test' -v 4 diff --git a/cmd/integration_test/build/buildspecs/quick-test-eks-a-cli.yml b/cmd/integration_test/build/buildspecs/quick-test-eks-a-cli.yml index 02f8004a1b88..a2e00d4443c0 100644 --- a/cmd/integration_test/build/buildspecs/quick-test-eks-a-cli.yml +++ b/cmd/integration_test/build/buildspecs/quick-test-eks-a-cli.yml @@ -3,7 +3,6 @@ version: 0.2 env: variables: INTEGRATION_TEST_CLOUDWATCH_NAMESPACE_OVERRIDE: EksaQuickE2ETests - INTEGRATION_TEST_MAX_EC2_COUNT: 180 INTEGRATION_TEST_MAX_CONCURRENT_TEST_COUNT: 180 EKSA_GIT_KNOWN_HOSTS: "/tmp/known_hosts" EKSA_GIT_PRIVATE_KEY: "/tmp/private-key" @@ -230,7 +229,6 @@ phases: -s ${INTEGRATION_TEST_STORAGE_BUCKET} -j ${JOB_ID} -i ${INTEGRATION_TEST_INSTANCE_PROFILE} - -m ${INTEGRATION_TEST_MAX_EC2_COUNT} -p ${INTEGRATION_TEST_MAX_CONCURRENT_TEST_COUNT} -r ${TESTS} -v 4 diff --git a/cmd/integration_test/build/buildspecs/snow-test-eks-a-cli.yml b/cmd/integration_test/build/buildspecs/snow-test-eks-a-cli.yml index c7fe1db38e79..205822d66652 100644 --- a/cmd/integration_test/build/buildspecs/snow-test-eks-a-cli.yml +++ b/cmd/integration_test/build/buildspecs/snow-test-eks-a-cli.yml @@ -2,7 +2,6 @@ version: 0.2 env: variables: - INTEGRATION_TEST_MAX_EC2_COUNT: 9999 INTEGRATION_TEST_MAX_CONCURRENT_TEST_COUNT: 3 EKSA_GIT_KNOWN_HOSTS: "/tmp/known_hosts" EKSA_GIT_PRIVATE_KEY: "/tmp/private-key" @@ -51,7 +50,6 @@ phases: -s ${INTEGRATION_TEST_STORAGE_BUCKET} -j ${JOB_ID} -i ${INTEGRATION_TEST_INSTANCE_PROFILE} - -m ${INTEGRATION_TEST_MAX_EC2_COUNT} -p ${INTEGRATION_TEST_MAX_CONCURRENT_TEST_COUNT} -r 'Test' -v 4 diff --git a/cmd/integration_test/build/buildspecs/tinkerbell-test-eks-a-cli.yml b/cmd/integration_test/build/buildspecs/tinkerbell-test-eks-a-cli.yml index 8e055b39715d..5487f056a047 100644 --- a/cmd/integration_test/build/buildspecs/tinkerbell-test-eks-a-cli.yml +++ b/cmd/integration_test/build/buildspecs/tinkerbell-test-eks-a-cli.yml @@ -2,7 +2,6 @@ version: 0.2 env: variables: - INTEGRATION_TEST_MAX_EC2_COUNT: 180 INTEGRATION_TEST_MAX_CONCURRENT_TEST_COUNT: 20 EKSA_GIT_KNOWN_HOSTS: "/tmp/known_hosts" EKSA_GIT_PRIVATE_KEY: "/tmp/private-key" @@ -99,7 +98,6 @@ phases: -s ${INTEGRATION_TEST_STORAGE_BUCKET} -j ${JOB_ID} -i ${INTEGRATION_TEST_INSTANCE_PROFILE} - -m ${INTEGRATION_TEST_MAX_EC2_COUNT} -p ${INTEGRATION_TEST_MAX_CONCURRENT_TEST_COUNT} -r 'Test' -v 4 diff --git a/cmd/integration_test/build/buildspecs/vsphere-test-eks-a-cli.yml b/cmd/integration_test/build/buildspecs/vsphere-test-eks-a-cli.yml index b96d8ffbc0eb..4a38acbe6105 100644 --- a/cmd/integration_test/build/buildspecs/vsphere-test-eks-a-cli.yml +++ b/cmd/integration_test/build/buildspecs/vsphere-test-eks-a-cli.yml @@ -2,7 +2,6 @@ version: 0.2 env: variables: - INTEGRATION_TEST_MAX_EC2_COUNT: 220 INTEGRATION_TEST_MAX_CONCURRENT_TEST_COUNT: 80 EKSA_GIT_KNOWN_HOSTS: "/tmp/known_hosts" EKSA_GIT_PRIVATE_KEY: "/tmp/private-key" @@ -119,7 +118,6 @@ phases: -s ${INTEGRATION_TEST_STORAGE_BUCKET} -j ${JOB_ID} -i ${INTEGRATION_TEST_INSTANCE_PROFILE} - -m ${INTEGRATION_TEST_MAX_EC2_COUNT} -p ${INTEGRATION_TEST_MAX_CONCURRENT_TEST_COUNT} -r 'Test' -v 4 diff --git a/cmd/integration_test/cmd/run.go b/cmd/integration_test/cmd/run.go index fbb4580cc77f..cb2eb112a694 100644 --- a/cmd/integration_test/cmd/run.go +++ b/cmd/integration_test/cmd/run.go @@ -18,7 +18,6 @@ const ( jobIdFlagName = "job-id" instanceProfileFlagName = "instance-profile-name" regexFlagName = "regex" - maxInstancesFlagName = "max-instances" maxConcurrentTestsFlagName = "max-concurrent-tests" skipFlagName = "skip" bundlesOverrideFlagName = "bundles-override" @@ -62,7 +61,6 @@ func init() { runE2ECmd.Flags().StringP(jobIdFlagName, "j", "", "Id of the job being run") runE2ECmd.Flags().StringP(instanceProfileFlagName, "i", "", "IAM instance profile name to attach to ssm instances") runE2ECmd.Flags().StringP(regexFlagName, "r", "", "Run only those tests and examples matching the regular expression. Equivalent to go test -run") - runE2ECmd.Flags().IntP(maxInstancesFlagName, "m", 1, "Run tests in parallel on same instance within the max EC2 instance count") runE2ECmd.Flags().IntP(maxConcurrentTestsFlagName, "p", 1, "Maximum number of parallel tests that can be run at a time") runE2ECmd.Flags().StringSlice(skipFlagName, nil, "List of tests to skip") runE2ECmd.Flags().Bool(bundlesOverrideFlagName, false, "Flag to indicate if the tests should run with a bundles override") @@ -84,7 +82,6 @@ func runE2E(ctx context.Context) error { jobId := viper.GetString(jobIdFlagName) instanceProfileName := viper.GetString(instanceProfileFlagName) testRegex := viper.GetString(regexFlagName) - maxInstances := viper.GetInt(maxInstancesFlagName) maxConcurrentTests := viper.GetInt(maxConcurrentTestsFlagName) testsToSkip := viper.GetStringSlice(skipFlagName) bundlesOverride := viper.GetBool(bundlesOverrideFlagName) @@ -94,7 +91,6 @@ func runE2E(ctx context.Context) error { baremetalBranchName := viper.GetString(baremetalBranchFlagName) runConf := e2e.ParallelRunConf{ - MaxInstances: maxInstances, MaxConcurrentTests: maxConcurrentTests, InstanceProfileName: instanceProfileName, StorageBucket: storageBucket, diff --git a/internal/test/e2e/run.go b/internal/test/e2e/run.go index 83b1f0a1c1bc..569bd5bb1bf4 100644 --- a/internal/test/e2e/run.go +++ b/internal/test/e2e/run.go @@ -40,7 +40,6 @@ const ( type ParallelRunConf struct { TestInstanceConfigFile string - MaxInstances int MaxConcurrentTests int InstanceProfileName string StorageBucket string @@ -351,11 +350,6 @@ func (e *E2ESession) commandWithEnvVars(command string) string { } func splitTests(testsList []string, conf ParallelRunConf) ([]instanceRunConf, error) { - testPerInstance := len(testsList) / conf.MaxInstances - if testPerInstance == 0 { - testPerInstance = 1 - } - vsphereTestsRe := regexp.MustCompile(vsphereRegex) tinkerbellTestsRe := regexp.MustCompile(tinkerbellTestsRe) cloudstackTestRe := regexp.MustCompile(cloudstackRegex) @@ -363,7 +357,7 @@ func splitTests(testsList []string, conf ParallelRunConf) ([]instanceRunConf, er privateNetworkTestsRe := regexp.MustCompile(`^.*(Proxy|RegistryMirror).*$`) multiClusterTestsRe := regexp.MustCompile(`^.*Multicluster.*$`) - runConfs := make([]instanceRunConf, 0, conf.MaxInstances) + runConfs := make([]instanceRunConf, 0, conf.MaxConcurrentTests) vsphereIPMan := newE2EIPManager(conf.Logger, os.Getenv(vsphereCidrVar)) vspherePrivateIPMan := newE2EIPManager(conf.Logger, os.Getenv(vspherePrivateNetworkCidrVar)) cloudstackIPMan := newE2EIPManager(conf.Logger, os.Getenv(cloudstackCidrVar)) @@ -379,13 +373,10 @@ func splitTests(testsList []string, conf ParallelRunConf) ([]instanceRunConf, er return nil, fmt.Errorf("creating test runner config for tests: %v", err) } - testsInEC2Instance := make([]string, 0, testPerInstance) - for i, testName := range testsList { + for _, testName := range testsList { if tinkerbellTestsRe.MatchString(testName) { continue } - - testsInEC2Instance = append(testsInEC2Instance, testName) multiClusterTest := multiClusterTestsRe.MatchString(testName) var ips networkutils.IPPool @@ -413,10 +404,7 @@ func splitTests(testsList []string, conf ParallelRunConf) ([]instanceRunConf, er } } - if len(testsInEC2Instance) == testPerInstance || (len(testsList)-1) == i { - runConfs = append(runConfs, newInstanceRunConf(awsSession, conf, len(runConfs), strings.Join(testsInEC2Instance, "|"), ips, []*api.Hardware{}, 0, false, Ec2TestRunnerType, testRunnerConfig)) - testsInEC2Instance = make([]string, 0, testPerInstance) - } + runConfs = append(runConfs, newInstanceRunConf(awsSession, conf, len(runConfs), testName, ips, []*api.Hardware{}, 0, false, Ec2TestRunnerType, testRunnerConfig)) } if strings.EqualFold(conf.BranchName, conf.BaremetalBranchName) { @@ -438,7 +426,7 @@ func splitTests(testsList []string, conf ParallelRunConf) ([]instanceRunConf, er //nolint:gocyclo // This legacy function is complex but the team too busy to simplify it func appendNonAirgappedTinkerbellRunConfs(awsSession *session.Session, testsList []string, conf ParallelRunConf, testRunnerConfig *TestInfraConfig, runConfs []instanceRunConf, ipManager *E2EIPManager) ([]instanceRunConf, error) { nonAirgappedTinkerbellTests := getTinkerbellNonAirgappedTests(testsList) - conf.Logger.V(1).Info("INFO:", "tinkerbellTests", len(nonAirgappedTinkerbellTests), "MaxInstances", conf.MaxInstances, "ConcurrentInstances", conf.MaxConcurrentTests) + conf.Logger.V(1).Info("INFO:", "tinkerbellTests", len(nonAirgappedTinkerbellTests), "ConcurrentInstances", conf.MaxConcurrentTests) nonAirgappedTinkerbellTestsWithCount, err := getTinkerbellTestsWithCount(nonAirgappedTinkerbellTests, conf) if err != nil { @@ -470,22 +458,14 @@ func appendAirgappedTinkerbellRunConfs(awsSession *session.Session, testsList [] return runConfs, nil } conf.Logger.V(1).Info("INFO:", "tinkerbellAirGappedTests", len(airgappedTinkerbellTests)) - testPerInstance := len(airgappedTinkerbellTests) / conf.MaxInstances - if testPerInstance == 0 { - testPerInstance = 1 - } - testsInVSphereInstance := make([]string, 0, testPerInstance) + airgappedTinkerbellTestsWithCount, err := getTinkerbellTestsWithCount(airgappedTinkerbellTests, conf) if err != nil { return nil, err } - for i, test := range airgappedTinkerbellTestsWithCount { - testsInVSphereInstance = append(testsInVSphereInstance, test.Name) + for _, test := range airgappedTinkerbellTestsWithCount { ipPool := ipManager.reserveIPPool(tinkerbellIPPoolSize) - if len(testsInVSphereInstance) == testPerInstance || (len(testsList)-1) == i { - runConfs = append(runConfs, newInstanceRunConf(awsSession, conf, len(runConfs), strings.Join(testsInVSphereInstance, "|"), ipPool, []*api.Hardware{}, test.Count, true, VSphereTestRunnerType, testRunnerConfig)) - testsInVSphereInstance = make([]string, 0, testPerInstance) - } + runConfs = append(runConfs, newInstanceRunConf(awsSession, conf, len(runConfs), test.Name, ipPool, []*api.Hardware{}, test.Count, true, VSphereTestRunnerType, testRunnerConfig)) } return runConfs, nil