-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjustfile
79 lines (67 loc) · 1.92 KB
/
justfile
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# List out available commands
default:
@just --list
# Execute installation
setup:
@echo "Setting up project."
poetry install
poetry shell
@echo "Project setup complete!"
# Launch API in debug mode
run-debug:
@echo "Running main app..."
@python3 app.py --port 8080 --debug
# Launch API in production mode
run-prod:
@echo "Running main app..."
@python3 app.py --port 8080
# Build Docker image
build-docker:
@echo "Building docker image..."
docker build -t fizzbuzz-api:latest -f ./Dockerfile .
@echo "Docker image built successfully!"
# Clean unused files
clean:
-@find ./ -name '*.pyc' -exec rm -f {} \;
-@find ./ -name '__pycache__' -exec rm -rf {} \;
-@find ./ -name 'Thumbs.db' -exec rm -f {} \;
-@find ./ -name '*~' -exec rm -f {} \;
-@rm -rf .pytest_cache
-@rm -rf .cache
-@rm -rf .mypy_cache
-@rm -rf build
-@rm -rf dist
-@rm -rf *.egg-info
-@rm -rf htmlcov
-@rm -rf .tox/
-@rm -rf docs/_build
-@rm -rf .venv
@echo "Cleaned out unused files and directories!"
# Run PyTest unit tests
pytest *args:
@echo "Running unittest suite..."
poetry run pytest {{ args }}
-@find ./ -name '__pycache__' -exec rm -rf {} \;
-@rm -rf .pytest_cache
@echo "Cleaned up test environment"
coverage:
poetry run coverage run --source=api --omit="*/__*.py,*/test_*.py" -m pytest
poetry run coverage report
# Run Behave feature tests
behave:
@echo "Running feature test suite..."
poetry run behave ./tests/features/feature_tests/api_features
# Run load tests
locust:
@echo "Running load testing"
locust -f ./tests/load-test/locustfile.py
smoke-tests:
@echo "Running smoke test suite..."
python3 tests/smoke-tests/smoketests.py
# Start Compose with load-balancer
docker-up:
docker compose -f docker/docker-compose.yml up
# Stop all Compose containers and delete images created
docker-down:
docker compose -f docker/docker-compose.yml down
docker rmi $(docker images | grep "fizzbuzz-app" | awk "{print \$3}")