-
Notifications
You must be signed in to change notification settings - Fork 56
Users/robrandao/integration overhaul #315
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
…into users/robrandao/integration-overhaul
| exchange = Exchange(error=str(e), response_at=response_at) | ||
| response = Response( | ||
| status=500, | ||
| text=str(e) |
Check warning
Code scanning / CodeQL
Information exposure through an exception Medium test
Stack trace information
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 3 days ago
Generally, to fix this problem you should avoid returning raw exception messages (or stack traces) to the client. Instead, log or otherwise record the detailed error server-side, and send the client a generic, non-sensitive message such as “Internal server error”.
For this specific code, the best fix that preserves functionality is:
- Keep recording the detailed error message inside the
Exchangeobject (as already done viaExchange(error=str(e), ...)) so that test infrastructure can inspect it. - Change the HTTP 500 response body to a generic message that does not include
str(e). - Optionally, include a very generic, static message indicating an error occurred when processing the activity, without exposing implementation details.
Concretely, in AiohttpCallbackServer._handle_request in aiohttp_callback_server.py, replace:
response = Response(
status=500,
text=str(e)
)with something like:
response = Response(
status=500,
content_type="application/json",
text='{"message": "An internal error occurred while processing the activity."}',
)(or a similarly generic plain-text message). No new imports are required, as Response is already imported and we can use a simple string literal. All existing behavior of recording the error in the transcript remains unchanged; only what is exposed to the external caller changes.
-
Copy modified lines R113-R114
| @@ -110,7 +110,8 @@ | ||
| exchange = Exchange(error=str(e), response_at=response_at) | ||
| response = Response( | ||
| status=500, | ||
| text=str(e) | ||
| content_type="application/json", | ||
| text='{"message": "An internal error occurred while processing the activity."}', | ||
| ) | ||
|
|
||
| self._transcript.record(exchange) |
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.
I'm open to having this discussion with the team. I'm not super committed against this, but I also wonder if this is acceptable for a testing tool?
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.
Pull request overview
This PR replaces the legacy integration/DDT/assertion tooling with a new scenario-based testing framework, introducing a transport layer (Sender/CallbackServer), a hierarchical Transcript/Exchange model, a fluent Select/Expect API, and a CLI + pytest plugin entry point. It also removes older integration/benchmark utilities and updates packaging to pyproject.toml.
Changes:
- Introduces core scenario/transport/transcript abstractions (ExternalScenario, callback server, sender, transcript).
- Adds fluent backend types/utilities (Unset, SafeObject, quantifiers, predicates, Select) and new unit tests for readonly/unset.
- Adds CLI scaffolding + sample scripts, and removes legacy integration/DDT/assertions/benchmark code.
Reviewed changes
Copilot reviewed 197 out of 274 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| dev/microsoft-agents-testing/tests/core/fluent/backend/types/test_unset.py | Adds unit tests for the new Unset sentinel singleton behavior |
| dev/microsoft-agents-testing/tests/core/fluent/backend/types/test_readonly.py | Adds unit tests for the Readonly mixin immutability rules |
| dev/microsoft-agents-testing/tests/assertions/_common.py | Removes old assertion test fixtures tied to legacy assertions package |
| dev/microsoft-agents-testing/setup.py | Removes legacy setup.py packaging in favor of pyproject.toml |
| dev/microsoft-agents-testing/pytest.ini | Updates pytest warnings filters and adds a marker for intentional failure demos |
| dev/microsoft-agents-testing/pyproject.toml | Defines runtime deps + adds CLI script and pytest plugin entry point |
| dev/microsoft-agents-testing/microsoft_agents/testing/utils/populate.py | Removes legacy activity-population helpers |
| dev/microsoft-agents-testing/microsoft_agents/testing/utils/misc.py | Removes legacy URL/model normalization helpers |
| dev/microsoft-agents-testing/microsoft_agents/testing/utils/init.py | Removes legacy utils package exports |
| dev/microsoft-agents-testing/microsoft_agents/testing/utils.py | Adds new convenience helpers for quick sends + scenario resolution |
| dev/microsoft-agents-testing/microsoft_agents/testing/sdk_config.py | Removes legacy SDKConfig wrapper (replaced by config/env handling elsewhere) |
| dev/microsoft-agents-testing/microsoft_agents/testing/integration/data_driven/load_ddts.py | Removes legacy data-driven test loader |
| dev/microsoft-agents-testing/microsoft_agents/testing/integration/data_driven/ddt.py | Removes legacy ddt() decorator system |
| dev/microsoft-agents-testing/microsoft_agents/testing/integration/data_driven/data_driven_test.py | Removes legacy data-driven test runner |
| dev/microsoft-agents-testing/microsoft_agents/testing/integration/data_driven/init.py | Removes legacy data-driven package exports |
| dev/microsoft-agents-testing/microsoft_agents/testing/integration/core/sample.py | Removes legacy integration sample base class |
| dev/microsoft-agents-testing/microsoft_agents/testing/integration/core/integration.py | Removes legacy pytest fixture-based integration harness |
| dev/microsoft-agents-testing/microsoft_agents/testing/integration/core/environment.py | Removes legacy Environment abstraction for integration tests |
| dev/microsoft-agents-testing/microsoft_agents/testing/integration/core/client/response_client.py | Removes legacy callback response collector |
| dev/microsoft-agents-testing/microsoft_agents/testing/integration/core/client/auto_client.py | Removes unused/placeholder legacy auto client |
| dev/microsoft-agents-testing/microsoft_agents/testing/integration/core/client/agent_client.py | Removes legacy HTTP client implementation |
| dev/microsoft-agents-testing/microsoft_agents/testing/integration/core/client/init.py | Removes legacy integration client exports |
| dev/microsoft-agents-testing/microsoft_agents/testing/integration/core/application_runner.py | Removes legacy thread-based aiohttp runner base |
| dev/microsoft-agents-testing/microsoft_agents/testing/integration/core/aiohttp/aiohttp_runner.py | Removes legacy aiohttp runner implementation |
| dev/microsoft-agents-testing/microsoft_agents/testing/integration/core/aiohttp/aiohttp_environment.py | Removes legacy in-process aiohttp environment wiring |
| dev/microsoft-agents-testing/microsoft_agents/testing/integration/core/aiohttp/init.py | Removes legacy aiohttp integration exports |
| dev/microsoft-agents-testing/microsoft_agents/testing/integration/core/init.py | Removes legacy integration core exports |
| dev/microsoft-agents-testing/microsoft_agents/testing/integration/init.py | Removes legacy integration package exports |
| dev/microsoft-agents-testing/microsoft_agents/testing/core/utils.py | Adds new core helpers (token generation, exchange→activities helpers) |
| dev/microsoft-agents-testing/microsoft_agents/testing/core/transport/transcript/transcript.py | Adds hierarchical Transcript implementation |
| dev/microsoft-agents-testing/microsoft_agents/testing/core/transport/transcript/init.py | Exposes Transcript/Exchange from transport transcript package |
| dev/microsoft-agents-testing/microsoft_agents/testing/core/transport/sender.py | Adds Sender abstraction for outbound activity sending |
| dev/microsoft-agents-testing/microsoft_agents/testing/core/transport/callback_server.py | Adds CallbackServer abstraction for async inbound activities |
| dev/microsoft-agents-testing/microsoft_agents/testing/core/transport/aiohttp_sender.py | Implements Sender using aiohttp |
| dev/microsoft-agents-testing/microsoft_agents/testing/core/transport/aiohttp_callback_server.py | Implements CallbackServer using aiohttp TestServer |
| dev/microsoft-agents-testing/microsoft_agents/testing/core/transport/init.py | Exposes transport primitives + aiohttp implementations |
| dev/microsoft-agents-testing/microsoft_agents/testing/core/scenario.py | Adds Scenario base and ClientFactory protocol |
| dev/microsoft-agents-testing/microsoft_agents/testing/core/fluent/utils.py | Adds normalize/flatten helpers for fluent assertion backend |
| dev/microsoft-agents-testing/microsoft_agents/testing/core/fluent/select.py | Adds Select fluent selection/filtering API |
| dev/microsoft-agents-testing/microsoft_agents/testing/core/fluent/backend/types/unset.py | Adds Unset singleton sentinel type |
| dev/microsoft-agents-testing/microsoft_agents/testing/core/fluent/backend/types/safe_object.py | Adds SafeObject for safe chained access returning Unset |
| dev/microsoft-agents-testing/microsoft_agents/testing/core/fluent/backend/types/readonly.py | Adds Readonly mixin preventing mutation |
| dev/microsoft-agents-testing/microsoft_agents/testing/core/fluent/backend/types/init.py | Exposes fluent backend type utilities |
| dev/microsoft-agents-testing/microsoft_agents/testing/core/fluent/backend/quantifier.py | Adds quantifier functions (all/any/none/one/n) |
| dev/microsoft-agents-testing/microsoft_agents/testing/core/fluent/backend/model_predicate.py | Adds predicate evaluation plumbing for matching models |
| dev/microsoft-agents-testing/microsoft_agents/testing/core/fluent/backend/init.py | Exposes backend primitives for fluent API |
| dev/microsoft-agents-testing/microsoft_agents/testing/core/fluent/init.py | Exposes public fluent API surface |
| dev/microsoft-agents-testing/microsoft_agents/testing/core/external_scenario.py | Adds ExternalScenario for testing hosted agents |
| dev/microsoft-agents-testing/microsoft_agents/testing/core/config.py | Adds ClientConfig/ScenarioConfig dataclasses |
| dev/microsoft-agents-testing/microsoft_agents/testing/core/_aiohttp_client_factory.py | Adds aiohttp-based client factory used by scenarios |
| dev/microsoft-agents-testing/microsoft_agents/testing/core/init.py | Defines core package exports for new framework |
| dev/microsoft-agents-testing/microsoft_agents/testing/cli/scenarios/basic_scenario.py | Adds built-in CLI scenario for a basic echo agent |
| dev/microsoft-agents-testing/microsoft_agents/testing/cli/scenarios/auth_scenario.py | Adds built-in CLI scenario for auth handler testing |
| dev/microsoft-agents-testing/microsoft_agents/testing/cli/scenarios/init.py | Registers predefined scenarios list for CLI |
| dev/microsoft-agents-testing/microsoft_agents/testing/cli/main.py | Adds CLI entry point + scenario registration hook |
| dev/microsoft-agents-testing/microsoft_agents/testing/cli/core/utils.py | Adds CLI scenario resolution logic |
| dev/microsoft-agents-testing/microsoft_agents/testing/cli/core/output.py | Adds reusable CLI output formatting helper |
| dev/microsoft-agents-testing/microsoft_agents/testing/cli/core/cli_config.py | Adds CLI config loader for .env/process env |
| dev/microsoft-agents-testing/microsoft_agents/testing/cli/core/init.py | Exposes core CLI helpers/decorators |
| dev/microsoft-agents-testing/microsoft_agents/testing/cli/commands/env.py | Adds CLI env diagnostic command |
| dev/microsoft-agents-testing/microsoft_agents/testing/cli/commands/init.py | Registers available CLI commands |
| dev/microsoft-agents-testing/microsoft_agents/testing/cli/init.py | Exposes CLI main() |
| dev/microsoft-agents-testing/microsoft_agents/testing/auth/generate_token.py | Removes legacy auth token helpers module |
| dev/microsoft-agents-testing/microsoft_agents/testing/auth/init.py | Removes legacy auth package exports |
| dev/microsoft-agents-testing/microsoft_agents/testing/assertions/type_defs.py | Removes legacy assertions type system |
| dev/microsoft-agents-testing/microsoft_agents/testing/assertions/model_selector.py | Removes legacy selector-based assertion tooling |
| dev/microsoft-agents-testing/microsoft_agents/testing/assertions/model_assertion.py | Removes legacy ModelAssertion implementation |
| dev/microsoft-agents-testing/microsoft_agents/testing/assertions/check_model.py | Removes legacy recursive model comparison logic |
| dev/microsoft-agents-testing/microsoft_agents/testing/assertions/check_field.py | Removes legacy field assertion evaluation |
| dev/microsoft-agents-testing/microsoft_agents/testing/assertions/assertions.py | Removes legacy assertion entry points |
| dev/microsoft-agents-testing/microsoft_agents/testing/assertions/init.py | Removes legacy assertions package exports |
| dev/microsoft-agents-testing/microsoft_agents/testing/init.py | Re-exports new public API surface for scenarios/fluent/transport/CLI helpers |
| dev/microsoft-agents-testing/docs/samples/test_motivation_assertions.py | Adds a sample test for comparing failure outputs (intentional failures) |
| dev/microsoft-agents-testing/docs/samples/scenario_registry_demo.py | Adds runnable demo for scenario registry usage |
| dev/microsoft-agents-testing/docs/samples/quickstart.py | Adds runnable quickstart sample |
| dev/microsoft-agents-testing/docs/samples/pytest_plugin_usage.py | Adds runnable documentation sample for pytest plugin usage |
| dev/microsoft-agents-testing/docs/samples/interactive.py | Adds runnable REPL demo using in-process scenario + transcript formatting |
| dev/microsoft-agents-testing/docs/samples/init.py | Adds index/guide docstring for samples package |
| dev/microsoft-agents-testing/docs/SAMPLES.md | Adds markdown index describing available samples |
| dev/microsoft-agents-testing/_manual_test/env.TEMPLATE | Removes legacy manual env template |
| dev/integration/tests/test_expect_replies.py | Removes legacy integration tests tied to removed harness |
| dev/integration/tests/quickstart/test_quickstart_sample.py | Removes legacy DDT-driven quickstart integration tests |
| dev/integration/tests/quickstart/directline/send_hi.yaml | Removes legacy DDT YAML test flow |
| dev/integration/tests/quickstart/directline/send_hello.yaml | Removes legacy DDT YAML test flow |
| dev/integration/tests/quickstart/directline/conversation_update.yaml | Removes legacy DDT YAML test flow |
| dev/integration/tests/quickstart/directline/_parent.yaml | Removes legacy DDT YAML parent defaults |
| dev/integration/tests/basic_agent/webchat/SendStreamActivity_SendStreamMessage_ExpectStreamResponses.yaml | Removes legacy DDT YAML test flow |
| dev/integration/tests/basic_agent/webchat/SendInvoke_SendsInvokeActivityToAcExecute_ReturnsValidAdaptiveCardInvokeResponse.yaml | Removes legacy DDT YAML test flow |
| dev/integration/tests/basic_agent/webchat/SendInvoke_SendBasicInvokeActivity_ReceiveInvokeResponse.yaml | Removes legacy DDT YAML test flow |
| dev/integration/tests/basic_agent/webchat/SendInvoke_SelectItem_ReceiveItem.yaml | Removes legacy DDT YAML test flow |
| dev/integration/tests/basic_agent/webchat/SendInvoke_QueryPackage_ReceiveInvokeResponse.yaml | Removes legacy DDT YAML test flow |
| dev/integration/tests/basic_agent/webchat/SendInvoke_QueryLink_ReturnsText.yaml | Removes legacy DDT YAML test flow |
| dev/integration/tests/basic_agent/webchat/SendExpectedRepliesActivity_SendsText_ReturnsPoem.yaml | Removes legacy DDT YAML test flow |
| dev/integration/tests/basic_agent/webchat/SendExpectedRepliesActivity_SendsSeattleTodayWeather_ReturnsWeather.yaml | Removes legacy DDT YAML test flow |
| dev/integration/tests/basic_agent/webchat/SendActivity_SimulateMessageLoop_ExpectQuestionAboutTimeAndReturnsWeather.yaml | Removes legacy DDT YAML test flow |
| dev/integration/tests/basic_agent/webchat/SendActivity_SendsText_ReturnsPoem.yaml | Removes legacy DDT YAML test flow |
| dev/integration/tests/basic_agent/webchat/SendActivity_SendsSeattleTodayWeather_ReturnsWeather.yaml | Removes legacy DDT YAML test flow |
| dev/integration/tests/basic_agent/webchat/SendActivity_SendsMessageActivityToAcSubmit_ReturnValidResponse.yaml | Removes legacy DDT YAML test flow |
| dev/integration/tests/basic_agent/webchat/SendActivity_SendsHi5_Returns5HiActivities.yaml | Removes legacy DDT YAML test flow |
| dev/integration/tests/basic_agent/webchat/SendActivity_SendsHelloWorld_ReturnsHelloWorld.yaml | Removes legacy DDT YAML test flow |
| dev/integration/tests/basic_agent/webchat/SendActivity_SendHeartMessageReaction_ReturnsMessageReactionHeart.yaml | Removes legacy DDT YAML test flow |
| dev/integration/tests/basic_agent/webchat/SendActivity_RemoveHeartMessageReaction_ReturnsMessageReactionHeart.yaml | Removes legacy DDT YAML test flow |
| dev/integration/tests/basic_agent/webchat/SendActivity_EndConversation_DeleteConversation.yaml | Removes legacy DDT YAML test flow |
| dev/integration/tests/basic_agent/webchat/SendActivity_ConversationUpdate_ReturnsWelcomeMessage.yaml | Removes legacy DDT YAML test flow |
| dev/integration/tests/basic_agent/test_basic_agent.py | Removes legacy integration test entry point |
| dev/integration/tests/basic_agent/msteams/SendStreamActivity_SendStreamMessage_ExpectStreamResponses.yaml | Removes legacy DDT YAML test flow |
| dev/integration/tests/basic_agent/msteams/SendInvoke_SendsInvokeActivityToAcExecute_ReturnsValidAdaptiveCardInvokeResponse.yaml | Removes legacy DDT YAML test flow |
| dev/integration/tests/basic_agent/msteams/SendInvoke_SendBasicInvokeActivity_ReceiveInvokeResponse.yaml | Removes legacy DDT YAML test flow |
| dev/integration/tests/basic_agent/msteams/SendInvoke_SelectItem_ReceiveItem.yaml | Removes legacy DDT YAML test flow |
| dev/integration/tests/basic_agent/msteams/SendInvoke_QueryPackage_ReceiveInvokeResponse.yaml | Removes legacy DDT YAML test flow |
| dev/integration/tests/basic_agent/msteams/SendInvoke_QueryLink_ReturnsText.yaml | Removes legacy DDT YAML test flow |
| dev/integration/tests/basic_agent/msteams/SendExpectedRepliesActivity_SendsText_ReturnsPoem.yaml | Removes legacy DDT YAML test flow |
| dev/integration/tests/basic_agent/msteams/SendExpectedRepliesActivity_SendsSeattleTodayWeather_ReturnsWeather.yaml | Removes legacy DDT YAML test flow |
| dev/integration/tests/basic_agent/msteams/SendActivity_StartTeamsMeeting_ExpectMessage.yaml | Removes legacy DDT YAML test flow |
| dev/integration/tests/basic_agent/msteams/SendActivity_SimulateMessageLoop_ExpectQuestionAboutTimeAndReturnsWeather.yaml | Removes legacy DDT YAML test flow |
| dev/integration/tests/basic_agent/msteams/SendActivity_SendsText_ReturnsPoem.yaml | Removes legacy DDT YAML test flow |
| dev/integration/tests/basic_agent/msteams/SendActivity_SendsSeattleTodayWeather_ReturnsWeather.yaml | Removes legacy DDT YAML test flow |
| dev/integration/tests/basic_agent/msteams/SendActivity_SendsMessageActivityToAcSubmit_ReturnValidResponse.yaml | Removes legacy DDT YAML test flow |
| dev/integration/tests/basic_agent/msteams/SendActivity_SendsHi5_Returns5HiActivities.yaml | Removes legacy DDT YAML test flow |
| dev/integration/tests/basic_agent/msteams/SendActivity_SendsHelloWorld_ReturnsHelloWorld.yaml | Removes legacy DDT YAML test flow |
| dev/integration/tests/basic_agent/msteams/SendActivity_SendHeartMessageReaction_ReturnsMessageReactionHeart.yaml | Removes legacy DDT YAML test flow |
| dev/integration/tests/basic_agent/msteams/SendActivity_RemoveHeartMessageReaction_ReturnsMessageReactionHeart.yaml | Removes legacy DDT YAML test flow |
| dev/integration/tests/basic_agent/msteams/SendActivity_ParticipantJoinsTeamMeeting_ExpectMessage.yaml | Removes legacy DDT YAML test flow |
| dev/integration/tests/basic_agent/msteams/SendActivity_EndTeamsMeeting_ExpectMessage.yaml | Removes legacy DDT YAML test flow |
| dev/integration/tests/basic_agent/msteams/SendActivity_EndConversation_DeleteConversation.yaml | Removes legacy DDT YAML test flow |
| dev/integration/tests/basic_agent/msteams/SendActivity_EditMessage_ReceiveUpdate.yaml | Removes legacy DDT YAML test flow |
| dev/integration/tests/basic_agent/msteams/SendActivity_ConversationUpdate_ReturnsWelcomeMessage.yaml | Removes legacy DDT YAML test flow |
| dev/integration/tests/basic_agent/directline/SendStreamActivity_SendStreamMessage_ExpectStreamResponses.yaml | Removes legacy DDT YAML test flow |
| dev/integration/tests/basic_agent/directline/SendInvoke_SendsInvokeActivityToAcExecute_ReturnsValidAdaptiveCardInvokeResponse.yaml | Removes legacy DDT YAML test flow |
| dev/integration/tests/basic_agent/directline/SendInvoke_SendBasicInvokeActivity_ReceiveInvokeResponse.yaml | Removes legacy DDT YAML test flow |
| dev/integration/tests/basic_agent/directline/SendInvoke_SelectItem_ReceiveItem.yaml | Removes legacy DDT YAML test flow |
| dev/integration/tests/basic_agent/directline/SendInvoke_QueryPackage_ReceiveInvokeResponse.yaml | Removes legacy DDT YAML test flow |
| dev/integration/tests/basic_agent/directline/SendInvoke_QueryLink_ReturnsText.yaml | Removes legacy DDT YAML test flow |
| dev/integration/tests/basic_agent/directline/SendExpectedRepliesActivity_SendsText_ReturnsPoem.yaml | Removes legacy DDT YAML test flow |
| dev/integration/tests/basic_agent/directline/SendExpectedRepliesActivity_SendsSeattleTodayWeather_ReturnsWeather.yaml | Removes legacy DDT YAML test flow |
| dev/integration/tests/basic_agent/directline/SendActivity_SimulateMessageLoop_ExpectQuestionAboutTimeAndReturnsWeather.yaml | Removes legacy DDT YAML test flow |
| dev/integration/tests/basic_agent/directline/SendActivity_SendsText_ReturnsPoem.yaml | Removes legacy DDT YAML test flow |
| dev/integration/tests/basic_agent/directline/SendActivity_SendsSeattleTodayWeather_ReturnsWeather.yaml | Removes legacy DDT YAML test flow |
| dev/integration/tests/basic_agent/directline/SendActivity_SendsMessageActivityToAcSubmit_ReturnValidResponse.yaml | Removes legacy DDT YAML test flow |
| dev/integration/tests/basic_agent/directline/SendActivity_SendsHi5_Returns5HiActivities.yaml | Removes legacy DDT YAML test flow |
| dev/integration/tests/basic_agent/directline/SendActivity_SendsHelloWorld_ReturnsHelloWorld.yaml | Removes legacy DDT YAML test flow |
| dev/integration/tests/basic_agent/directline/SendActivity_SendHeartMessageReaction_ReturnsMessageReactionHeart.yaml | Removes legacy DDT YAML test flow |
| dev/integration/tests/basic_agent/directline/SendActivity_RemoveHeartMessageReaction_ReturnsMessageReactionHeart.yaml | Removes legacy DDT YAML test flow |
| dev/integration/tests/basic_agent/directline/SendActivity_EndConversation_DeleteConversation.yaml | Removes legacy DDT YAML test flow |
| dev/integration/tests/basic_agent/directline/SendActivity_ConversationUpdate_ReturnsWelcomeMessage.yaml | Removes legacy DDT YAML test flow |
| dev/integration/samples/quickstart_sample.py | Removes legacy integration sample |
| dev/integration/samples/init.py | Removes legacy integration sample exports |
| dev/benchmark/src/payload_sender.py | Removes legacy benchmark helper |
| dev/benchmark/src/output.py | Removes legacy benchmark output helper |
| dev/benchmark/src/main.py | Removes legacy benchmark CLI |
| dev/benchmark/src/generate_token.py | Removes legacy benchmark token helper |
| dev/benchmark/src/executor/thread_executor.py | Removes legacy benchmark thread executor |
| dev/benchmark/src/executor/executor.py | Removes legacy benchmark executor base |
| dev/benchmark/src/executor/execution_result.py | Removes legacy benchmark result model |
| dev/benchmark/src/executor/coroutine_executor.py | Removes legacy benchmark coroutine executor |
| dev/benchmark/src/executor/init.py | Removes legacy benchmark executor exports |
| dev/benchmark/src/config.py | Removes legacy benchmark config |
| dev/benchmark/src/aggregated_results.py | Removes legacy benchmark aggregation |
| dev/benchmark/requirements.txt | Removes legacy benchmark requirements |
| dev/benchmark/env.template | Removes legacy benchmark env template |
| dev/benchmark/README.md | Removes legacy benchmark documentation |
| dev/README.md | Simplifies dev README to just the editable install command |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Motivation
Without this framework
To test an echo agent you need to: get a token, start a callback server,
build the activity JSON, send it, wait, and check the response.
~60 lines to send one message and check for a substring.
With this framework
Or without pytest:
What moved where
get_token(), env vars,Authorizationheader.envand handles authweb.Application(),AppRunner,TCPSite, cleanupActivityTemplatefills required fieldsasyncio.sleep(2)wait=0.2onsend()assert any("Hello" in json.dumps(r) for r in collected)expect().that_for_any(text="Echo: Hello!")Transcriptcaptures every exchangeHow it's structured
Swap
AiohttpScenarioforExternalScenarioand your assertions stay the same.The core has no dependency on pytest. The pytest plugin
(
@pytest.mark.agent_test) is an optional layer that wires scenarios intofixtures.
Accessing agent internals via fixtures
With external testing you can only observe what an agent says.
With
AiohttpScenariothe agent runs in-process, so the pytest pluginexposes its internals as fixtures you can inject into any test:
agent_environmentAgentEnvironmentagent_applicationAgentApplicationauthorizationAuthorizationstorageStorageMemoryStorage) — read/write agent state directlyadapterChannelServiceAdapterconnection_managerConnectionsBecause these are plain pytest fixtures, you can combine them freely:
None of this is possible with raw HTTP tests against a deployed agent — you
would need to add debug endpoints or parse logs after the fact.
Complexity the framework reduces: response collection
Without the framework, collecting responses from an agent is not easy. Agents can send replies within the HTTP response body and through separate POSTs to a service URL, depending on the delivery mode of the activity.
The framework here facilitates response handling by unifying it under the
Transcriptabstraction that is managed byScenarios andAgentClients to automatically record every exchange that takes place with the target agent.Complexity the framework reduces: assertions
Without the framework, asserting on a list of Activity objects requires
defensive coding: null-guards before accessing nested fields,
or ""wrappers to avoid
TypeErroronNonetext, and manual iteration.When the assertion fails, pytest can only tell you the generator returned
False— not which activities were checked or which conditions didn't hold.Without the framework:
Failure output:
The framework's
ExpectAPI handles missing/Nonefields automatically(no crash, just a non-match) and uses dot-notation to reach into nested
objects. When the assertion fails it reports per item which fields
didn't match, what was expected, and what was actually there:
With the framework:
Failure output: