Skip to content

Commit b6f9e9e

Browse files
authored
chore: split int tests from unit (#85)
1 parent adfe58d commit b6f9e9e

File tree

9 files changed

+159
-137
lines changed

9 files changed

+159
-137
lines changed

.github/workflows/python-app.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ jobs:
4343
run: |
4444
make complex
4545
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
46-
- name: Unit tests
46+
- name: Unit and Integration tests
4747
run: |
48-
make unit
48+
make pipeline-tests
4949
- name: Codecov
5050
uses: codecov/codecov-action@v3.1.0
5151
with:

Makefile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: dev lint complex coverage pre-commit yapf sort deploy destroy deps unit e2e docs
1+
.PHONY: dev lint complex coverage pre-commit yapf sort deploy destroy deps unit integration e2e pipeline-tests docs
22

33

44

@@ -29,14 +29,20 @@ deps:
2929
unit:
3030
pytest tests/unit --cov-config=.coveragerc --cov=service --cov-report xml
3131

32+
integration:
33+
pytest tests/integration --cov-config=.coveragerc --cov=service --cov-report xml
34+
3235
e2e:
3336
pytest tests/e2e --cov-config=.coveragerc --cov=service --cov-report xml
3437

35-
pr: deps yapf sort pre-commit complex lint unit e2e
38+
pr: deps yapf sort pre-commit complex lint unit integration e2e
3639

3740
yapf:
3841
yapf -i -vv --style=./.style --exclude=.venv --exclude=.build --exclude=cdk.out --exclude=.git -r .
3942

43+
pipeline-tests:
44+
pytest tests/unit tests/integration --cov-config=.coveragerc --cov=service --cov-report xml
45+
4046
deploy:
4147
make deps
4248
mkdir -p .build/lambdas ; cp -r service .build/lambdas

Pipfile.lock

Lines changed: 115 additions & 112 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cdk/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@
2525
install_requires=[
2626
'aws-cdk-lib>=2.0.0',
2727
'constructs>=10.0.0',
28-
'aws-cdk.aws-lambda-python-alpha==2.24.1-alpha.0',
28+
'aws-cdk.aws-lambda-python-alpha==2.27.0-alpha.0',
2929
],
3030
)

dev_requirements.txt

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
-i https://pypi.org/simple
22
-e ./cdk
33
attrs==21.4.0
4-
aws-cdk-lib==2.25.0
5-
aws-cdk.aws-lambda-python-alpha==2.24.1a0
6-
boto3==1.23.9
7-
botocore==1.26.9
4+
aws-cdk-lib==2.27.0
5+
aws-cdk.aws-lambda-python-alpha==2.27.0a0
6+
boto3==1.24.7
7+
botocore==1.27.7
88
cattrs==1.10.0
99
certifi==2022.5.18.1
1010
cfgv==3.3.1
11-
charset-normalizer==2.0.12 ; python_version >= '3'
11+
charset-normalizer==2.0.12
1212
click==8.1.3
1313
colorama==0.4.4 ; python_version > '3.4'
14-
constructs==10.1.19
15-
coverage[toml]==6.4
14+
constructs==10.1.36
15+
coverage[toml]==6.4.1
1616
distlib==0.3.4
17-
filelock==3.7.0
17+
filelock==3.7.1
1818
flake8==4.0.1
1919
future==0.18.2
2020
ghp-import==2.1.0
@@ -27,15 +27,15 @@ iniconfig==1.1.1
2727
isort==5.10.1
2828
jinja2==3.1.2
2929
jmespath==1.0.0
30-
jsii==1.59.0
30+
jsii==1.60.1
3131
mando==0.6.4
3232
markdown==3.3.7
3333
markupsafe==2.1.1
3434
mccabe==0.6.1
3535
mergedeep==1.3.4
3636
mkdocs-git-revision-date-plugin==0.3.2
3737
mkdocs-material-extensions==1.0.3
38-
mkdocs-material==8.2.15
38+
mkdocs-material==8.3.4
3939
mkdocs==1.3.0
4040
nodeenv==1.6.0
4141
packaging==21.3
@@ -47,7 +47,7 @@ py==1.11.0
4747
pycodestyle==2.8.0
4848
pyflakes==2.4.0
4949
pygments==2.12.0
50-
pymdown-extensions==9.4
50+
pymdown-extensions==9.5
5151
pyparsing==3.0.9
5252
pytest-cov==3.0.0
5353
pytest-html==3.1.1
@@ -59,16 +59,16 @@ python-dotenv==0.20.0
5959
pyyaml-env-tag==0.1
6060
pyyaml==6.0
6161
radon==5.1.0
62-
requests==2.27.1
63-
s3transfer==0.5.2
62+
requests==2.28.0
63+
s3transfer==0.6.0
6464
six==1.16.0
6565
smmap==5.0.0
6666
toml==0.10.2
6767
tomli==2.0.1
6868
typing-extensions==4.2.0
6969
urllib3==1.26.9
7070
virtualenv==20.14.1
71-
watchdog==2.1.8
71+
watchdog==2.1.9
7272
xenon==0.9.0
7373
yapf==0.32.0
7474
zipp==3.8.0

docs/getting_started.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,25 @@ Run ``make dev``
1515
Create a cloudformation stack by running ``make deploy``
1616

1717

18-
## **Tests**
19-
Unit tests can be found under the ``tests`` folder.
18+
## **Unit Tests**
19+
Unit tests can be found under the ``tests/unit`` folder.
20+
21+
You can run the tests by using the following command: ``make unit``
22+
23+
## **Integration Tests**
24+
Make sure you deploy the stack first as these tests trigger your lambda handler LOCALLY but they can communicate with AWS services.
25+
26+
These tests allow you to debug in your IDE your AWS Lambda function.
27+
28+
Integration tests can be found under the ``tests/integration`` folder.
29+
2030
You can run the tests by using the following command: ``make unit``
2131

2232
## **E2E Tests**
2333
Make sure you deploy the stack first.
34+
35+
E2E tests can be found under the ``tests/e2e`` folder.
36+
2437
These tests send a 'POST' message to the deployed API GW and trigger the Lambda function on AWS.
2538

2639
The tests are run automatically by: ``make e2e``

lambda_requirements.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
-i https://pypi.org/simple
2-
aws-lambda-powertools==1.26.0
2+
aws-lambda-powertools==1.26.1
33
aws-xray-sdk==2.9.0
4-
boto3==1.23.9
5-
botocore==1.26.9
4+
boto3==1.24.7
5+
botocore==1.27.7
66
dnspython==2.2.1
77
email-validator==1.2.1
88
fastjsonschema==2.15.3
@@ -11,7 +11,7 @@ idna==3.3
1111
jmespath==1.0.0
1212
pydantic[email]==1.9.1
1313
python-dateutil==2.8.2
14-
s3transfer==0.5.2
14+
s3transfer==0.6.0
1515
six==1.16.0
1616
typing-extensions==4.2.0
1717
urllib3==1.26.9

tests/integration/__init__.py

Whitespace-only changes.
File renamed without changes.

0 commit comments

Comments
 (0)