|
| 1 | +# Integration Tests |
| 2 | + |
| 3 | +See [CONTRIBUTING.md](CONTRIBUTING.md) for initial setup (Python, `uv sync`, etc). |
| 4 | + |
| 5 | +All integration tests require AWS credentials with `bedrock-agentcore:*` and `bedrock-agentcore-control:*` permissions. |
| 6 | + |
| 7 | +```bash |
| 8 | +export AWS_PROFILE=<your-profile> |
| 9 | +export BEDROCK_TEST_REGION=us-west-2 |
| 10 | +``` |
| 11 | + |
| 12 | +## Runtime |
| 13 | + |
| 14 | +```bash |
| 15 | +uv run pytest tests_integ/runtime -xvs --log-cli-level=INFO |
| 16 | +``` |
| 17 | + |
| 18 | +## Memory |
| 19 | + |
| 20 | +```bash |
| 21 | +# Control plane (CRUD on memories/strategies, 5-10 min due to provisioning) |
| 22 | +uv run pytest tests_integ/memory/test_controlplane.py -xvs -k "integration" |
| 23 | + |
| 24 | +# Stream delivery (requires env vars below, fails if unset) |
| 25 | +export MEMORY_KINESIS_ARN=<Kinesis Data Stream ARN> |
| 26 | +export MEMORY_ROLE_ARN=<IAM role ARN trusted by bedrock-agentcore.amazonaws.com with kinesis:PutRecord/PutRecords permissions> |
| 27 | +uv run pytest tests_integ/memory/test_memory_client.py -xvs |
| 28 | + |
| 29 | +# Client and developer experience |
| 30 | +uv run pytest tests_integ/memory/test_memory_client.py -xvs |
| 31 | +uv run pytest tests_integ/memory/test_devex.py -xvs |
| 32 | +``` |
| 33 | + |
| 34 | +## Identity |
| 35 | + |
| 36 | +```bash |
| 37 | +uv run pytest tests_integ/identity -xvs |
| 38 | +``` |
| 39 | + |
| 40 | +## Tools (Code Interpreter, Browser) |
| 41 | + |
| 42 | +```bash |
| 43 | +uv run pytest tests_integ/tools -xvs |
| 44 | +``` |
| 45 | + |
| 46 | +## CI |
| 47 | + |
| 48 | +Integration tests run via `integration-testing.yml` on PRs to main. The workflow runs runtime, memory (stream delivery only), and evaluation tests in parallel. |
| 49 | + |
| 50 | +Stream delivery tests fail in CI unless `MEMORY_KINESIS_ARN` and `MEMORY_ROLE_ARN` secrets are configured on the repo. Other memory integration tests are not yet run in CI due to provisioning times and flaky LLM-dependent assertions — CI support is planned once test stability is addressed. |
| 51 | + |
| 52 | +## Conventions |
| 53 | + |
| 54 | +- Each test file should map 1:1 to a source code file when possible. |
| 55 | +- Each test class should correspond to the object under test (e.g. `TestMemoryClient`). |
| 56 | +- Expensive resources (e.g. memories) should be created the minimum number of times, ideally once in `setup_class`. |
| 57 | +- All resources created during tests must be cleaned up in `teardown_class`. |
0 commit comments