Files
kapow/Makefile
pancho horrillo ab50721f69 test(spec): Control Server API secured via cross-pinning mTLS
. We are now leveraging nix for portable dependency handling.
. There are now three types of tests: client, server and end-to-end.
. server tests exercise the actual kapow server being tested, while the
requests are performed using the test steps.
. client tests exercise the actual kapow client being tested, while the
requests are served using the test steps.
. e2e test exercise the actual kapow program in its dual role of client
and server (¡como tiene que ser!).

Co-authored-by: Roberto Abdelkader Martínez Pérez <robertomartinezp@gmail.com>
2021-03-12 17:09:50 +01:00

53 lines
1.0 KiB
Makefile

.PHONY: lint build test jaillover race coverage install acceptance deps docker clean
GOCMD=go
GOBUILD=$(GOCMD) build -trimpath
GOINSTALL=$(GOCMD) install -trimpath
GOGET=$(GOCMD) get
GOTEST=$(GOCMD) test
GOTOOL=$(GOCMD) tool
GOLANGLINT=golangci-lint
PROJECTREPO=github.com/BBVA/kapow
BUILD_DIR=./build
OUTPUT_DIR=./output
TMP_DIR=/tmp
DOCS_DIR=./doc
DOCKER_DIR=./docker
BINARY_NAME=kapow
all: lint test race build
lint:
$(GOLANGLINT) run
build: deps
mkdir -p $(BUILD_DIR)
CGO_ENABLED=0 $(GOBUILD) -o $(BUILD_DIR)/$(BINARY_NAME) -v
test: build jaillover
$(GOTEST) -v -coverprofile=$(TMP_DIR)/c.out ./...
jaillover:
$(GOGET) $(PROJECTREPO)/testutils/$@
race: build
$(GOTEST) -race -v ./...
coverage: test race
mkdir -p $(OUTPUT_DIR)
$(GOTOOL) cover -html=$(TMP_DIR)/c.out -o $(OUTPUT_DIR)/coverage.html
install: build
CGO_ENABLED=0 $(GOINSTALL) ./...
acceptance: build
cd ./spec/test && PATH=$(PWD)/build:$$PATH nix-shell --command make
deps:
@echo "deps here"
clean:
rm -rf $(BUILD_DIR) $(OUTPUT_DIR) $(DOCKER_DIR)/*