Skip to content

Commit 7440d3e

Browse files
authored
Merge pull request #3754 from Ankitasw/cc-tests
Restructure e2e templates directory
2 parents d770132 + f31cfa9 commit 7440d3e

File tree

127 files changed

+5530
-6672
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+5530
-6672
lines changed

Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,11 @@ $(ARTIFACTS):
368368

369369
.PHONY: generate-test-flavors
370370
generate-test-flavors: $(KUSTOMIZE) ## Generate test template flavors
371-
./hack/gen-test-flavors.sh
371+
./hack/gen-test-flavors.sh withoutclusterclass
372+
373+
.PHONY: generate-clusterclass-test-flavors
374+
generate-clusterclass-test-flavors: $(KUSTOMIZE) ## Generate ClusterClass test template flavors
375+
./hack/gen-test-flavors.sh withclusterclass
372376

373377
.PHONY: e2e-image
374378
e2e-image: docker-pull-prerequisites $(TOOLS_BIN_DIR)/start.sh $(TOOLS_BIN_DIR)/restart.sh ## Build an e2e test image
@@ -397,7 +401,7 @@ test-verbose: setup-envtest ## Run tests with verbose settings.
397401
KUBEBUILDER_ASSETS="$(KUBEBUILDER_ASSETS)" go test -v ./...
398402

399403
.PHONY: test-e2e ## Run e2e tests using clusterctl
400-
test-e2e: $(GINKGO) $(KIND) $(SSM_PLUGIN) $(KUSTOMIZE) generate-test-flavors e2e-image ## Run e2e tests
404+
test-e2e: $(GINKGO) $(KIND) $(SSM_PLUGIN) $(KUSTOMIZE) generate-test-flavors generate-clusterclass-test-flavors e2e-image ## Run e2e tests
401405
time $(GINKGO) -tags=e2e $(GINKGO_ARGS) -p ./test/e2e/suites/unmanaged/... -- -config-path="$(E2E_CONF_PATH)" $(E2E_ARGS)
402406

403407
.PHONY: test-e2e-eks ## Run EKS e2e tests using clusterctl

hack/gen-test-flavors.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ set -o pipefail
2222
root=$(dirname "${BASH_SOURCE[0]}")/..
2323
kustomize="${root}/hack/tools/bin/kustomize"
2424
test_dir_path="test/e2e/data/infrastructure-aws"
25-
test_dir="${root}/${test_dir_path}"
25+
sub_dir_path=$1
26+
test_dir="${root}/${test_dir_path}/${sub_dir_path}"
2627
src_dir="${test_dir}/kustomize_sources/"
2728
generated_dir="${test_dir}/generated"
2829
test_templates="${test_dir}/e2e_test_templates"
@@ -35,6 +36,9 @@ mkdir -p "${generated_dir}"
3536
find "${src_dir}"* -maxdepth 1 -type d \
3637
-print0 | xargs -0 -I {} basename {} | grep -v -E '(patches|addons|cni|base)' | xargs -t -I {} ${kustomize} build --load-restrictor LoadRestrictionsNone --reorder none ${src_dir}{} -o ${generated_dir}/cluster-template-{}.yaml
3738

38-
## move the default template to the default file expected by clusterctl
39-
mv "${generated_dir}/cluster-template-default.yaml" "${generated_dir}/cluster-template.yaml"
40-
cp -r ${generated_dir} ${test_templates}
39+
40+
## move the default template to the default file expected by clusterctl in case of withoutclusterclass
41+
if [ "${sub_dir_path}" == "withoutclusterclass" ]
42+
then
43+
mv "${generated_dir}/cluster-template-default.yaml" "${generated_dir}/cluster-template.yaml"
44+
fi

test/e2e/data/e2e_conf.yaml

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -96,34 +96,34 @@ providers:
9696
value: ../../../config/default
9797
# Do not add contract field for v1beta1 --> v1beta2 clusterctl upgrades test to work.
9898
files:
99-
- sourcePath: "./infrastructure-aws/generated/cluster-template-efs-support.yaml"
100-
- sourcePath: "./infrastructure-aws/generated/cluster-template-external-csi.yaml"
101-
- sourcePath: "./infrastructure-aws/generated/cluster-template-csimigration-off.yaml"
102-
- sourcePath: "./infrastructure-aws/generated/cluster-template-external-cloud-provider.yaml"
103-
- sourcePath: "./infrastructure-aws/generated/cluster-template-kcp-remediation.yaml"
104-
- sourcePath: "./infrastructure-aws/generated/cluster-template-kcp-scale-in.yaml"
105-
- sourcePath: "./infrastructure-aws/generated/cluster-template-limit-az.yaml"
106-
- sourcePath: "./infrastructure-aws/generated/cluster-template-machine-pool.yaml"
107-
- sourcePath: "./infrastructure-aws/generated/cluster-template-md-remediation.yaml"
108-
- sourcePath: "./infrastructure-aws/generated/cluster-template-nested-multitenancy.yaml"
109-
- sourcePath: "./infrastructure-aws/generated/cluster-template-remote-management-cluster.yaml"
110-
- sourcePath: "./infrastructure-aws/generated/cluster-template-simple-multitenancy.yaml"
111-
- sourcePath: "./infrastructure-aws/generated/cluster-template-spot-instances.yaml"
112-
- sourcePath: "./infrastructure-aws/generated/cluster-template-ssm.yaml"
113-
- sourcePath: "./infrastructure-aws/generated/cluster-template-topology.yaml"
114-
- sourcePath: "./infrastructure-aws/generated/cluster-template-upgrade-to-main.yaml"
115-
- sourcePath: "./infrastructure-aws/generated/cluster-template.yaml"
116-
- sourcePath: "./infrastructure-aws/generated/cluster-template-gpu.yaml"
117-
- sourcePath: "./infrastructure-aws/generated/cluster-template-upgrades.yaml"
118-
- sourcePath: "./infrastructure-aws/generated/cluster-template-peered-remote.yaml"
119-
- sourcePath: "./infrastructure-aws/generated/cluster-template-internal-elb.yaml"
120-
- sourcePath: "./infrastructure-aws/kustomize_sources/topology/clusterclass-ci-default.yaml"
121-
- sourcePath: "./infrastructure-aws/generated/cluster-template-nested-multitenancy-clusterclass.yaml"
122-
- sourcePath: "./infrastructure-aws/kustomize_sources/nested-multitenancy-clusterclass/clusterclass-multi-tenancy.yaml"
123-
- sourcePath: "./infrastructure-aws/generated/cluster-template-self-hosted-clusterclass.yaml"
124-
- sourcePath: "./infrastructure-aws/generated/cluster-template-external-vpc-clusterclass.yaml"
99+
- sourcePath: "./infrastructure-aws/withoutclusterclass/generated/cluster-template-efs-support.yaml"
100+
- sourcePath: "./infrastructure-aws/withoutclusterclass/generated/cluster-template-external-csi.yaml"
101+
- sourcePath: "./infrastructure-aws/withoutclusterclass/generated/cluster-template-csimigration-off.yaml"
102+
- sourcePath: "./infrastructure-aws/withoutclusterclass/generated/cluster-template-external-cloud-provider.yaml"
103+
- sourcePath: "./infrastructure-aws/withoutclusterclass/generated/cluster-template-kcp-remediation.yaml"
104+
- sourcePath: "./infrastructure-aws/withoutclusterclass/generated/cluster-template-kcp-scale-in.yaml"
105+
- sourcePath: "./infrastructure-aws/withoutclusterclass/generated/cluster-template-limit-az.yaml"
106+
- sourcePath: "./infrastructure-aws/withoutclusterclass/generated/cluster-template-machine-pool.yaml"
107+
- sourcePath: "./infrastructure-aws/withoutclusterclass/generated/cluster-template-md-remediation.yaml"
108+
- sourcePath: "./infrastructure-aws/withoutclusterclass/generated/cluster-template-nested-multitenancy.yaml"
109+
- sourcePath: "./infrastructure-aws/withoutclusterclass/generated/cluster-template-remote-management-cluster.yaml"
110+
- sourcePath: "./infrastructure-aws/withoutclusterclass/generated/cluster-template-simple-multitenancy.yaml"
111+
- sourcePath: "./infrastructure-aws/withoutclusterclass/generated/cluster-template-spot-instances.yaml"
112+
- sourcePath: "./infrastructure-aws/withoutclusterclass/generated/cluster-template-ssm.yaml"
113+
- sourcePath: "./infrastructure-aws/withclusterclass/generated/cluster-template-topology.yaml"
114+
- sourcePath: "./infrastructure-aws/withoutclusterclass/generated/cluster-template-upgrade-to-main.yaml"
115+
- sourcePath: "./infrastructure-aws/withoutclusterclass/generated/cluster-template.yaml"
116+
- sourcePath: "./infrastructure-aws/withoutclusterclass/generated/cluster-template-gpu.yaml"
117+
- sourcePath: "./infrastructure-aws/withoutclusterclass/generated/cluster-template-upgrades.yaml"
118+
- sourcePath: "./infrastructure-aws/withoutclusterclass/generated/cluster-template-peered-remote.yaml"
119+
- sourcePath: "./infrastructure-aws/withoutclusterclass/generated/cluster-template-internal-elb.yaml"
120+
- sourcePath: "./infrastructure-aws/withclusterclass/kustomize_sources/topology/clusterclass-ci-default.yaml"
121+
- sourcePath: "./infrastructure-aws/withclusterclass/generated/cluster-template-nested-multitenancy-clusterclass.yaml"
122+
- sourcePath: "./infrastructure-aws/withclusterclass/kustomize_sources/nested-multitenancy-clusterclass/clusterclass-multi-tenancy.yaml"
123+
- sourcePath: "./infrastructure-aws/withclusterclass/generated/cluster-template-self-hosted-clusterclass.yaml"
124+
- sourcePath: "./infrastructure-aws/withclusterclass/generated/cluster-template-external-vpc-clusterclass.yaml"
125125
- sourcePath: "./shared/v1beta2_provider/metadata.yaml"
126-
- sourcePath: "./infrastructure-aws/generated/cluster-template-ignition.yaml"
126+
- sourcePath: "./infrastructure-aws/withoutclusterclass/generated/cluster-template-ignition.yaml"
127127
replacements:
128128
# To allow bugs to be catched.
129129
- old: "failureThreshold: 3"
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
generated
1+
withoutclusterclass/generated
2+
withclusterclass/generated

test/e2e/data/infrastructure-aws/e2e_test_templates/cluster-template-external-infrastructure.yaml

Lines changed: 0 additions & 142 deletions
This file was deleted.

0 commit comments

Comments
 (0)