forked from aws/aws-sam-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
57 lines (44 loc) · 1.72 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Default value for environment variable. Can be overridden by setting the
# environment variable.
SAM_CLI_TELEMETRY ?= 0
init:
SAM_CLI_DEV=1 pip install -e '.[dev]'
test:
# Run unit tests
# Fail if coverage falls below 95%
pytest --cov samcli --cov-report term-missing --cov-fail-under 95 tests/unit
test-cov-report:
# Run unit tests with html coverage report
pytest --cov samcli --cov-report html --cov-fail-under 95 tests/unit
integ-test:
# Integration tests don't need code coverage
@echo Telemetry Status: $(SAM_CLI_TELEMETRY)
SAM_CLI_DEV=1 pytest tests/integration
func-test:
# Verify function test coverage only for `samcli.local` package
@echo Telemetry Status: $(SAM_CLI_TELEMETRY)
pytest --cov samcli.local --cov samcli.commands.local --cov-report term-missing tests/functional
regres-test:
@echo Telemetry Status: $(SAM_CLI_TELEMETRY)
SAM_CLI_DEV=1 pytest tests/regression
smoke-test:
# Smoke tests run in parallel
SAM_CLI_DEV=1 pytest -n 4 tests/smoke
lint:
# Linter performs static analysis to catch latent bugs
pylint --rcfile .pylintrc samcli
# mypy performs type check
mypy setup.py samcli tests
# Command to run everytime you make changes to verify everything works
dev: lint test
black:
black setup.py samcli tests
black-check:
black --check setup.py samcli tests
# Verifications to run before sending a pull request
pr: init dev black-check
update-reproducible-reqs:
python3.7 -m venv venv-update-reproducible-requirements
venv-update-reproducible-requirements/bin/pip install --upgrade pip-tools pip
venv-update-reproducible-requirements/bin/pip install -r requirements/base.txt
venv-update-reproducible-requirements/bin/pip-compile --generate-hashes --allow-unsafe -o requirements/reproducible-linux.txt