-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
45 lines (38 loc) · 1.54 KB
/
Makefile
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
44
45
.ONESHELL:
ENV_PREFIX=$(shell python -c "if __import__('pathlib').Path('.venv/bin/pip').exists(): print('.venv/bin/')")
.PHONY: help
help: ## Show the help.
@echo "Usage: make <target>"
@echo ""
@echo "Targets:"
@fgrep "##" Makefile | fgrep -v fgrep
.PHONY: venv
venv: ## Create a virtual environment
@echo "Creating virtualenv ..."
@rm -rf .venv
@python3 -m venv .venv
@./.venv/bin/pip install -U pip
@echo
@echo "Run 'source .venv/bin/activate' to enable the environment"
.PHONY: install
install: ## Install dependencies
pip install -r requirements-dev.txt
pip install -r requirements-test.txt
pip install -r requirements.txt
STRESS_URL = https://delay-model-api-qzo5moezqa-uw.a.run.app
.PHONY: stress-test
stress-test:
# change stress url to your deployed app
mkdir reports || true
locust -f tests/stress/api_stress.py --print-stats --html reports/stress-test.html --run-time 60s --headless --users 100 --spawn-rate 1 -H $(STRESS_URL)
.PHONY: model-test
model-test: ## Run tests and coverage
mkdir reports || true
pytest --cov-config=.coveragerc --cov-report term --cov-report html:reports/html --cov-report xml:reports/coverage.xml --junitxml=reports/junit.xml --cov=challenge tests/model
.PHONY: api-test
api-test: ## Run tests and coverage
mkdir reports || true
pytest --cov-config=.coveragerc --cov-report term --cov-report html:reports/html --cov-report xml:reports/coverage.xml --junitxml=reports/junit.xml --cov=challenge tests/api
.PHONY: build
build: ## Build locally the python artifact
python setup.py bdist_wheel