Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…tools-python into develop

* '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)
  • Loading branch information
heitorlessa committed Jul 14, 2022
2 parents 2349591 + b852946 commit a2d9c65
Show file tree
Hide file tree
Showing 23 changed files with 1,046 additions and 10 deletions.
1 change: 0 additions & 1 deletion .github/scripts/label_related_issue.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ module.exports = async ({github, context, core}) => {
return core.notice("Only merged PRs to avoid spam; skipping")
}


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

try {
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/run-e2e-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: run-e2e-tests
on:
workflow_dispatch:
env:
AWS_DEFAULT_REGION: us-east-1
E2E_TESTS_PATH: tests/e2e/
jobs:
run:
runs-on: ubuntu-latest
permissions:
id-token: write # needed to request JWT with GitHub's OIDC Token endpoint. docs: https://bit.ly/3MNgQO9
contents: read
strategy:
matrix:
version: ["3.7", "3.8", "3.9"]
steps:
- name: "Checkout"
uses: actions/checkout@v3
- name: "Use Python"
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.version }}
architecture: "x64"
- name: Install dependencies
run: make dev
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ secrets.AWS_TEST_ROLE_ARN }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
- name: Test
run: make e2e-test
7 changes: 7 additions & 0 deletions MAINTAINERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
- [Changelog generation](#changelog-generation)
- [Bumping the version](#bumping-the-version)
- [Drafting release notes](#drafting-release-notes)
- [Run end to end tests](#run-end-to-end-tests)
- [Releasing a documentation hotfix](#releasing-a-documentation-hotfix)
- [Maintain Overall Health of the Repo](#maintain-overall-health-of-the-repo)
- [Manage Roadmap](#manage-roadmap)
Expand Down Expand Up @@ -210,7 +211,13 @@ The best part comes now. Replace the placeholder `[Human readable summary of cha
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.

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

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).

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.

**NOTE**: E2E tests are run as part of each merge to `develop` branch.
### Releasing a documentation hotfix

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.
Expand Down
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,17 @@ lint-docs-fix:
docker run -v ${PWD}:/markdown 06kellyjac/markdownlint-cli --fix "docs"

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

unit-test:
poetry run pytest tests/unit

e2e-test:
poetry run pytest -rP -n 3 --dist loadscope --durations=0 --durations-min=1 tests/e2e

coverage-html:
poetry run pytest -m "not perf" --cov=aws_lambda_powertools --cov-report=html
poetry run pytest -m "not perf" --ignore tests/e2e --cov=aws_lambda_powertools --cov-report=html

pre-commit:
pre-commit run --show-diff-on-failure
Expand Down
Loading

0 comments on commit a2d9c65

Please sign in to comment.