Skip to content

Commit 1bb23e8

Browse files
expand testing
1 parent 74d4e66 commit 1bb23e8

File tree

7 files changed

+34
-12
lines changed

7 files changed

+34
-12
lines changed

.github/workflows/ci_static-analysis.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
python:
17-
- 3.8
1816
category:
1917
- bandit
2018
- doc8
@@ -32,7 +30,7 @@ jobs:
3230
- uses: actions/checkout@v3
3331
- uses: actions/setup-python@v4
3432
with:
35-
python-version: ${{ matrix.python }}
33+
python-version: 3.8
3634
- run: |
3735
python -m pip install --upgrade pip
3836
pip install --upgrade -r dev_requirements/ci-requirements.txt

.github/workflows/ci_tests.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,14 @@ jobs:
4444
category:
4545
- local
4646
- accept
47+
- mpllocal
48+
- mplaccept
4749
# These require credentials.
4850
# Enable them once we sort how to provide them.
4951
# - integ
5052
# - examples
53+
# Append '-mpl' to some test environments.
54+
# This suffix signals to tox to install the MPL in the test environment.
5155
optional_mpl_dependency:
5256
- ""
5357
- -mpl
@@ -66,7 +70,13 @@ jobs:
6670
optional_mpl_dependency: -mpl
6771
- python: 3.10
6872
optional_mpl_dependency: -mpl
73+
# mpllocal and mplaccept require the MPL to be installed
74+
- python: mpllocal
75+
optional_mpl_dependency:
76+
- python: mplaccept
77+
optional_mpl_dependency:
6978
steps:
79+
# Support long Dafny filenames (used in MPL and DBESDK repos)
7080
- name: Support longpaths
7181
run: |
7282
git config --global core.longpaths true

codebuild/py311/examples_mpl.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: 0.2
22

33
env:
44
variables:
5-
# No TOXENV; examples using the MPL switch envs
5+
# No TOXENV. This runs multiple environments.
66
REGION: "us-west-2"
77
AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >-
88
arn:aws:kms:us-west-2:658956600833:key/b3537ef1-d8dc-4780-9f5a-55776cbb2f7f
@@ -20,14 +20,15 @@ phases:
2020
build:
2121
commands:
2222
- pip install "tox < 4.0"
23+
# Run non-MPL-specific tests with the MPL installed
2324
- tox -e py311-examples-mpl
24-
# Assume special role
25+
# Assume special role to access keystore
2526
- TMP_ROLE=$(aws sts assume-role --role-arn "arn:aws:iam::370957321024:role/GitHub-CI-Public-ESDK-Python-Role-us-west-2" --role-session-name "CB-Py311ExamplesMpl")
2627
- export TMP_ROLE
2728
- export AWS_ACCESS_KEY_ID=$(echo "${TMP_ROLE}" | jq -r '.Credentials.AccessKeyId')
2829
- export AWS_SECRET_ACCESS_KEY=$(echo "${TMP_ROLE}" | jq -r '.Credentials.SecretAccessKey')
2930
- export AWS_SESSION_TOKEN=$(echo "${TMP_ROLE}" | jq -r '.Credentials.SessionToken')
3031
- aws sts get-caller-identity
31-
# Run special role-specific examples
32+
# Run MPL-specific tests with special role
3233
- tox -e py311-mplexamples-mpl
3334

codebuild/py312/awses_local_mpl.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Runs the same tests as awses_local in an environment with the MPL installed.
2+
# This asserts existing tests continue to pass with the MPL installed.
13
version: 0.2
24

35
env:

codebuild/py312/examples_mpl.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
# Runs the same tests as examples in an environment with the MPL installed
2+
# to assert existing tests continue to pass with the MPL installed.
3+
# Then, run MPL-specific tests.
14
version: 0.2
25

36
env:
47
variables:
5-
# No TOXENV; examples using the MPL switch envs
8+
# No TOXENV. This runs multiple environments.
69
REGION: "us-west-2"
710
AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >-
811
arn:aws:kms:us-west-2:658956600833:key/b3537ef1-d8dc-4780-9f5a-55776cbb2f7f
@@ -25,13 +28,14 @@ phases:
2528
- pip install --upgrade pip
2629
- pip install setuptools
2730
- pip install "tox < 4.0"
31+
# Run non-MPL-specific tests with the MPL installed
2832
- tox -e py312-examples-mpl
29-
# Assume special role
33+
# Assume special role to access keystore
3034
- TMP_ROLE=$(aws sts assume-role --role-arn "arn:aws:iam::370957321024:role/GitHub-CI-Public-ESDK-Python-Role-us-west-2" --role-session-name "CB-Py311ExamplesMpl")
3135
- export TMP_ROLE
3236
- export AWS_ACCESS_KEY_ID=$(echo "${TMP_ROLE}" | jq -r '.Credentials.AccessKeyId')
3337
- export AWS_SECRET_ACCESS_KEY=$(echo "${TMP_ROLE}" | jq -r '.Credentials.SecretAccessKey')
3438
- export AWS_SESSION_TOKEN=$(echo "${TMP_ROLE}" | jq -r '.Credentials.SessionToken')
3539
- aws sts get-caller-identity
36-
# Run special role-specific examples
40+
# Run MPL-specific tests with special role
3741
- tox -e py312-mplexamples-mpl

codebuild/py312/integ_mpl.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Runs the same tests as integ in an environment with the MPL installed.
2+
# This asserts existing tests continue to pass with the MPL installed.
13
version: 0.2
24

35
env:

tox.ini

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ envlist =
1515
# These must be separate from the above target.
1616
# These require the `-mpl` suffix so tox installs the MPL.
1717
# The `mpl` prefix runs only MPL-specific tests
18-
py{311,312}-mpl{local,examples}-mpl
18+
py{311,312}-mpl{local,integ,accept,examples}-mpl
1919
nocmk,
2020
bandit, doc8, readme, docs,
2121
{flake8,pylint}{,-tests,-examples},
@@ -56,7 +56,7 @@ envlist =
5656
# coverage :: Runs code coverage, failing the build if coverage is below the configured threshold
5757

5858
[testenv:base-command]
59-
commands = pytest --basetemp={envtmpdir} -l {posargs} -s -v
59+
commands = pytest --basetemp={envtmpdir} -l {posargs}
6060

6161
[testenv]
6262
; passenv = AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID,AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID_2,AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_1,AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_2,AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY,AWS_SESSION_TOKEN,AWS_CONTAINER_CREDENTIALS_RELATIVE_URI,AWS_PROFILE,PIP_CONFIG_FILE
@@ -87,11 +87,16 @@ commands =
8787
# MPL unit tests require the MPL to be installed
8888
mpllocal: {[testenv:base-command]commands} test/unit/mpl/ -m local
8989
integ: {[testenv:base-command]commands} test/ -m integ --ignore test/unit/mpl/
90+
# MPL integ tests require the MPL to be installed
91+
mplinteg: {[testenv:base-command]commands} test/unit/mpl -m integ
9092
accept: {[testenv:base-command]commands} test/ -m accept --ignore test/unit/mpl/
93+
# MPL accept tests require the MPL to be installed
94+
mplaccept: {[testenv:base-command]commands} test/unit/mpl -m accept
9195
examples: {[testenv:base-command]commands} examples/test/ -m examples --ignore examples/test/keyrings/
9296
# MPL keyring examples require a special IAM role; run these separately under a separate set of permissions
9397
mplexamples: {[testenv:base-command]commands} examples/test/keyrings -m examples
94-
all: {[testenv:base-command]commands} test/ examples/test/ --ignore test/unit/mpl/
98+
all: {[testenv:base-command]commands} test/ examples/test/ --ignore test/unit/mpl/ --ignore examples/test/keyrings/
99+
mplall: {[testenv:base-command]commands} test/unit/mpl/ examples/test/keyrings/
95100
manual: {[testenv:base-command]commands}
96101

97102
# Run code coverage on the unit tests

0 commit comments

Comments
 (0)