cypress-parallel-api

command module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 5, 2021 License: MIT Imports: 13 Imported by: 0

README

cypress-parallel-api CircleCI

cypress-parallel-api is the api used by cypress-parallel frontend UI. The api permit to create pods inside your kubernetes cluster triggered by curl commands or via UI.

API url

By default, the api url is http://127.0.0.1:8080 but it can be override with os environment variable CYPRESS_PARALLEL_API_URL.

Database

Our api is developped with PostgresSQL database so the environment variable CYPRESS_PARALLEL_API_DB_URI must be set:

export CYPRESS_PARALLEL_API_DB_URI="postgres://USERNAME:PASSWORD@HOST:PORT/DB_NAME?sslmode=disable"

Development

Kind

During you local development, you must set the variable CYPRESS_PARALLEL_API_K8S_CLIENT_OUTSIDE in order to create to make the api loggued in with your .kube/config

export CYPRESS_PARALLEL_API_K8S_CLIENT_OUTSIDE=true

Please read Kind setup here

Start your postgres sql instance
sudo docker-compose up -d -f docker-compose.yml.yaml
Debugging

To enable the debug mode on the api:

export CYPRESS_PARALLEL_API_LOG_LEVEL=debug

To enable the debug mode on the cli:

export CYPRESS_PARALLEL_CLI_LOG_LEVEL=debug

Content types

Supported content types are:

  • application/x-www-form-urlencoded
  • application/json

Unit testing

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.out

See covering in the browser with:

go tool cover -html=coverage.out

See covering in the shell with:

go tool cover -func=coverage.out

Linter

# https://freshman.tech/linting-golang/
go install github.com/nametake/golangci-lint-langserver@latest

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package annotations will manage all annotations requirements that will be injected in pods Package annotations will manage all annotations requirements
Package annotations will manage all annotations requirements that will be injected in pods Package annotations will manage all annotations requirements
Package commons assemble all functions used in other packages
Package commons assemble all functions used in other packages
Package environments will manage all environments requirements that will be injected in pods Package environments will manage all environments requirements
Package environments will manage all environments requirements that will be injected in pods Package environments will manage all environments requirements
Package executions will manage all executions requirements Package executions will manage all executions requirements
Package executions will manage all executions requirements Package executions will manage all executions requirements
Package git will manage all requirements to clone repository
Package git will manage all requirements to clone repository
Package health assemble all functions required for health checks
Package health assemble all functions required for health checks
Package hooks will manage all hooks requirements Package hooks will manage all hooks requirements
Package hooks will manage all hooks requirements Package hooks will manage all hooks requirements
Package kubernetes will manage all kubernetes pods requirements
Package kubernetes will manage all kubernetes pods requirements
Package logger expose all log levels for the api
Package logger expose all log levels for the api
Package models assemble all struct used by other packages
Package models assemble all struct used by other packages
Package postgres stand to manage db init and ping
Package postgres stand to manage db init and ping
Package projects will manage all projects requirements Package projects will manage all projects requirements
Package projects will manage all projects requirements Package projects will manage all projects requirements
Package routers expose all routes of the api Package routers expose all routes of the api
Package routers expose all routes of the api Package routers expose all routes of the api
Package teams will manage all teams requirements Package teams will manage all teams requirements
Package teams will manage all teams requirements Package teams will manage all teams requirements
Package tools assemble useful functions used by other packages
Package tools assemble useful functions used by other packages

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL