wip-cache #2

Merged
realaravinth merged 6 commits from wip-cache into master 2023-12-09 02:58:16 +05:30
Showing only changes of commit beeef3c7bd - Show all commits

View file

@ -19,6 +19,12 @@ define configure_locust
ansible-playbook -i $(INVENTORY) -f 10 ./ansible/locust.yml
endef
define configure_cache
. ./venv/bin/activate && \
ansible-playbook -i $(INVENTORY) -f 10 ./ansible/cache.yml
endef
define test_base
. ./venv/bin/activate && \
cd tests/ && \
@ -31,6 +37,19 @@ define test_base
endef
define test_cache
. ./venv/bin/activate && \
cd tests/cache/ && \
ANSIBLE_REMOTE_USER=root \
py.test --hosts='ansible://mcaptcha_hosts' \
-n 10 \
--verbose \
--ansible-inventory="../../${INVENTORY}" \
base.py
endef
define test_locust
. ./venv/bin/activate && \
cd tests/locust/ && \
@ -62,6 +81,13 @@ lint: ## Lint source code
conf.dos: ## Configure all DoS VMs
$(call configure_locust)
# ```bash
# INVENTORY=./terraform/dos/hosts.ini make conf.cache
# ```
conf.cache: ## Configure all cache VMs
$(call configure_cache)
# ```bash
# INVENTORY=./terraform/dos/hosts.ini make conf.ping
# ```
@ -76,5 +102,10 @@ test: ## Run all tests
test.base: ## Test base configuration on all VMs
$(call test_base)
test.cache: ## Test cache configuration
$(call test_cache)
help: ## Prints help for targets with comments
@cat $(MAKEFILE_LIST) | grep -E '^[a-zA-Z_-].+:.*?## .*$$' | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'