Skip to content

Commit 016d10c

Browse files
committed
chore: add top-level e2e fixture make targets
Adds top-level make targets for managing E2E fixtures to cover common use cases and reduce the number of commands to use the fixtures: - `deploy-{lima,ec2}-fixture`: Builds the Control Plane binaries, deploys and sets up the VMs, then deploys the Control Plane. - `update-{lima,ec2}-fixture`: Builds and deploys the Control Plane to an already-deployed fixture. - `reset-{lima,ec2}-fixture`: Builds the Control Plane binaries, tears down the existing Control Plane installation, and redeploys the Control Plane. - `stop-{lima,ec2}-fixture`: Stops the VMs - `teardown-{lima,ec2}-fixture`: Deletes the VMs
1 parent c56afda commit 016d10c

File tree

2 files changed

+180
-208
lines changed

2 files changed

+180
-208
lines changed

Makefile

Lines changed: 82 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,14 @@ LOG_LEVEL ?= info
66
DEV_IMAGE_REPO ?= ghcr.io/pgedge
77
CONTROL_PLANE_IMAGE_REPO ?= host.docker.internal:5000/control-plane
88
E2E_FIXTURE ?=
9-
E2E_PARALLEL ?=
9+
E2E_PARALLEL ?= 8
1010
E2E_RUN ?=
1111
E2E_SKIP_CLEANUP ?= 0
1212
E2E_DEBUG ?= 0
1313
E2E_DEBUG_DIR ?=
14+
FIXTURE_VARIANT ?= large
15+
FIXTURE_CONTROL_PLANE_IMAGE ?=
16+
FIXTURE_EXTRA_VARS ?=
1417
CLUSTER_TEST_PARALLEL ?=
1518
CLUSTER_TEST_RUN ?=
1619
CLUSTER_TEST_SKIP_IMAGE_BUILD ?= 0
@@ -27,7 +30,7 @@ docker_compose_dev=WORKSPACE_DIR=$(shell pwd) \
2730
DEV_IMAGE_REPO=$(DEV_IMAGE_REPO) \
2831
docker compose -f ./docker/control-plane-dev/docker-compose.yaml
2932
docker_compose_ci=docker compose -f ./docker/control-plane-ci/docker-compose.yaml
30-
e2e_args=-tags=e2e_test -count=1 -timeout=20m ./e2e/... \
33+
e2e_args=-tags=e2e_test -count=1 -timeout=45m ./e2e/... \
3134
$(if $(E2E_PARALLEL),-parallel $(E2E_PARALLEL)) \
3235
$(if $(E2E_RUN),-run $(E2E_RUN)) \
3336
-args \
@@ -148,6 +151,83 @@ licenses-ci: licenses
148151
.PHONY: ci
149152
ci: test-ci lint-ci licenses-ci
150153

154+
################
155+
# e2e fixtures #
156+
################
157+
158+
_fixture_extra_vars=$(if $(FIXTURE_CONTROL_PLANE_IMAGE),external_control_plane_image=$(FIXTURE_CONTROL_PLANE_IMAGE) ,)$(FIXTURE_EXTRA_VARS)
159+
160+
# Set to 'goreleaser-build' if no external image is specified
161+
_fixture_goreleaser_build=$(if $(findstring external_control_plane_image,$(_fixture_extra_vars)),,goreleaser-build)
162+
163+
.PHONY: _deploy-%-fixture
164+
_deploy-%-fixture: $(_fixture_goreleaser_build)
165+
VARIANT=$(FIXTURE_VARIANT) \
166+
EXTRA_VARS='$(_fixture_extra_vars)' \
167+
$(MAKE) -C e2e/fixtures \
168+
deploy-$*-machines \
169+
setup-$*-hosts \
170+
deploy-$*-control-plane
171+
172+
.PHONY: deploy-lima-fixture
173+
deploy-lima-fixture: _deploy-lima-fixture
174+
175+
.PHONY: deploy-ec2-fixture
176+
deploy-ec2-fixture: _deploy-ec2-fixture
177+
178+
.PHONY: _update-%-fixture
179+
_update-%-fixture: $(_fixture_goreleaser_build)
180+
VARIANT=$(FIXTURE_VARIANT) \
181+
EXTRA_VARS='$(_fixture_extra_vars)' \
182+
$(MAKE) -C e2e/fixtures \
183+
deploy-$*-control-plane
184+
185+
.PHONY: update-lima-fixture
186+
update-lima-fixture: _update-lima-fixture
187+
188+
.PHONY: update-ec2-fixture
189+
update-ec2-fixture: _update-ec2-fixture
190+
191+
.PHONY: _reset-%-fixture
192+
_reset-%-fixture: $(_fixture_goreleaser_build)
193+
VARIANT=$(FIXTURE_VARIANT) \
194+
EXTRA_VARS='$(_fixture_extra_vars)' \
195+
$(MAKE) -C e2e/fixtures \
196+
teardown-$*-control-plane \
197+
deploy-$*-control-plane
198+
199+
.PHONY: reset-lima-fixture
200+
reset-lima-fixture: _reset-lima-fixture
201+
202+
.PHONY: reset-ec2-fixture
203+
reset-ec2-fixture: _reset-ec2-fixture
204+
205+
.PHONY: _stop-%-fixture
206+
_stop-%-fixture:
207+
VARIANT=$(FIXTURE_VARIANT) \
208+
EXTRA_VARS='$(_fixture_extra_vars)' \
209+
$(MAKE) -C e2e/fixtures \
210+
stop-$*-machines
211+
212+
.PHONY: stop-lima-fixture
213+
stop-lima-fixture: _stop-lima-fixture
214+
215+
.PHONY: stop-ec2-fixture
216+
stop-ec2-fixture: _stop-ec2-fixture
217+
218+
.PHONY: _teardown-%-fixture
219+
_teardown-%-fixture:
220+
VARIANT=$(FIXTURE_VARIANT) \
221+
EXTRA_VARS='$(_fixture_extra_vars)' \
222+
$(MAKE) -C e2e/fixtures \
223+
teardown-$*-machines
224+
225+
.PHONY: teardown-lima-fixture
226+
teardown-lima-fixture: _teardown-lima-fixture
227+
228+
.PHONY: teardown-ec2-fixture
229+
teardown-ec2-fixture: _teardown-ec2-fixture
230+
151231
###############
152232
# image build #
153233
###############

0 commit comments

Comments
 (0)