Skip to content

Commit a2d9c65

Browse files
committed
* 'develop' of https://github.com/awslabs/aws-lambda-powertools-python: chore(ci): add end to end testing mechanism (#1247) chore(deps-dev): bump mypy-boto3-appconfig from 1.24.0 to 1.24.29 (#1295)
2 parents 2349591 + b852946 commit a2d9c65

23 files changed

+1046
-10
lines changed

.github/scripts/label_related_issue.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ module.exports = async ({github, context, core}) => {
1717
return core.notice("Only merged PRs to avoid spam; skipping")
1818
}
1919

20-
2120
const RELATED_ISSUE_REGEX = /Issue number:[^\d\r\n]+(?<issue>\d+)/;
2221

2322
try {

.github/workflows/run-e2e-tests.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: run-e2e-tests
2+
on:
3+
workflow_dispatch:
4+
env:
5+
AWS_DEFAULT_REGION: us-east-1
6+
E2E_TESTS_PATH: tests/e2e/
7+
jobs:
8+
run:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
id-token: write # needed to request JWT with GitHub's OIDC Token endpoint. docs: https://bit.ly/3MNgQO9
12+
contents: read
13+
strategy:
14+
matrix:
15+
version: ["3.7", "3.8", "3.9"]
16+
steps:
17+
- name: "Checkout"
18+
uses: actions/checkout@v3
19+
- name: "Use Python"
20+
uses: actions/setup-python@v3
21+
with:
22+
python-version: ${{ matrix.version }}
23+
architecture: "x64"
24+
- name: Install dependencies
25+
run: make dev
26+
- name: Configure AWS credentials
27+
uses: aws-actions/configure-aws-credentials@v1
28+
with:
29+
role-to-assume: ${{ secrets.AWS_TEST_ROLE_ARN }}
30+
aws-region: ${{ env.AWS_DEFAULT_REGION }}
31+
- name: Test
32+
run: make e2e-test

MAINTAINERS.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
- [Changelog generation](#changelog-generation)
1717
- [Bumping the version](#bumping-the-version)
1818
- [Drafting release notes](#drafting-release-notes)
19+
- [Run end to end tests](#run-end-to-end-tests)
1920
- [Releasing a documentation hotfix](#releasing-a-documentation-hotfix)
2021
- [Maintain Overall Health of the Repo](#maintain-overall-health-of-the-repo)
2122
- [Manage Roadmap](#manage-roadmap)
@@ -210,7 +211,13 @@ The best part comes now. Replace the placeholder `[Human readable summary of cha
210211
Once you're happy, hit `Publish release`. This will kick off the [Publishing workflow](https://github.com/awslabs/aws-lambda-powertools-python/actions/workflows/publish.yml) and within a few minutes you should see the latest version in PyPi, and all issues labeled as `pending-release` will be notified.
211212

212213
> TODO: Wait for @am29d new Lambda Layers pipeline work to complete, then add how Lambda Layers are published
214+
### Run end to end tests
213215

216+
In order to run end to end tests you need to install CDK CLI first and bootstrap your account with `cdk bootstrap` command. For additional details follow [documentation](https://docs.aws.amazon.com/cdk/v2/guide/bootstrapping.html).
217+
218+
To run locally, export `AWS_PROFILE` environment variable and run `make e2e tests`. To run from GitHub Actions, use [run-e2e-tests workflow](https://github.com/awslabs/aws-lambda-powertools-python/actions/workflows/run-e2e-tests.yml) and pick the branch you want to run tests against.
219+
220+
**NOTE**: E2E tests are run as part of each merge to `develop` branch.
214221
### Releasing a documentation hotfix
215222

216223
You can rebuild the latest documentation without a full release via this [GitHub Actions Workflow](https://github.com/awslabs/aws-lambda-powertools-python/actions/workflows/rebuild_latest_docs.yml). Choose `Run workflow`, keep `develop` as the branch, and input the latest Powertools version available.

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,17 @@ lint-docs-fix:
2323
docker run -v ${PWD}:/markdown 06kellyjac/markdownlint-cli --fix "docs"
2424

2525
test:
26-
poetry run pytest -m "not perf" --cov=aws_lambda_powertools --cov-report=xml
26+
poetry run pytest -m "not perf" --ignore tests/e2e --cov=aws_lambda_powertools --cov-report=xml
2727
poetry run pytest --cache-clear tests/performance
2828

2929
unit-test:
3030
poetry run pytest tests/unit
3131

32+
e2e-test:
33+
poetry run pytest -rP -n 3 --dist loadscope --durations=0 --durations-min=1 tests/e2e
34+
3235
coverage-html:
33-
poetry run pytest -m "not perf" --cov=aws_lambda_powertools --cov-report=html
36+
poetry run pytest -m "not perf" --ignore tests/e2e --cov=aws_lambda_powertools --cov-report=html
3437

3538
pre-commit:
3639
pre-commit run --show-diff-on-failure

0 commit comments

Comments
 (0)