Skip to content

Commit

Permalink
Merge pull request #924 from alexander-demicev/parrallele2e
Browse files Browse the repository at this point in the history
Run each case inside suite in parallel
  • Loading branch information
alexander-demicev authored Dec 16, 2024
2 parents bfa2b19 + 7b617e5 commit 0b5bd18
Show file tree
Hide file tree
Showing 21 changed files with 1,893 additions and 1,475 deletions.
1 change: 1 addition & 0 deletions .github/workflows/run-e2e-suite.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ env:
MANAGEMENT_CLUSTER_ENVIRONMENT: ${{ inputs.MANAGEMENT_CLUSTER_ENVIRONMENT }}
GINKGO_LABEL_FILTER: full
GINKGO_TESTS: ${{ github.workspace }}/${{ inputs.test_suite }}
GINKGO_NODES: 5

jobs:
run_e2e_tests:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ release-chart: $(HELM) $(NOTES) build-chart verify-gen
$(CACHE_DIR):
mkdir -p $(CACHE_DIR)/

E2E_RUN_COMMAND=$(E2ECONFIG_VARS) $(GINKGO) -v --trace -poll-progress-after=$(GINKGO_POLL_PROGRESS_AFTER) \
E2E_RUN_COMMAND=$(E2ECONFIG_VARS) $(GINKGO) -v --trace -p -procs=5 -poll-progress-after=$(GINKGO_POLL_PROGRESS_AFTER) \
-poll-progress-interval=$(GINKGO_POLL_PROGRESS_INTERVAL) --tags=e2e --focus="$(GINKGO_FOCUS)" --label-filter="$(GINKGO_LABEL_FILTER)" \
$(_SKIP_ARGS) --nodes=$(GINKGO_NODES) --timeout=$(GINKGO_TIMEOUT) --no-color=$(GINKGO_NOCOLOR) \
--output-dir="$(ARTIFACTS)" --junit-report="junit.e2e_suite.1.xml" $(GINKGO_ARGS) $(GINKGO_TESTS) -- \
Expand Down
40 changes: 20 additions & 20 deletions test/e2e/suites/chart-upgrade/chart_upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,20 @@ import (

var _ = Describe("Chart upgrade functionality should work", Label(e2e.ShortTestLabel), func() {
BeforeEach(func() {
SetClient(setupClusterResult.BootstrapClusterProxy.GetClient())
SetClient(bootstrapClusterProxy.GetClient())
SetContext(ctx)

})

It("Should perform upgrade from GA version to latest", func() {
rtInput := testenv.DeployRancherTurtlesInput{
BootstrapClusterProxy: setupClusterResult.BootstrapClusterProxy,
BootstrapClusterProxy: bootstrapClusterProxy,
HelmBinaryPath: e2eConfig.GetVariable(e2e.HelmBinaryPathVar),
TurtlesChartPath: "https://rancher.github.io/turtles",
CAPIProvidersYAML: e2e.CapiProvidersLegacy,
Namespace: framework.DefaultRancherTurtlesNamespace,
Version: "v0.6.0",
WaitDeploymentsReadyInterval: e2eConfig.GetIntervals(setupClusterResult.BootstrapClusterProxy.GetName(), "wait-controllers"),
WaitDeploymentsReadyInterval: e2eConfig.GetIntervals(bootstrapClusterProxy.GetName(), "wait-controllers"),
AdditionalValues: map[string]string{},
}
testenv.DeployRancherTurtles(ctx, rtInput)
Expand All @@ -60,8 +60,8 @@ var _ = Describe("Chart upgrade functionality should work", Label(e2e.ShortTestL
HelmBinaryPath: e2eConfig.GetVariable(e2e.HelmBinaryPathVar),
ChartsPath: e2eConfig.GetVariable(e2e.TurtlesPathVar),
ChartVersion: e2eConfig.GetVariable(e2e.TurtlesVersionVar),
BootstrapClusterProxy: setupClusterResult.BootstrapClusterProxy,
WaitInterval: e2eConfig.GetIntervals(setupClusterResult.BootstrapClusterProxy.GetName(), "wait-controllers"),
BootstrapClusterProxy: bootstrapClusterProxy,
WaitInterval: e2eConfig.GetIntervals(bootstrapClusterProxy.GetName(), "wait-controllers"),
Variables: e2eConfig.Variables,
}

Expand All @@ -70,12 +70,12 @@ var _ = Describe("Chart upgrade functionality should work", Label(e2e.ShortTestL
testenv.DeployChartMuseum(ctx, chartMuseumDeployInput)

upgradeInput := testenv.UpgradeRancherTurtlesInput{
BootstrapClusterProxy: setupClusterResult.BootstrapClusterProxy,
BootstrapClusterProxy: bootstrapClusterProxy,
HelmBinaryPath: e2eConfig.GetVariable(e2e.HelmBinaryPathVar),
Namespace: framework.DefaultRancherTurtlesNamespace,
Image: "ghcr.io/rancher/turtles-e2e",
Tag: e2eConfig.GetVariable(e2e.TurtlesVersionVar),
WaitDeploymentsReadyInterval: e2eConfig.GetIntervals(setupClusterResult.BootstrapClusterProxy.GetName(), "wait-controllers"),
WaitDeploymentsReadyInterval: e2eConfig.GetIntervals(bootstrapClusterProxy.GetName(), "wait-controllers"),
AdditionalValues: rtInput.AdditionalValues,
PostUpgradeSteps: []func(){},
}
Expand All @@ -88,20 +88,20 @@ var _ = Describe("Chart upgrade functionality should work", Label(e2e.ShortTestL
upgradeInput.PostUpgradeSteps = append(upgradeInput.PostUpgradeSteps, func() {
By("Waiting for CAAPF deployment to be available")
capiframework.WaitForDeploymentsAvailable(ctx, capiframework.WaitForDeploymentsAvailableInput{
Getter: setupClusterResult.BootstrapClusterProxy.GetClient(),
Getter: bootstrapClusterProxy.GetClient(),
Deployment: &appsv1.Deployment{ObjectMeta: metav1.ObjectMeta{
Name: "caapf-controller-manager",
Namespace: e2e.RancherTurtlesNamespace,
}},
}, e2eConfig.GetIntervals(setupClusterResult.BootstrapClusterProxy.GetName(), "wait-controllers")...)
}, e2eConfig.GetIntervals(bootstrapClusterProxy.GetName(), "wait-controllers")...)

By("Setting the CAAPF config to use hostNetwork")
Expect(setupClusterResult.BootstrapClusterProxy.Apply(ctx, e2e.AddonProviderFleetHostNetworkPatch)).To(Succeed())
Expect(bootstrapClusterProxy.Apply(ctx, e2e.AddonProviderFleetHostNetworkPatch)).To(Succeed())
})

upgradeInput.PostUpgradeSteps = append(upgradeInput.PostUpgradeSteps, func() {
framework.WaitForCAPIProviderRollout(ctx, framework.WaitForCAPIProviderRolloutInput{
Getter: setupClusterResult.BootstrapClusterProxy.GetClient(),
Getter: bootstrapClusterProxy.GetClient(),
Version: e2e.CAPIVersion,
Deployment: &appsv1.Deployment{ObjectMeta: metav1.ObjectMeta{
Name: "capi-controller-manager",
Expand All @@ -110,43 +110,43 @@ var _ = Describe("Chart upgrade functionality should work", Label(e2e.ShortTestL
Image: "registry.suse.com/rancher/cluster-api-controller:",
Name: "cluster-api",
Namespace: "capi-system",
}, e2eConfig.GetIntervals(setupClusterResult.BootstrapClusterProxy.GetName(), "wait-controllers")...)
}, e2eConfig.GetIntervals(bootstrapClusterProxy.GetName(), "wait-controllers")...)
}, func() {
framework.WaitForCAPIProviderRollout(ctx, framework.WaitForCAPIProviderRolloutInput{
Getter: setupClusterResult.BootstrapClusterProxy.GetClient(),
Getter: bootstrapClusterProxy.GetClient(),
Version: e2e.CAPIVersion,
Name: "kubeadm-control-plane",
Namespace: "capi-kubeadm-control-plane-system",
}, e2eConfig.GetIntervals(setupClusterResult.BootstrapClusterProxy.GetName(), "wait-controllers")...)
}, e2eConfig.GetIntervals(bootstrapClusterProxy.GetName(), "wait-controllers")...)
}, func() {
framework.WaitForCAPIProviderRollout(ctx, framework.WaitForCAPIProviderRolloutInput{
Getter: setupClusterResult.BootstrapClusterProxy.GetClient(),
Getter: bootstrapClusterProxy.GetClient(),
Deployment: &appsv1.Deployment{ObjectMeta: metav1.ObjectMeta{
Name: "rke2-bootstrap-controller-manager",
Namespace: "rke2-bootstrap-system",
}},
Image: "registry.suse.com/rancher/cluster-api-provider-rke2-bootstrap:",
Name: "rke2-bootstrap",
Namespace: "rke2-bootstrap-system",
}, e2eConfig.GetIntervals(setupClusterResult.BootstrapClusterProxy.GetName(), "wait-controllers")...)
}, e2eConfig.GetIntervals(bootstrapClusterProxy.GetName(), "wait-controllers")...)
}, func() {
framework.WaitForCAPIProviderRollout(ctx, framework.WaitForCAPIProviderRolloutInput{
Getter: setupClusterResult.BootstrapClusterProxy.GetClient(),
Getter: bootstrapClusterProxy.GetClient(),
Deployment: &appsv1.Deployment{ObjectMeta: metav1.ObjectMeta{
Name: "rke2-control-plane-controller-manager",
Namespace: "rke2-control-plane-system",
}},
Image: "registry.suse.com/rancher/cluster-api-provider-rke2-controlplane:",
Name: "rke2-control-plane",
Namespace: "rke2-control-plane-system",
}, e2eConfig.GetIntervals(setupClusterResult.BootstrapClusterProxy.GetName(), "wait-controllers")...)
}, e2eConfig.GetIntervals(bootstrapClusterProxy.GetName(), "wait-controllers")...)
}, func() {
framework.WaitForCAPIProviderRollout(ctx, framework.WaitForCAPIProviderRolloutInput{
Getter: setupClusterResult.BootstrapClusterProxy.GetClient(),
Getter: bootstrapClusterProxy.GetClient(),
Version: e2e.CAPIVersion,
Name: "docker",
Namespace: "capd-system",
}, e2eConfig.GetIntervals(setupClusterResult.BootstrapClusterProxy.GetName(), "wait-controllers")...)
}, e2eConfig.GetIntervals(bootstrapClusterProxy.GetName(), "wait-controllers")...)
})

testenv.UpgradeRancherTurtles(ctx, upgradeInput)
Expand Down
Loading

0 comments on commit 0b5bd18

Please sign in to comment.