2013-02-18 21:09:40 +00:00
|
|
|
SHELL := /bin/bash
|
|
|
|
|
2022-04-16 10:02:57 +00:00
|
|
|
SERVICE_NAME = "default"
|
|
|
|
TEST_NAMES = "*"
|
|
|
|
|
2017-11-10 09:44:02 +00:00
|
|
|
ifeq ($(TEST_SERVER_MODE), true)
|
2020-09-04 11:14:48 +00:00
|
|
|
# exclude test_kinesisvideoarchivedmedia
|
|
|
|
# because testing with moto_server is difficult with data-endpoint
|
2023-02-08 22:56:51 +00:00
|
|
|
TEST_EXCLUDE := --ignore tests/test_kinesisvideoarchivedmedia --ignore tests/test_acm --ignore tests/test_amp --ignore tests/test_awslambda --ignore tests/test_batch --ignore tests/test_ec2 --ignore tests/test_sqs
|
2021-10-05 17:11:07 +00:00
|
|
|
# Parallel tests will be run separate
|
2023-02-08 22:56:51 +00:00
|
|
|
PARALLEL_TESTS := ./tests/test_acm/ ./tests/test_acmpca/ ./tests/test_amp/ ./tests/test_awslambda ./tests/test_batch ./tests/test_ec2 ./tests/test_sqs
|
2017-11-10 09:44:02 +00:00
|
|
|
else
|
2022-09-15 12:27:07 +00:00
|
|
|
TEST_EXCLUDE := --ignore tests/test_batch --ignore tests/test_ec2 --ignore tests/test_sqs
|
|
|
|
PARALLEL_TESTS := ./tests/test_batch ./tests/test_ec2 ./tests/test_sqs
|
2017-11-10 09:44:02 +00:00
|
|
|
endif
|
|
|
|
|
2013-02-18 21:09:40 +00:00
|
|
|
init:
|
2023-01-06 19:43:16 +00:00
|
|
|
@pip install -e .
|
2019-07-09 01:42:24 +00:00
|
|
|
@pip install -r requirements-dev.txt
|
2013-02-18 21:09:40 +00:00
|
|
|
|
2017-03-13 00:18:49 +00:00
|
|
|
lint:
|
2022-03-10 14:39:59 +00:00
|
|
|
@echo "Running flake8..."
|
2022-03-11 21:28:45 +00:00
|
|
|
flake8 moto tests
|
2022-03-10 14:39:59 +00:00
|
|
|
@echo "Running black... "
|
2022-10-03 21:28:28 +00:00
|
|
|
$(eval black_version := $(shell grep "^black==" requirements-dev.txt | sed "s/black==//"))
|
2022-04-19 22:18:28 +00:00
|
|
|
@echo "(Make sure you have black-$(black_version) installed, as other versions will produce different results)"
|
2019-10-27 01:47:45 +00:00
|
|
|
black --check moto/ tests/
|
2022-03-10 14:39:59 +00:00
|
|
|
@echo "Running pylint..."
|
2022-01-14 19:51:49 +00:00
|
|
|
pylint -j 0 moto tests
|
2022-10-06 08:37:35 +00:00
|
|
|
@echo "Running MyPy..."
|
2022-10-11 13:16:27 +00:00
|
|
|
mypy --install-types --non-interactive
|
2017-03-13 00:18:49 +00:00
|
|
|
|
2020-12-03 18:32:06 +00:00
|
|
|
format:
|
|
|
|
black moto/ tests/
|
|
|
|
|
2019-10-27 01:47:45 +00:00
|
|
|
test-only:
|
2021-01-26 12:37:03 +00:00
|
|
|
rm -f .coverage
|
|
|
|
rm -rf cover
|
|
|
|
pytest -sv --cov=moto --cov-report xml ./tests/ $(TEST_EXCLUDE)
|
2022-11-02 21:00:51 +00:00
|
|
|
# https://github.com/aws/aws-xray-sdk-python/issues/196 - Run these tests separately without Coverage enabled
|
|
|
|
pytest -sv ./tests/test_xray
|
2022-09-15 12:27:07 +00:00
|
|
|
MOTO_CALL_RESET_API=false pytest --cov=moto --cov-report xml --cov-append -n 4 $(PARALLEL_TESTS)
|
2018-11-27 16:12:41 +00:00
|
|
|
|
2019-10-27 01:47:45 +00:00
|
|
|
test: lint test-only
|
|
|
|
|
2022-04-16 10:02:57 +00:00
|
|
|
terraformtests:
|
|
|
|
@echo "Make sure that the MotoServer is already running on port 4566 (moto_server -p 4566)"
|
|
|
|
@echo "USAGE: make terraformtests SERVICE_NAME=acm TEST_NAMES=TestAccACMCertificate"
|
|
|
|
@echo ""
|
|
|
|
cd tests/terraformtests && bin/run_go_test $(SERVICE_NAME) "$(TEST_NAMES)"
|
|
|
|
|
2017-02-24 00:43:48 +00:00
|
|
|
test_server:
|
2021-02-02 18:01:00 +00:00
|
|
|
@TEST_SERVER_MODE=true pytest -sv --cov=moto --cov-report xml ./tests/
|
2017-02-24 00:43:48 +00:00
|
|
|
|
2017-09-19 21:01:08 +00:00
|
|
|
aws_managed_policies:
|
|
|
|
scripts/update_managed_policies.py
|
|
|
|
|
2017-10-25 10:28:18 +00:00
|
|
|
implementation_coverage:
|
2018-06-01 10:30:42 +00:00
|
|
|
./scripts/implementation_coverage.py
|
2017-11-20 20:13:44 +00:00
|
|
|
git commit IMPLEMENTATION_COVERAGE.md -m "Updating implementation coverage" || true
|
2017-10-25 10:28:18 +00:00
|
|
|
|
2017-09-22 10:23:10 +00:00
|
|
|
scaffold:
|
|
|
|
@pip install -r requirements-dev.txt > /dev/null
|
2017-09-25 21:11:11 +00:00
|
|
|
exec python scripts/scaffold.py
|
2020-09-13 15:08:23 +00:00
|
|
|
|
|
|
|
int_test:
|
|
|
|
@./scripts/int_test.sh
|