-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #104 from tremble/test_policies
Add tests against 'hacking' policies and add a size test
- Loading branch information
Showing
15 changed files
with
192 additions
and
389 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
PYTHON3 ?= python3.7 | ||
|
||
EXTRA_VARS=ansible_connection=local ansible_python_interpreter=$(shell which python) | ||
RUN_TEST_POLICY_PLAYBOOK=ansible-playbook -i localhost, -e '$(EXTRA_VARS)' deploy-test-policy.yml $(FLAGS) | ||
RUN_TERMINATOR_PLAYBOOK=ansible-playbook -i localhost, -e '$(EXTRA_VARS)' terminator.yml $(FLAGS) | ||
|
||
VAULT_ARGS := $(if $(ANSIBLE_VAULT_PASSWORD_FILE),,--ask-vault-pass) | ||
|
||
.PHONY: default | ||
default: | ||
@echo ">>> Running Tests" | ||
@echo | ||
@echo "USAGE: make test|test-requirements|yamllint|pycodestyle|pylint [PYTHON3=$(PYTHON3)]" | ||
|
||
.PHONY: test_policy | ||
test_policy: | ||
$(RUN_TEST_POLICY_PLAYBOOK) | ||
|
||
.PHONY: test | ||
test: yamllint policy | ||
|
||
.PHONY: test-requirements | ||
test-requirements: | ||
"$(PYTHON3)" -m pip install -c ../constraints.txt -r requirements.txt -r test-requirements.txt --disable-pip-version-check | ||
|
||
.PHONY: yamllint | ||
yamllint: | ||
"$(PYTHON3)" -m yamllint --config-file ../.yamllint . | ||
|
||
.PHONY: policy | ||
policy: | ||
ansible-playbook -i localhost aws_config/test-policies.yml | ||
|
||
.PHONY: pycodestyle | ||
pycodestyle: | ||
find . -name '*.py' | xargs "$(PYTHON3)" -m pycodestyle --config ../pycodestyle.ini | ||
|
||
.PHONY: pylint | ||
pylint: | ||
find . -name '*.py' | xargs "$(PYTHON3)" -m pylint --rcfile pylint.rc |
Oops, something went wrong.