Integration testing enhancements#408
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors microsoft-agents-testing transcript formatting into a new microsoft_agents.testing.formatting package (including a new JSON exchange formatter) and expands the agt CLI with new env and scenario command groups, while updating docs and tests to match the new API and behaviors.
Changes:
- Replaced the legacy transcript formatter module with a new formatter package, adding
JsonTranscriptFormatterand convenienceprint_*helpers. - Added cross-SDK “source scenario” support that launches an agent via PowerShell and ensures child processes are terminated.
- Reworked the CLI into modular command groups (
agt env …,agt scenario …) and expanded docs/examples accordingly.
Reviewed changes
Copilot reviewed 43 out of 45 changed files in this pull request and generated 23 comments.
Show a summary per file
| File | Description |
|---|---|
| dev/testing/microsoft-agents-testing/tests/test_transcript_formatter.py | Updates formatter tests to the new formatting module and JSON-based outputs. |
| dev/testing/microsoft-agents-testing/tests/cross_sdk/test_source_scenario.py | Adds tests for cross-SDK PowerShell-launched scenarios and process lifecycle behavior. |
| dev/testing/microsoft-agents-testing/tests/cross_sdk/init.py | Initializes the new cross-SDK test package (empty marker module). |
| dev/testing/microsoft-agents-testing/tests/core/test_external_scenario.py | Adjusts endpoint trailing-slash expectation to match new normalization logic. |
| dev/testing/microsoft-agents-testing/pyproject.toml | Adds psutil dependency to support process tree termination. |
| dev/testing/microsoft-agents-testing/microsoft_agents/testing/transcript_formatter.py | Removes the legacy formatter implementation (replaced by formatting/). |
| dev/testing/microsoft-agents-testing/microsoft_agents/testing/pytest_plugin.py | Tweaks marker scenario resolution logic for Scenario instances. |
| dev/testing/microsoft-agents-testing/microsoft_agents/testing/formatting/utils.py | Adds shared exchange sorting and timestamp formatting helpers. |
| dev/testing/microsoft-agents-testing/microsoft_agents/testing/formatting/transcript_formatter.py | Introduces TranscriptFormatter protocol + BaseTranscriptFormatter callable base. |
| dev/testing/microsoft-agents-testing/microsoft_agents/testing/formatting/print.py | Adds print_conversation, print_activities, print_json convenience functions. |
| dev/testing/microsoft-agents-testing/microsoft_agents/testing/formatting/json_transcript_formatter.py | Adds JSON exchange-array transcript formatter. |
| dev/testing/microsoft-agents-testing/microsoft_agents/testing/formatting/conversation_transcript_formatter.py | Adds conversation-style transcript formatter with timestamped lines. |
| dev/testing/microsoft-agents-testing/microsoft_agents/testing/formatting/activity_transcript_formatter.py | Adds flat JSON activity-array transcript formatter. |
| dev/testing/microsoft-agents-testing/microsoft_agents/testing/formatting/init.py | Exposes formatting API surface via package exports. |
| dev/testing/microsoft-agents-testing/microsoft_agents/testing/cross_sdk/utils.py | Adds helpers to create agent paths and scenarios for cross-SDK layout. |
| dev/testing/microsoft-agents-testing/microsoft_agents/testing/cross_sdk/types.py | Adds SDKVersion enum for cross-SDK path selection. |
| dev/testing/microsoft-agents-testing/microsoft_agents/testing/cross_sdk/source_scenario.py | Adds SourceScenario that runs a .ps1 and kills descendant processes on exit. |
| dev/testing/microsoft-agents-testing/microsoft_agents/testing/cross_sdk/constants.py | Adds constants for cross-SDK entrypoint name and default endpoint. |
| dev/testing/microsoft-agents-testing/microsoft_agents/testing/cross_sdk/init.py | Exposes cross-SDK helpers and scenarios as a public package. |
| dev/testing/microsoft-agents-testing/microsoft_agents/testing/core/transport/transcript/exchange.py | Adds is_error, fixes latency typing, improves error/status handling, and sanitizes activities. |
| dev/testing/microsoft-agents-testing/microsoft_agents/testing/core/external_scenario.py | Normalizes endpoints by stripping a trailing slash for consistency. |
| dev/testing/microsoft-agents-testing/microsoft_agents/testing/cli/core/utils.py | Clarifies URL detection semantics (HTTP/HTTPS). |
| dev/testing/microsoft-agents-testing/microsoft_agents/testing/cli/core/output.py | Adds optional “exit” behavior to output error reporting. |
| dev/testing/microsoft-agents-testing/microsoft_agents/testing/cli/core/decorators.py | Refactors scenario resolution decorator to --url vs --agent options. |
| dev/testing/microsoft-agents-testing/microsoft_agents/testing/cli/core/cli_config.py | Updates environment loading documentation to match new behavior/return values. |
| dev/testing/microsoft-agents-testing/microsoft_agents/testing/cli/commands/scenario/scenario_group.py | Adds scenario click group for modular scenario commands. |
| dev/testing/microsoft-agents-testing/microsoft_agents/testing/cli/commands/scenario/_utils.py | Adds shared scenario CLI helpers (activity loading, histogram output). |
| dev/testing/microsoft-agents-testing/microsoft_agents/testing/cli/commands/scenario/_run.py | Adds agt scenario run command for long-running in-process scenarios. |
| dev/testing/microsoft-agents-testing/microsoft_agents/testing/cli/commands/scenario/_post.py | Adds agt scenario post command to send one activity/message and print transcript. |
| dev/testing/microsoft-agents-testing/microsoft_agents/testing/cli/commands/scenario/_load.py | Adds agt scenario load concurrent load test + latency stats reporting. |
| dev/testing/microsoft-agents-testing/microsoft_agents/testing/cli/commands/scenario/_list.py | Adds agt scenario list to discover registered scenarios. |
| dev/testing/microsoft-agents-testing/microsoft_agents/testing/cli/commands/scenario/_chat.py | Adds interactive REPL chat command for scenarios. |
| dev/testing/microsoft-agents-testing/microsoft_agents/testing/cli/commands/scenario/init.py | Forces scenario submodules to load for CLI registration. |
| dev/testing/microsoft-agents-testing/microsoft_agents/testing/cli/commands/scenario.py | Removes the monolithic scenario command module (split into group + subcommands). |
| dev/testing/microsoft-agents-testing/microsoft_agents/testing/cli/commands/environment/env_group.py | Adds env click group for environment commands. |
| dev/testing/microsoft-agents-testing/microsoft_agents/testing/cli/commands/environment/_show.py | Adds agt env show with environment details and .env key listing. |
| dev/testing/microsoft-agents-testing/microsoft_agents/testing/cli/commands/environment/_help.py | Adds agt env help to print required .env variables for auth. |
| dev/testing/microsoft-agents-testing/microsoft_agents/testing/cli/commands/environment/init.py | Forces environment submodules to load for CLI registration. |
| dev/testing/microsoft-agents-testing/microsoft_agents/testing/cli/commands/env.py | Stops printing .env values (prints keys only). |
| dev/testing/microsoft-agents-testing/microsoft_agents/testing/cli/commands/init.py | Registers new env_group/scenario_group instead of old commands. |
| dev/testing/microsoft-agents-testing/microsoft_agents/testing/init.py | Re-exports new formatting classes/functions at package top-level. |
| dev/testing/microsoft-agents-testing/docs/SAMPLES.md | Updates samples and adds CLI usage guidance. |
| dev/testing/microsoft-agents-testing/docs/README.md | Updates transcript formatting documentation + adds CLI section. |
| dev/testing/microsoft-agents-testing/docs/API.md | Updates public API docs for new formatters, print helpers, and CLI commands. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
axelsrz
approved these changes
Jun 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces several improvements and new features to the
microsoft-agents-testingdocumentation and CLI, focusing on transcript formatting and enhanced CLI usability. The changes clarify and expand documentation on transcript formatting, add a new JSON transcript formatter, and introduce a robust CLI (agt) with commands for environment management and scenario-based agent interaction.Key changes include:
Transcript Formatting Enhancements
JsonTranscriptFormatterfor outputting transcripts as JSON arrays ofExchangeobjects, documented its usage, and updated all references and sample code to include it alongside the other formatters. Also, clarified the differences and use-cases for each formatter and removed references to the obsoleteDetailLevelandTimeFormatenums. [1] [2] [3] [4] [5]JsonTranscriptFormatterand convenience print functions (print_conversation,print_activities,print_json). [1] [2]CLI Improvements
env(environment) andscenariocommands, and registered them for CLI use.agt env showcommand to display environment details, including Python version, platform, working directory, number of registered scenarios, and the keys of loaded.envvariables (not their values). [1] [2]agt env helpcommand to print the required.envvariable names for authentication, making environment setup easier.Documentation Updates
API.md,README.md, andSAMPLES.mdto cover the new CLI commands, transcript formatting options, and their usage, including concrete examples and output samples. [1] [2] [3]These changes make the library easier to use from both code and the command line, provide more flexible transcript export options, and improve onboarding for new users.