-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat(ci): add Bedrock integration tests with record/replay #4292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
305be8e to
0667de8
Compare
69eb2c4 to
51121ae
Compare
bd9f2dd to
d75be15
Compare
|
This pull request has merge conflicts that must be resolved before it can be merged. @skamenan7 please rebase it. https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork |
2d82f01 to
5067cee
Compare
1d07a5a to
454aefe
Compare
1db1c2b to
58fe994
Compare
1d92f48 to
f3b96b6
Compare
4fb5b72 to
a0e27f0
Compare
|
Please review. CI is now green. cc:@derekhiggins and @cdoern
|
2b6aaa2 to
4a14dae
Compare
- Create dedicated bedrock suite with 3 compatible test functions - Add run-bedrock.yaml stack config for CI - Enable config resolution for distro::file.yaml format in library mode - Add test recordings for streaming, non-streaming, and inference store - Skip tool-calling tests for Bedrock (not supported by AWS) - Add recording guide documentation for contributors Tested with GPT-OSS model on us-west-2 region.
The bedrock suite uses specific test function paths like "test_file.py::test_function" in its roots. The pytest_ignore_collect hook was treating these as filesystem paths, causing 0 tests to be collected. Changes: - Strip "::test_function" suffix when checking file paths - Add pytest_collection_modifyitems to filter to specific tests Without this fix, cleanup_recordings.py marks bedrock recordings as unused and deletes them in CI.
- Remove separate run-bedrock.yaml in favor of modifying templates - Update bedrock provider config: dummy API key for replay mode, us-west-2 region - Pre-register bedrock model in ci-tests template (Bedrock /v1/models returns empty) - Update ci_matrix.json to use default stack config
Consolidated config file usage (ci-tests::run.yaml instead of run-bedrock.yaml), added Stack Configuration Choices section, fixed default region to us-west-2, and updated pytest commands to use full paths with clarification about test count.
Changed default region from us-east-2 to us-west-2 to reflect where GPT-OSS model is available. Update test expectation to match.
- Replace non-existent run-bedrock.yaml with config.yaml in recording guide - Replace non-existent run.yaml with config.yaml in record-replay.mdx - Fix test count from "4 parametrized test cases" to "6 parametrized tests" 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
4a14dae to
61dcea1
Compare
leseb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mostfly nit, thanks for your patience on this one
| @@ -0,0 +1,263 @@ | |||
| # AWS Bedrock Test Recording Guide | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this file looks very similar to docs/docs/contributing/testing/record-replay.mdx with more content, is there any chance to just keep one?
| config: | ||
| api_key: ${env.AWS_BEARER_TOKEN_BEDROCK:=} | ||
| region_name: ${env.AWS_DEFAULT_REGION:=us-east-2} | ||
| api_key: ${env.AWS_BEARER_TOKEN_BEDROCK:=replay-mode-dummy-key} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can avoid the replay-mode-dummy-key and keep things the way they were before the change?

What does this PR do?
Adds Bedrock integration tests to CI using a record/replay mechanism. Tests run against pre-recorded API responses, without the need for AWS credentials in CI.
The main challenge was that Bedrock's OpenAI-compatible API doesn't support everything - no tool calling, no embeddings, no dynamic model listing. So instead of running the full base suite (which would fail on ~40 tests), I created a dedicated bedrock suite with just the tests that actually work.
Changes:
docs/source/providers/inference/bedrock_recording_guide.mdso contributors with AWS access can re-record tests when neededCloses #4095
Test Plan
Run from tests/integration/inference:
Expected: 6 passed