Skip to content

Add generated Q Business client and integration tests#54

Open
Alan4506 wants to merge 1 commit intoawslabs:developfrom
Alan4506:feat/qbusiness-client
Open

Add generated Q Business client and integration tests#54
Alan4506 wants to merge 1 commit intoawslabs:developfrom
Alan4506:feat/qbusiness-client

Conversation

@Alan4506
Copy link
Copy Markdown

@Alan4506 Alan4506 commented Apr 23, 2026

Description of changes:

This PR adds integration tests for the Q Business service client (aws-sdk-qbusiness), covering the following:

  • Non-streaming operation chat_sync
  • Bidirectional event streaming operation chat

The test structure and patterns follow the same conventions established in the Lex Runtime V2 integration tests (PR #51), including session-scoped conftest fixtures for resource setup/teardown and field-level assertions on event types.

Although the PR contains many files, most of them are generated by smithy-python codegen. Please mainly review the integration tests because they are the primary focus of this PR. The Smithy model, generated client code under src/, and pyproject.toml are included for reviewer convenience so that tests can be run locally. The actual client release will be handled by internal release automation (through a separate PR that uploads the model).

Here is the detailed file breakdown:

  • codegen/aws-models/qbusiness.json: Smithy model for the Q Business service.
  • clients/aws-sdk-qbusiness/src/: Generated client code. Included for reviewer convenience only; will be replaced by release automation.
  • clients/aws-sdk-qbusiness/pyproject.toml: Generated package configuration.
  • clients/aws-sdk-qbusiness/README.md: Generated package readme.
  • clients/aws-sdk-qbusiness/tests/__init__.py: Generated test package marker.
  • clients/aws-sdk-qbusiness/tests/test_protocol.py: Generated protocol test.
  • clients/aws-sdk-qbusiness/tests/integration/__init__.py: Defines REGION and create_qbusiness_client() helper shared across integration tests.
  • clients/aws-sdk-qbusiness/tests/integration/conftest.py: Session-scoped pytest fixture that creates a Q Business application, index, and retriever using boto3, and tears them down after. Uses custom botocore waiters since Q Business has no built-in boto3 waiters.
  • clients/aws-sdk-qbusiness/tests/integration/test_non_streaming.py: Tests the chat_sync operation.
  • clients/aws-sdk-qbusiness/tests/integration/test_bidirectional_streaming.py: Tests the chat operation.

Note: The Q Business client cannot be code-generated without the codegen fix in smithy-lang/smithy-python#682, which is still under review.

Note: The Q Business service sends event types (intermediateMessageEvent, intermediateGroupEvent) that are not present in the current model. These are handled as ChatOutputStreamUnknown thanks to a fix in smithy-python. The changes have been merged into the develop branch but have not been released yet. Tests will fail against the published PyPI versions until the next release.

To successfully run the tests locally, follow the steps below:

# Set up your AWS credentials, then:
cd <path-to-smithy-python>
git checkout develop && git pull
make build-py

# Set up and run Q Business integration tests
cd <path-to-aws-sdk-python>/clients/aws-sdk-qbusiness
uv venv .venv && source .venv/bin/activate
uv pip install --group test -e . boto3 --find-links <path-to-smithy-python>/dist
python -m pytest tests/integration

All tests should pass.

This branch will be rebased once the release automation publishes the client.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@Alan4506 Alan4506 requested a review from a team as a code owner April 23, 2026 15: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.

1 participant