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)
|
2024-01-17 10:05:50 +00:00
|
|
|
# Exclude parallel tests
|
|
|
|
TEST_EXCLUDE := --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:
|
2023-09-03 06:16:24 +00:00
|
|
|
@echo "Running ruff..."
|
|
|
|
ruff check moto tests
|
2024-03-22 21:04:01 +00:00
|
|
|
ruff format --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:
|
|
|
|
ruff format moto/ tests/
|
2024-03-15 19:51:25 +00:00
|
|
|
ruff check --fix moto/ tests/
|
2020-12-03 18:32:06 +00:00
|
|
|
|
2019-10-27 01:47:45 +00:00
|
|
|
test-only:
|
2021-01-26 12:37:03 +00:00
|
|
|
rm -f .coverage
|
|
|
|
rm -rf cover
|
2023-03-12 16:54:50 +00:00
|
|
|
pytest -sv -rs --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
|
2023-03-12 16:54:50 +00:00
|
|
|
pytest -sv -rs ./tests/test_xray
|
2023-08-31 06:47:49 +00:00
|
|
|
MOTO_CALL_RESET_API=false pytest -sv --cov=moto --cov-report xml --cov-append -n 4 $(PARALLEL_TESTS) --dist loadscope
|
2018-11-27 16:12:41 +00:00
|
|
|
|
2019-10-27 01:47:45 +00:00
|
|
|
test: lint test-only
|
|
|
|
|
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
|
|
|
|
2023-03-27 16:56:19 +00:00
|
|
|
cloudformation_coverage:
|
2023-04-11 14:31:46 +00:00
|
|
|
./scripts/cloudformation_coverage.py
|
2023-03-27 16:56:19 +00:00
|
|
|
git commit CLOUDFORMATION_COVERAGE.md -m "Updating CloudFormation coverage" || true
|
|
|
|
|
|
|
|
coverage: implementation_coverage cloudformation_coverage
|
|
|
|
|
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
|