teleport/e2e/Makefile
Jakub Nyckowski e1e0b79096
Add Playwright E2E tests boilerplates (#29286)
* Add end-to-end tests with Playwright

This commit introduces end-to-end tests with Docker Compose to improve code quality and provide a more robust testing environment. This involves adding a GitHub workflow for manually triggering the test suite, Makefile commands for running, the tests, and configurations. This addition will enable easier testing and provide a platform for future test development.

* Cleanup

* Only allow manual CI trigger

* Ignore e2e tests in Jest configuration

Added 'testPathIgnorePatterns' field to the Jest configuration in order to ignore end-to-end tests when running unit tests.

* Address code review comments

* Update e2e test environment for multi-architecture support

Modified the end-to-end test setup scripts and docker files to support both Linux and MacOS architectures. The build process now detects the system architecture and downloads the appropriate version of `mkcert`. Also, there is a control flow to build binaries only if they don't exist and the build files are now mounted from the build directory instead of being copied. These changes aim to make the e2e tests more robust and adaptable to different development environments.

* Update Makefile and teleport.yaml for testing improvements

Continued refinement of testing process by updating the Makefile and teleport.yaml. Changes to the Makefile include additional phony targets, modification of build-binaries, and a new 'all' target which runs key steps in sequence. The teleport.yaml file was updated to version v3.

* Fix makefile on MacOS

* Add Readme
2023-08-07 23:59:22 +00:00

35 lines
816 B
Makefile

SYSTEM_ARCH=$(shell go env GOARCH)
OS=$(shell go env GOOS)
.PHONY: test clean stop build all build-binaries
test:
# Build binaries if they don't exist
test -f "../build/teleport" || make build-binaries
docker compose up --abort-on-container-exit --exit-code-from e2e
clean:
docker volume rm e2e_teleport-config e2e_teleport-data
stop:
docker compose down
build:
docker compose build --build-arg BUILDARCH=$(SYSTEM_ARCH)
docker compose create
build-binaries:
# Use Docker to build binaries on MacOS as the testsuite runs in a Linux container
ifeq ($(OS),darwin)
ARCH=$(SYSTEM_ARCH) make -C ../build.assets/ build-binaries
else ifeq ($(OS),linux)
make -C ../ full
else
@echo "Unsupported OS: $(OS)"
@exit 1
endif
all:
make stop
make clean || true # ignore if no volumes exist
make build
make test