-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support running e2e tests on AWS #45
base: main
Are you sure you want to change the base?
Changes from all commits
61ef090
24bbde4
9c3c084
a4f07d2
4d85a76
d82fca1
448d4e6
57aa7bc
53b39bc
4c6e40f
8d7e872
e19d3f5
45ab4de
7d52c3a
b303aaf
3022a2b
aaac27d
53468c7
1c3677b
9c61f28
23f5a94
923b3cf
ea1fc5f
a8f55f6
1fbcf1f
d86460d
7fb852b
054f0f0
9ee8c47
9a99562
fcdff45
45b5e97
c2cefe5
cdee3ec
0f2f9c5
3320f66
8019c0a
e889508
c95520b
c6ea395
c4846b9
012f061
8aeee09
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: E2E Tests | ||
|
||
on: | ||
pull_request: | ||
|
||
permissions: | ||
contents: read | ||
id-token: write | ||
|
||
jobs: | ||
run-e2e-tests: | ||
name: Run E2E Tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ~1.22.0 | ||
|
||
- name: Configure AWS Credentials | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
audience: sts.amazonaws.com | ||
aws-region: us-east-2 | ||
role-to-assume: arn:aws:iam::018302341396:role/GithubOIDC | ||
role-duration-seconds: 3600 | ||
|
||
- name: Check out repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup tmate session | ||
uses: mxschmitt/action-tmate@v3 | ||
with: | ||
detached: true | ||
|
||
- name: Install requirements | ||
run: | | ||
sudo apt install make wget | ||
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.24.0/kind-linux-amd64 | ||
chmod +x ./kind | ||
sudo mv ./kind /usr/local/bin/kind | ||
|
||
- name: Increase inotify watches | ||
run: | | ||
# Prevents https://cluster-api.sigs.k8s.io/user/troubleshooting#cluster-api-with-docker----too-many-open-files | ||
sudo sysctl fs.inotify.max_user_watches=1048576 | ||
sudo sysctl fs.inotify.max_user_instances=8192 | ||
|
||
- name: Build images | ||
run: | | ||
cd hack | ||
./build-e2e-images.sh | ||
cd .. | ||
make docker-build-e2e | ||
|
||
- name: Run e2e tests | ||
run: | | ||
E2E_INFRA=aws GINKGO_FOCUS="Workload cluster creation" make test-e2e | ||
env: | ||
GOPROXY: direct |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,8 @@ name: E2E Tests | |
|
||
on: | ||
pull_request: | ||
branches: | ||
- does-not-exist | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and I guess after moving the content of |
||
|
||
permissions: | ||
contents: read | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,14 +92,15 @@ KUSTOMIZE := $(TOOLS_BIN_DIR)/$(KUSTOMIZE_BIN)-$(KUSTOMIZE_VER) | |
# Ginkgo | ||
TEST_DIR := $(shell pwd)/test | ||
ARTIFACTS ?= $(shell pwd)/_artifacts | ||
GINKGO_FOCUS ?= | ||
GINKGO_FOCUS ?= Workload cluster creation | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess this is a left over from testing? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, this is temporary. I am leaving it like this for now because this test passes on all infras and it's easier to iterate with one test. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. by temporary do we mean that it's gonna get removed before this PR is merged? or are we planning to change this in the up coming PRs? if it's the latter, maybe we can add a note or todo. |
||
GINKGO_SKIP ?= | ||
GINKGO_NODES ?= 1 # GINKGO_NODES is the number of parallel nodes to run | ||
# when running the e2e tests, 1 means no parallelism | ||
GINKGO_TIMEOUT ?= 2h | ||
GINKGO_POLL_PROGRESS_AFTER ?= 60m | ||
GINKGO_POLL_PROGRESS_INTERVAL ?= 5m | ||
E2E_CONF_FILE ?= $(TEST_DIR)/e2e/config/ck8s-docker.yaml | ||
E2E_INFRA ?= aws | ||
E2E_CONF_FILE ?= $(TEST_DIR)/e2e/config/ck8s-$(E2E_INFRA).yaml | ||
SKIP_RESOURCE_CLEANUP ?= false | ||
USE_EXISTING_CLUSTER ?= false | ||
GINKGO_NOCOLOR ?= false | ||
|
@@ -407,3 +408,7 @@ $(CONTROLLER_GEN): ## Build controller-gen from tools folder. | |
|
||
$(CONVERSION_GEN): ## Build conversion-gen from tools folder. | ||
GOBIN=$(TOOLS_BIN_DIR) $(GO_INSTALL) k8s.io/code-generator/cmd/conversion-gen $(CONVERSION_GEN_BIN) $(CONVERSION_GEN_VER) | ||
|
||
.PHONY: nuke | ||
nuke: | ||
aws-nuke -c ~/.config/aws-nuke/nuke-config.yaml --no-dry-run |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
regions: | ||
- us-east-2 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe we can extract this from this file and also the workflow file. I think this might cause subtle problems if we duplicate it. |
||
|
||
blocklist: | ||
- "999999999999" # A blocklist is required, but this is a placeholder | ||
|
||
accounts: | ||
018302341396: # AWS Account IDs are not considered sensitive information | ||
filters: | ||
EC2Instance: | ||
- property: "tag:sigs.k8s.io/cluster-api-provider-aws/cluster/capick8s-*" | ||
type: "glob" | ||
invert: true | ||
EC2SecurityGroup: | ||
- property: "tag:sigs.k8s.io/cluster-api-provider-aws/cluster/capick8s-*" | ||
type: "glob" | ||
invert: true | ||
EC2Volume: | ||
- property: "tag:sigs.k8s.io/cluster-api-provider-aws/cluster/capick8s-*" | ||
type: "glob" | ||
invert: true | ||
EC2InternetGateway: | ||
- property: "tag:sigs.k8s.io/cluster-api-provider-aws/cluster/capick8s-*" | ||
type: "glob" | ||
invert: true | ||
EC2NATGateway: | ||
- property: "tag:sigs.k8s.io/cluster-api-provider-aws/cluster/capick8s-*" | ||
type: "glob" | ||
invert: true | ||
EC2RouteTable: | ||
- property: "tag:sigs.k8s.io/cluster-api-provider-aws/cluster/capick8s-*" | ||
type: "glob" | ||
invert: true | ||
EC2Subnet: | ||
- property: "tag:sigs.k8s.io/cluster-api-provider-aws/cluster/capick8s-*" | ||
type: "glob" | ||
invert: true | ||
EC2VPC: | ||
- property: "tag:sigs.k8s.io/cluster-api-provider-aws/cluster/capick8s-*" | ||
type: "glob" | ||
invert: true | ||
EC2VPCEndpoint: | ||
- property: "tag:sigs.k8s.io/cluster-api-provider-aws/cluster/capick8s-*" | ||
type: "glob" | ||
invert: true | ||
EC2VPCEndpointServiceConfiguration: | ||
- property: "tag:sigs.k8s.io/cluster-api-provider-aws/cluster/capick8s-*" | ||
type: "glob" | ||
invert: true | ||
EC2ElasticIP: | ||
- property: "tag:sigs.k8s.io/cluster-api-provider-aws/cluster/capick8s-*" | ||
type: "glob" | ||
invert: true | ||
EC2NetworkInterface: | ||
- property: "tag:sigs.k8s.io/cluster-api-provider-aws/cluster/capick8s-*" | ||
type: "glob" | ||
invert: true | ||
ELBv2: | ||
- property: "tag:sigs.k8s.io/cluster-api-provider-aws/cluster/capick8s-*" | ||
type: "glob" | ||
invert: true | ||
ELBv2TargetGroup: | ||
- property: "tag:sigs.k8s.io/cluster-api-provider-aws/cluster/capick8s-*" | ||
type: "glob" | ||
invert: true | ||
S3Bucket: | ||
- property: "tag:sigs.k8s.io/cluster-api-provider-aws/cluster/capick8s-*" | ||
type: "glob" | ||
invert: true | ||
AutoScalingGroup: | ||
- property: "tag:sigs.k8s.io/cluster-api-provider-aws/cluster/capick8s-*" | ||
type: "glob" | ||
invert: true | ||
AutoScalingLaunchConfiguration: | ||
- property: "tag:sigs.k8s.io/cluster-api-provider-aws/cluster/capick8s-*" | ||
type: "glob" | ||
invert: true | ||
resource-types: | ||
includes: | ||
- EC2Instance | ||
- EC2SecurityGroup | ||
- EC2Volume | ||
- EC2InternetGateway | ||
- EC2NATGateway | ||
- EC2RouteTable | ||
- EC2Subnet | ||
- EC2VPC | ||
- EC2VPCEndpoint | ||
- EC2VPCEndpointServiceConfiguration | ||
- EC2ElasticIP | ||
- EC2NetworkInterface | ||
- ELBv2 | ||
- ELBv2TargetGroup | ||
- S3Bucket | ||
- AutoScalingGroup | ||
- AutoScalingLaunchConfiguration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit confused about the name of this file, I guess the contents of this file was supposed to be carried over to the
e2e.yaml
file or something