Files
semantic-kernel/python/tests
Evan Mattson 81e89f0c22 Python: Improve agent integration tests (#11475)
### Motivation and Context

The current integration tests for agents work fine; however, if any
errors are encountered due to server-side hiccups, the instant failure
cause the whole test run to fail. This PR creates an `agent_test_base`
that provides some retry logic, as well as a standardized way for agent
test classes to use the underlying methods/protocol.

<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->

### Description

Improve the agent integration tests.
- The OpenAI Responses API is throwing 500s for file search right now.
Adding `xfail` for the time being. Filed an
[issue](https://github.com/openai/openai-python/issues/2298) on them.
- Handle errors when calling for a response for the OpenAI Responses API
-- throw a specific agent except or content exception, if received from
Azure OpenAI.
- Removed the `OpenAIResponsesAgent` `invoke` and `invoke_stream`
web_search tests. We have coverage for `get_responses`. The web search
is flaky sometimes.

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->

### Contribution Checklist

<!-- Before submitting this PR, please make sure: -->

- [X] The code builds clean without any errors or warnings
- [X] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [X] All unit tests pass, and I have added new tests where possible
- [X] I didn't break anyone 😄
2025-04-10 12:11:06 +00:00
..
2023-04-13 16:12:36 -07:00