Skip to content

Commit 1b5837e

Browse files
committed
chore: test
1 parent deb0e1b commit 1b5837e

File tree

2 files changed

+50
-15
lines changed

2 files changed

+50
-15
lines changed

codebuild/release/validate_released_with_examples.yml

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,13 @@ phases:
3030
- echo "Installing aws-encryption-sdk version $VERSION"
3131
- pip install "aws-encryption-sdk==$VERSION"
3232
- pip install "tox < 4.0"
33+
# Export VERSION for subprocesses to use
34+
- export VERSION="$VERSION"
3335
build:
3436
commands:
3537
# Create a simple tox.ini file for running examples with the installed package
3638
- |
37-
cat > release_validation_tox.ini << 'EOF'
39+
cat > release_validation_tox.ini << EOF
3840
[tox]
3941
envlist = py311
4042
skipsdist = True
@@ -59,6 +61,7 @@ phases:
5961
moto
6062
boto3
6163
cryptography
64+
aws-encryption-sdk==$VERSION
6265
commands =
6366
# Run non-MPL examples
6467
pytest examples/test/legacy/ -m examples
@@ -101,9 +104,42 @@ phases:
101104
- |
102105
while [ $NUM_RETRIES -gt 0 ]
103106
do
104-
# Only run the MPL-specific tests that require special permissions
105-
# These would normally be run with py311-mplexamples-mpl
106-
python -m pytest examples/test/ -m examples --ignore examples/test/legacy/
107+
# Create a fresh tox.ini for MPL tests with correct dependencies
108+
echo "Creating MPL tox.ini with VERSION=$VERSION"
109+
cat > mpl_validation_tox.ini << EOF
110+
[tox]
111+
envlist = py311
112+
skipsdist = True
113+
114+
[testenv]
115+
passenv =
116+
AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID
117+
AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID_2
118+
AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_1
119+
AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_2
120+
AWS_ACCESS_KEY_ID
121+
AWS_SECRET_ACCESS_KEY
122+
AWS_SESSION_TOKEN
123+
AWS_CONTAINER_CREDENTIALS_RELATIVE_URI
124+
AWS_PROFILE
125+
deps =
126+
pytest
127+
pytest-mock
128+
mock
129+
coverage
130+
pyyaml
131+
moto
132+
boto3
133+
cryptography
134+
aws-encryption-sdk==$VERSION
135+
-r requirements_mpl.txt
136+
commands =
137+
# Only run the MPL-specific tests
138+
pytest examples/test/ -m examples --ignore examples/test/legacy/
139+
EOF
140+
141+
# Run the MPL-specific tests
142+
tox -c mpl_validation_tox.ini -e py311
107143
if [ $? -eq 0 ]; then
108144
break
109145
fi

codebuild/release/validate_test_vectors.yml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
version: 0.2
22

3-
# Validation script for aws-encryption-sdk using test vectors to verify cryptographic operations
4-
# and interoperability with the keyring model
5-
63
env:
74
variables:
85
# Default VERSION if not provided externally
@@ -11,26 +8,28 @@ env:
118
phases:
129
install:
1310
commands:
11+
- cd ..
1412
- pip install "tox < 4.0" poetry
1513
- pip install --upgrade pip
14+
# Get Dafny
15+
- curl https://github.com/dafny-lang/dafny/releases/download/v4.9.0/dafny-4.9.0-x64-ubuntu-20.04.zip -L -o dafny.zip
16+
- unzip -qq dafny.zip && rm dafny.zip
17+
- export PATH="$PWD/dafny:$PATH"
18+
- cd aws-encryption-sdk-python/
1619
runtime-versions:
1720
python: latest
1821
dotnet: 6.0
1922
pre_build:
2023
commands:
2124
# Setup environment
2225
- aws configure set region us-west-2
23-
- git clone https://github.com/aws/aws-encryption-sdk.git esdk-dafny
24-
- cd esdk-dafny && git submodule update --init --recursive && cd ..
26+
- git clone git@github.com:aws/aws-encryption-sdk.git
27+
- cd aws-encryption-sdk && git submodule update --init --recursive && cd ..
2528
# Install packages and setup environments
26-
- echo "Installing aws-encryption-sdk version $VERSION"
2729
- pip install "aws-encryption-sdk==$VERSION"
2830
- pyenv install --skip-existing 3.11.0 && pyenv local 3.11.0
29-
- make -C esdk-dafny/mpl/StandardLibrary setup_net
31+
- make -C aws-encryption-sdk/mpl/StandardLibrary setup_net
3032
- pip install pytest boto3 attrs cryptography
31-
# Update the aws-encryption-sdk version in TestVectors
32-
- sed -i "s/aws-encryption-sdk = \">=4.0.1\"/aws-encryption-sdk = \"==$VERSION\"/" \
33-
esdk-dafny/TestVectors/runtimes/python/pyproject.toml
3433
build:
3534
commands:
3635
- NUM_RETRIES=3
@@ -41,7 +40,7 @@ phases:
4140
}
4241
4342
# Navigate to TestVectors directory
44-
cd esdk-dafny/TestVectors || exit 1
43+
cd aws-encryption-sdk/TestVectors || exit 1
4544
4645
while [ $NUM_RETRIES -gt 0 ]
4746
do

0 commit comments

Comments
 (0)