-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
44 lines (32 loc) · 935 Bytes
/
Copy pathMakefile
File metadata and controls
44 lines (32 loc) · 935 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
$(shell mkdir -p build)
SRCS=$(wildcard src/*.go src/common/*.go src/proxy/*.go)
format:
cd src && gofmt -s -w .
.PHONY: build
build: build/reverse-proxy
build/reverse-proxy: $(SRCS)
cd src && go build -o ../build/reverse-proxy
# Helper target to build and run with a known-good test config
run: build
./build/reverse-proxy e2e/configs/test_bad_gateway.yaml
# Run unit tests
.PHONY: unit
unit:
cd src && go test -v -coverprofile coverage.out ./...
# Open unit test code coverage report
.PHONY: coverage
coverage:
cd src && go tool cover -html=coverage.out
.PHONY: venv
venv: build/venv/bin/activate
# Create a Python venv and install libs
build/venv/bin/activate: e2e/requirements.txt
python3 -m venv build/venv && build/venv/bin/pip install -r e2e/requirements.txt
ACTIVATE_VENV=. build/venv/bin/activate
# Run e2e tests
.PHONY: e2e
e2e: build venv
$(ACTIVATE_VENV) && pytest e2e
.PHONY: clean
clean:
rm -rf build