Skip to content

Commit bc2656a

Browse files
author
Lucas McDonald
committed
m
1 parent 68e9659 commit bc2656a

File tree

8 files changed

+41
-10
lines changed

8 files changed

+41
-10
lines changed

.github/workflows/ci_examples_python.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ on:
2626
jobs:
2727
testPython:
2828
strategy:
29+
max-parallel: 1
2930
matrix:
30-
python-version: [3.11]
31+
python-version: [3.11, 3.12, 3.13]
3132
os: [macos-13]
3233
runs-on: ${{ matrix.os }}
3334
permissions:

.github/workflows/ci_test_vector_python.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ jobs:
3030
matrix:
3131
library: [TestVectors]
3232
python-version: [3.11, 3.12, 3.13]
33+
# Only ubuntu for now;
34+
# As of 4.10.1, Dafny's Python JSON processing is still very slow (1 hour to run test vectors on ubuntu)
35+
# and Github's macOS runners are also very slow (~2x slower than ubuntu).
36+
# If Dafny's JSON processing speed is improved, we can add macOS back.
3337
os: [ubuntu-22.04]
3438
interface: [client, resource, table]
3539
runs-on: ${{ matrix.os }}

.github/workflows/daily_ci.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,16 @@ jobs:
7171
uses: ./.github/workflows/ci_examples_python.yml
7272
with:
7373
dafny: ${{needs.getVersion.outputs.version}}
74+
daily-ci-python-test-vectors:
75+
needs: getVersion
76+
uses: ./.github/workflows/ci_test_vector_python.yml
77+
with:
78+
dafny: ${{needs.getVersion.outputs.version}}
79+
daily-ci-python-static-analysis:
80+
needs: getVersion
81+
uses: ./.github/workflows/ci_static_analysis_python.yml
82+
with:
83+
dafny: ${{needs.getVersion.outputs.version}}
7484
daily-ci-net-test-vectors:
7585
needs: getVersion
7686
uses: ./.github/workflows/ci_test_vector_net.yml

.github/workflows/manual.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,16 @@ jobs:
6767
with:
6868
dafny: ${{ inputs.dafny }}
6969
regenerate-code: ${{ inputs.regenerate-code }}
70+
manual-ci-python-test-vectors:
71+
uses: ./.github/workflows/ci_test_vector_python.yml
72+
with:
73+
dafny: ${{ inputs.dafny }}
74+
regenerate-code: ${{ inputs.regenerate-code }}
75+
manual-ci-python-static-analysis:
76+
uses: ./.github/workflows/ci_static_analysis_python.yml
77+
with:
78+
dafny: ${{ inputs.dafny }}
79+
regenerate-code: ${{ inputs.regenerate-code }}
7080
manual-ci-net-test-vectors:
7181
uses: ./.github/workflows/ci_test_vector_net.yml
7282
with:

.github/workflows/nightly.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@ jobs:
6464
with:
6565
dafny: "nightly-latest"
6666
regenerate-code: true
67+
dafny-nightly-python-test-vectors:
68+
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
69+
uses: ./.github/workflows/ci_test_vector_python.yml
70+
with:
71+
dafny: "nightly-latest"
72+
regenerate-code: true
6773
dafny-nightly-test-vectors-net:
6874
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
6975
uses: ./.github/workflows/ci_test_vector_net.yml

.github/workflows/push.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ jobs:
6969
pr-ci-python-static-analysis:
7070
needs: getVersion
7171
uses: ./.github/workflows/ci_static_analysis_python.yml
72+
pr-ci-python-test-vectors:
73+
needs: getVersion
74+
uses: ./.github/workflows/ci_test_vector_python.yml
75+
with:
76+
dafny: ${{needs.getVersion.outputs.version}}
7277
pr-ci-net-test-vectors:
7378
needs: getVersion
7479
uses: ./.github/workflows/ci_test_vector_net.yml

DynamoDbEncryption/runtimes/python/test/unit/internal/test_resource_to_client.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,8 +476,6 @@ def assert_condition_expressions_are_equal(expected_item, actual_item, key):
476476
actual_item["ExpressionAttributeNames"] if "ExpressionAttributeNames" in actual_item else {},
477477
actual_item["ExpressionAttributeValues"] if "ExpressionAttributeValues" in actual_item else {},
478478
)
479-
print(f"{expected_key_condition_expression=}")
480-
print(f"{actual_key_condition_expression=}")
481479
assert expected_key_condition_expression == actual_key_condition_expression
482480

483481

TestVectors/runtimes/python/src/aws_dbesdk_dynamodb_test_vectors/internaldafny/extern/CreateInterceptedDDBTable.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@
2121
from typing import Any, Dict
2222

2323
def load_test_data() -> Dict[str, Any]:
24-
"""Load the test data from data.json file."""
24+
"""Load the ExpressionAttributeValues from data.json file."""
2525
# Get the directory of the current file
2626
current_dir = os.getcwd()
2727
# Navigate to the data.json file
2828
data_file = os.path.join(current_dir, 'data.json')
2929

3030
with open(data_file, 'r') as f:
31-
return json.load(f)
31+
return json.load(f)["Values"]
3232

33-
expression_attribute_values_from_json = load_test_data()["Values"]
33+
expression_attribute_values_from_json = load_test_data()
3434

3535
def get_test_value(name) -> Any:
3636
"""
@@ -56,7 +56,7 @@ def get_test_value(name) -> Any:
5656
elif "L" in value:
5757
return list(value["L"])
5858
else:
59-
raise ValueError(f"Unknown value type: {value}")
59+
raise KeyError(f"Unknown ExpressionAttributeValue type: {value}")
6060
return value
6161

6262

@@ -231,9 +231,7 @@ def transact_write_items(self, **kwargs):
231231
raise NotImplementedError("transact_write_items not supported on table interface; remove tests calling this")
232232

233233
def query(self, **kwargs):
234-
print(f'{kwargs=}')
235234
table_input = self._client_shape_to_resource_shape_converter.query_request(kwargs)
236-
print(f'{table_input=}')
237235
# To exhaustively test Tables,
238236
# convert the string-based KeyConditionExpression and FilterExpression
239237
# into the boto3.conditions.Key and boto3.conditions.Attr resource-formatted queries.
@@ -262,7 +260,6 @@ def query(self, **kwargs):
262260
# Pass the original string through.
263261
# The table will accept the string as-is.
264262
pass
265-
print(f'{table_input=}')
266263
table_output = self._table.query(**table_input)
267264
client_output = self._resource_shape_to_client_shape_converter.query_response(table_output)
268265
return client_output

0 commit comments

Comments
 (0)