Skip to content

Commit

Permalink
Bring Windows integration test runtime down to less than half
Browse files Browse the repository at this point in the history
This changelist parallelises the Windows integration test specs by modifying the integration test runner to accept arbitrary arguments to be passed to the `ginkgo` binary, allowing the integration test GitHub workflow to pass the `-p` and `--procs` arguments to parallelise running the test specs. This has brought the total runtime of Windows integration tests down to ~55 minutes from ~2 hours and 30 minutes.

The cluster version used in the tests has been updated to the latest EKS version 1.27, and as a result, one of the tests that uses the Docker runtime has been removed as it's no longer supported.
  • Loading branch information
cPu1 committed Aug 16, 2023
1 parent c27d2e8 commit 7a0acd6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
6 changes: 5 additions & 1 deletion integration/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,11 @@ func runGinkgo(ctx context.Context, wg *sync.WaitGroup, summaries chan []string,
}
}

args := []string{"--no-color", fmt.Sprintf("--timeout=%s", suiteTimeout), "-tags", "integration", "-v", "--progress"}
var args []string
if ginkgoArgs := os.Getenv("GINKGO_ARGS"); ginkgoArgs != "" {
args = strings.Split(ginkgoArgs, " ")
}
args = append(args, "--no-color", fmt.Sprintf("--timeout=%s", suiteTimeout), "-tags", "integration", "-v", "--progress")
if focus := os.Getenv("INTEGRATION_TEST_FOCUS"); focus != "" {
args = append(args, fmt.Sprintf(`--focus="%s"`, focus))
}
Expand Down
21 changes: 9 additions & 12 deletions integration/tests/windows/windows_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ func TestWindowsCluster(t *testing.T) {
var params *tests.Params

var _ = BeforeSuite(func() {
params = tests.NewParams("windows")
params = tests.NewParams(fmt.Sprintf("windows-%d", GinkgoParallelProcess()))
})

var _ = Describe("(Integration) [Windows Nodegroups]", func() {

createCluster := func(withOIDC bool, ami, containerRuntime, clusterName string) {
createCluster := func(withOIDC bool, ami, clusterName string) {
By("creating a new cluster with Windows nodegroups")
clusterConfig := api.NewClusterConfig()
clusterConfig.Metadata.Name = clusterName
clusterConfig.Metadata.Version = api.Version1_23
clusterConfig.Metadata.Version = api.LatestVersion
clusterConfig.Metadata.Region = api.DefaultRegion
clusterConfig.IAM.WithOIDC = &withOIDC

Expand All @@ -54,7 +54,6 @@ var _ = Describe("(Integration) [Windows Nodegroups]", func() {
VolumeSize: aws.Int(120),
InstanceType: "t3a.xlarge",
},
ContainerRuntime: &containerRuntime,
},
}
clusterConfig.ManagedNodeGroups = []*api.ManagedNodeGroup{
Expand Down Expand Up @@ -90,7 +89,7 @@ var _ = Describe("(Integration) [Windows Nodegroups]", func() {
}

deleteCluster := func(clusterName string) {
By("deleting the windows cluster")
By("deleting the Windows cluster")
cmd := params.EksctlDeleteCmd.WithArgs(
"cluster",
"--name", clusterName,
Expand All @@ -99,16 +98,14 @@ var _ = Describe("(Integration) [Windows Nodegroups]", func() {
}

Context("When creating a cluster with Windows nodegroups", func() {
DescribeTable("it should be able to run Windows pods", func(withOIDC bool, ami, workload, containerRuntime, clusterName string) {
createCluster(withOIDC, ami, containerRuntime, clusterName)
DescribeTable("it should be able to run Windows pods", func(withOIDC bool, ami, workload, clusterName string) {
createCluster(withOIDC, ami, clusterName)
runWindowsPod(workload)
deleteCluster(clusterName)
},
Entry("windows when withOIDC is disabled", false, api.NodeImageFamilyWindowsServer2019FullContainer, "windows-server-iis.yaml", api.ContainerRuntimeDockerForWindows, "windows-cluster1"),
Entry("windows when withOIDC is enabled", true, api.NodeImageFamilyWindowsServer2019FullContainer, "windows-server-iis.yaml", api.ContainerRuntimeDockerForWindows, "windows-cluster2"),

Entry("Windows Server 2022 when withOIDC is enabled", true, api.NodeImageFamilyWindowsServer2022FullContainer, "windows-server-iis-2022.yaml", api.ContainerRuntimeDockerForWindows, "windows-cluster3"),
Entry("Windows Server 2022 with containerd", true, api.NodeImageFamilyWindowsServer2022FullContainer, "windows-server-iis-2022.yaml", api.ContainerRuntimeContainerD, "windows-cluster4"),
Entry("Windows when withOIDC is disabled", false, api.NodeImageFamilyWindowsServer2019FullContainer, "windows-server-iis.yaml", "windows-cluster1"),
Entry("Windows when withOIDC is enabled", true, api.NodeImageFamilyWindowsServer2019FullContainer, "windows-server-iis.yaml", "windows-cluster2"),
Entry("Windows Server 2022 when withOIDC is enabled", true, api.NodeImageFamilyWindowsServer2022FullContainer, "windows-server-iis-2022.yaml", "windows-cluster3"),
)
})

Expand Down

0 comments on commit 7a0acd6

Please sign in to comment.