test: add pytest coverage for fixes from 6b98234 to c20b2d6; fix a few older tests by pdf-amzn · Pull Request #113 · ExtendDB/extenddb · GitHub
Skip to content

test: add pytest coverage for fixes from 6b98234 to c20b2d6; fix a few older tests#113

Merged
LeeroyHannigan merged 3 commits into
mainfrom
more-pytest
May 22, 2026
Merged

test: add pytest coverage for fixes from 6b98234 to c20b2d6; fix a few older tests#113
LeeroyHannigan merged 3 commits into
mainfrom
more-pytest

Conversation

@pdf-amzn

@pdf-amzn pdf-amzn commented May 22, 2026

Copy link
Copy Markdown
Collaborator
  • test: add pytest coverage for fixes from 6b98234 to c20b2d6 inclusive.
  • fix(tests): Bypass botocore client-side validation in service-level tests
  • fix(tests): Use appropriate polling intervals for real DynamoDB

What

Better test coverage for fixes we landed recently

Why

This helps confirm that our fixes were correct

Testing done

ran new & changed pytests against DynamoDB

Checklist

  • I have read CONTRIBUTING.md
  • All tests pass (cargo test --workspace)
  • Code is formatted (cargo fmt --check)
  • I have added or updated tests for new functionality
  • Clippy is clean (cargo clippy -- -W clippy::pedantic) - no new clippy issues
  • I have updated documentation if behavior changed - unchanged
  • [Breaking changes are noted below (if any) - unchanged

By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache License 2.0 and I agree to the Developer Certificate of
Origin (DCO). See CONTRIBUTING.md for details.

pdf-amzn added 3 commits May 22, 2026 19:45
Add 46 new integration tests covering behavioral fixes that were
previously only validated by Rust unit tests or not tested at all.
All tests run against both real DynamoDB and extenddb via boto3.

test_query_scan.py (+22 tests):
- KeyConditionExpression with parentheses
- KCE must reference partition key
- Undefined #name in FilterExpression
- Unused ExpressionAttributeNames/Values rejection
- size() on missing attribute returns None
- begins_with on binary sort keys
- Reserved keyword without alias
- Negative Scan segment rejection
- Legacy API: KeyConditions, QueryFilter, ScanFilter, AttributesToGet
- Legacy/expression mutual exclusivity
- LSI synchronous write verification

test_item_operations.py (+19 tests):
- Number validation (NaN, Infinity, >38 digits)
- Unused ExpressionAttributeNames on PutItem
- UpdateItem: SET list[N] beyond bounds appends
- UpdateItem: missing intermediate map path rejected
- UpdateItem: reserved keyword without alias
- UpdateItem: empty UpdateExpression rejected
- UpdateItem: condition on non-existent item
- UpdateItem: <> comparison with missing attribute
- DeleteItem: nonexistent table, condition on missing item
- ProjectionExpression: list index, out-of-bounds index

test_table_operations.py (+11 tests):
- CreateTable: duplicate KeySchema, >2 elements, LSI without
  range key, invalid BillingMode
- ListTables: alphabetical sort order
- UpdateTable: PAY_PER_REQUEST with throughput, zero throughput,
  remove nonexistent GSI, billing mode switch

test_transaction_operations.py (+2 tests):
- TransactWriteItems total size > 4MB rejected
- ConditionCheck with attribute_not_exists on missing item
…ests

Use a new dynamodb_client_no_validation fixture (parameter_validation=False)
so that invalid parameters reach the service instead of being rejected by
the SDK. This matches real DynamoDB behavior for:
- test_scan_negative_segment (Segment=-1)
- test_update_table_zero_throughput (ReadCapacityUnits=0)
- test_create_table_name_too_short (TableName='ab')
- Add _is_real_dynamodb() and _poll_interval() helpers: 200ms for real
  DynamoDB, 20ms for ExtendDB to avoid aggressive polling
- Fix create_and_cleanup_table teardown to wait for ACTIVE then retry
  delete when ResourceInUseException is raised (table in UPDATING state)
- Increase wait_for_active timeout to 120s and wait_for_deleted to 300s
  to accommodate real DynamoDB table lifecycle durations
- Apply _poll_interval() to all stream polling loops in test_streams.py
@pdf-amzn pdf-amzn marked this pull request as ready for review May 22, 2026 21:57
@LeeroyHannigan LeeroyHannigan merged commit dd81de9 into main May 22, 2026
7 checks passed
@pdf-amzn pdf-amzn deleted the more-pytest branch May 22, 2026 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants