-
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMakefile
More file actions
101 lines (77 loc) · 3.3 KB
/
Makefile
File metadata and controls
101 lines (77 loc) · 3.3 KB
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# Development
setup:
@test -n "$$CI" || devenv sync
.PHONY: setup
python-venv: ## Build Python virtual environment
python -m venv .venv
uv sync --all-packages --all-groups
.PHONY: python-venv
# Builds
build: ## Build all features without debug symbols
cargo build --all-features
.PHONY: build
release: ## Build a release profile with all features
cargo build --all-features --release
.PHONY: release
# Linting and style
style: ## Run style checking tools (cargo-fmt)
@rustup component add rustfmt 2> /dev/null
cargo fmt --all --check
.PHONY: style
lint: ## Run linting tools (cargo-clippy)
@rustup component add clippy 2> /dev/null
cargo clippy --workspace --all-targets --all-features --no-deps -- -D warnings
.PHONY: lint
format: ## Run autofix mode for formatting and lint
@rustup component add clippy 2> /dev/null
@rustup component add rustfmt 2> /dev/null
cargo fmt --all
cargo clippy --workspace --all-targets --all-features --no-deps --fix --allow-dirty --allow-staged -- -D warnings
.PHONY: format
# Tests
unit-test: ## Run unit tests
cargo test
.PHONY: unit-test
python-test: ## Run Python client tests
cd clients/python && uv run pytest --cov=src/taskbroker_client --cov-report=xml --cov-report=term
.PHONY: python-test
reset-kafka: setup ## Reset kafka
devservices down
-docker container rm kafka-kafka-1
-docker volume rm kafka_kafka-data
devservices up
.PHONY: reset-kafka
test-rebalance: build reset-kafka ## Run the rebalance integration test
python -m pytest integration_tests/integration_tests/test_consumer_rebalancing.py -s
rm -r integration_tests/.tests_output/test_consumer_rebalancing
.PHONY: test-rebalance
test-worker-processing: build reset-kafka ## Run the worker processing integration test
python -m pytest integration_tests/integration_tests/test_task_worker_processing.py -s
rm -r integration_tests/.tests_output/test_task_worker_processing
.PHONY: test-worker-processing
test-upkeep-retry: build reset-kafka ## Run the upkeep retry integration test
python -m pytest integration_tests/integration_tests/test_upkeep_retry.py -s
rm -r integration_tests/.tests_output/test_upkeep_retry
.PHONY: test-upkeep-retry
test-upkeep-expiry: build reset-kafka ## Run the upkeep expiry integration test
python -m pytest integration_tests/integration_tests/test_upkeep_expiry.py -s
rm -r integration_tests/.tests_output/test_upkeep_expiry
.PHONY: test-upkeep-expiry
test-upkeep-delay: build reset-kafka ## Run the upkeep delay integration test
python -m pytest integration_tests/integration_tests/test_upkeep_delay.py -s
rm -r integration_tests/.tests_output/test_upkeep_delay
.PHONY: test-upkeep-delay
test-failed-tasks: build reset-kafka ## Run the failed tasks integration test
python -m pytest integration_tests/integration_tests/test_failed_tasks.py -s
rm -r integration_tests/.tests_output/test_failed_tasks
.PHONY: test-failed-tasks
integration-test: test-rebalance test-worker-processing test-upkeep-retry test-upkeep-expiry test-upkeep-delay test-failed-tasks ## Run all integration tests
.PHONY: integration-test
# Benchmarks
bench:
cargo bench
.PHONY: bench
# Help
help: ## this help
@ awk 'BEGIN {FS = ":.*##"; printf "Usage: make \033[36m<target>\033[0m\n\nTargets:\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-10s\033[0m\t%s\n", $$1, $$2 }' $(MAKEFILE_LIST) | column -s$$'\t' -t
.PHONY: help