test(memory): rewrite integration tests with proper pytest structure#276
test(memory): rewrite integration tests with proper pytest structure#276
Conversation
- Replace script-style test_devex.py with proper pytest test class in test_memory_client.py covering all 37 MemoryClient public methods - Add assert_created_event helper for create_event/fork_conversation responses which do not include payload - Add leaf-value blob assertion to handle service returning blob data as a stringified Java-style map representation - Fail tests when MEMORY_ROLE_ARN is not set instead of silently skipping - Add pytest-xdist for parallel test execution support - Add Husky git hooks setup to CONTRIBUTING.md and node_modules to .gitignore
CI/CD gaps for memory integration testsThe current GitHub workflows don't run memory integration tests. Here's what needs to change in 1. Memory tests are not included in the test commandCurrent: Only runtime tests run: run: |
pytest tests_integ/runtime -s --log-cli-level=INFOFix: Add a separate step (or expand the existing one) to include memory tests: - name: Run runtime integration tests
env:
AWS_REGION: us-west-2
PYTHONUNBUFFERED: 1
timeout-minutes: 10
run: |
pytest tests_integ/runtime -s --log-cli-level=INFO
- name: Run memory integration tests
env:
AWS_REGION: us-west-2
MEMORY_ROLE_ARN: ${{ secrets.MEMORY_EXECUTION_ROLE_ARN }}
PYTHONUNBUFFERED: 1
timeout-minutes: 15
run: |
pytest tests_integ/memory -vs --log-cli-level=INFO2.
|
Summary
test_devex.py(756 lines, no real assertions) with proper pytest test class intest_memory_client.pycovering all 37MemoryClientpublic methodsassert_created_eventhelper forcreate_event/fork_conversationresponses which do not includepayloadMEMORY_ROLE_ARNis not set instead of silently skippingpytest-xdistfor parallel test execution, Husky hooks docs, andnode_modulesto.gitignoreTest plan
MEMORY_ROLE_ARN="..." pytest -vs tests_integ/memory/test_memory_client.pyand verify all 11 tests passMEMORY_ROLE_ARNand verify tests fail (not skip)