cypress-parallel is a single binary that hold both frontend UI and API that permit to run cypress unit testing.
It create pods inside your kubernetes cluster triggered by api or via UI.
On this UI you will be able to:
- create, update and delete teams
- create, update and delete projects and also trigger new unit testing
- create, update and delete annotations that will be used by pods
- create, update and delete environments variables that will be used by pods
- See execution results of units testing
cypress-parallel use also 2 sub-components:
By default, the api url is http://127.0.0.1:8080 but it can be override with os environment variable CYPRESS_PARALLEL_URL.
Our api is developped with PostgresSQL 10+ database so the environment variable CYPRESS_PARALLEL_DB_URI must be set:
export CYPRESS_PARALLEL_DB_URI="postgres://USERNAME:PASSWORD@HOST:PORT/DB_NAME?sslmode=disable"In a shell, start the UI:
export CYPRESS_PARALLEL_PORT=8080
cd ui
npm run devIn an another shell, start the API:
export CYPRESS_PARALLEL_K8S_CLIENT_OUTSIDE=true
export CYPRESS_PARALLEL_PORT=8080
go run main.goAdd githook like so:
git config core.hooksPath .githooksDuring you local development, you must set the variable CYPRESS_PARALLEL_K8S_CLIENT_OUTSIDE in order to make the api loggued in with your .kube/config
export CYPRESS_PARALLEL_K8S_CLIENT_OUTSIDE=truePlease read Kind setup here
sudo docker-compose up -dTo enable the debug mode on the api:
export CYPRESS_PARALLEL_LOG_LEVEL=debugTo enable the debug mode on the cli:
export CYPRESS_PARALLEL_CLI_LOG_LEVEL=debugSupported content types are:
- application/x-www-form-urlencoded
- application/json
Make sure to add unit testing for almost every new features in order to ensure the quality of the api.
Run tests with:
go test -v ./... -coverprofile=coverage.outSee covering in the browser with:
go tool cover -html=coverage.outSee covering in the shell with:
go tool cover -func=coverage.out# https://golangci-lint.run/usage/install/
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest