.PHONY: all clean default install update checks pc lint test

default: checks

install:
	pre-commit install
	poetry install --sync --no-root
	poetry run ansible-galaxy install -r requirements.yml

update:
	poetry up --latest

checks: pc

pc:
	pre-commit run -a

lint:
	poetry run ansible-lint

test-roles:
	poetry run pytest -rP --molecule roles -m docker -p no:warnings

test-plugins:
	poetry run pytest -rP --molecule tests/plugins -m docker -p no:warnings

test-%:
	pushd roles/$* && poetry run molecule test -s $*; popd

test-vg-%:
	pushd roles/$* && poetry run molecule test -s $*_vagrant; popd

test-plugin-%:
	poetry run pytest -rP "tests/test_integration.py::test_integration[plugins-$*]"
