microsoft-agents-testing quality of life improvements and doc updates - #473
Merged
Rodrigo Brandão (rodrigobr-msft) merged 5 commits intoJul 16, 2026
Merged
Conversation
Rodrigo Brandão (rodrigobr-msft)
marked this pull request as ready for review
July 16, 2026 20:49
Copilot started reviewing on behalf of
Rodrigo Brandão (rodrigobr-msft)
July 16, 2026 20:50
View session
Kyle Rohn (kylerohn-msft)
approved these changes
Jul 16, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request enhances the microsoft-agents-testing package’s usability by adding new fluent-testing utilities and typed wrappers, expanding predicate/lambda support, and substantially reorganizing/expanding documentation and runnable samples to clarify how to use the assertion engine and CLI.
Changes:
- Added
contains/Containsnested traversal predicate helper plus tests and utility docs. - Introduced typed fluent wrappers (
ActivityExpect/Select,ExchangeExpect/Select) and updatedAgentClientshortcuts/tests accordingly. - Improved fluent predicate evaluation (lambda arg name support for
value, truthiness handling) and added/updated extensive docs and samples.
Reviewed changes
Copilot reviewed 36 out of 36 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| dev/microsoft-agents-testing/tests/utils/test_pred.py | Adds coverage for the new contains/Contains nested predicate helper. |
| dev/microsoft-agents-testing/tests/core/test_type_defs.py | Tests typed wrappers for activities and exchanges. |
| dev/microsoft-agents-testing/tests/core/test_agent_client.py | Updates/extends tests to assert typed expect/select return types. |
| dev/microsoft-agents-testing/tests/core/fluent/test_select.py | Adds tests for value-named lambda args and root callable truthiness in Select.where(). |
| dev/microsoft-agents-testing/tests/core/fluent/test_expect.py | Adds tests for value-named lambda args in Expect.that(). |
| dev/microsoft-agents-testing/tests/core/fluent/backend/test_transform.py | Adds a test to validate _invoke supports a value parameter name. |
| dev/microsoft-agents-testing/tests/core/fluent/backend/test_model_predicate.py | Adds coverage for truthiness behavior when root callables return empty lists. |
| dev/microsoft-agents-testing/README.md | Updates top-level package readme with typed shortcut notes, contains, and doc index changes. |
| dev/microsoft-agents-testing/microsoft_agents/testing/utils/contains.py | Implements Contains predicate and the contains() factory. |
| dev/microsoft-agents-testing/microsoft_agents/testing/utils/init.py | Exposes contains from microsoft_agents.testing.utils. |
| dev/microsoft-agents-testing/microsoft_agents/testing/core/type_defs.py | Introduces typed Expect/Select wrappers for Activity and Exchange. |
| dev/microsoft-agents-testing/microsoft_agents/testing/core/fluent/select.py | Refactors to SelectBase + concrete Select, with generic/self-typed chaining updates. |
| dev/microsoft-agents-testing/microsoft_agents/testing/core/fluent/expect.py | Refactors to ExpectBase + concrete Expect for typed wrapper reuse. |
| dev/microsoft-agents-testing/microsoft_agents/testing/core/fluent/backend/types/unset.py | Renames internal Unset class to _Unset while keeping the singleton Unset. |
| dev/microsoft-agents-testing/microsoft_agents/testing/core/fluent/backend/transform.py | Extends predicate invocation to support value parameter name; broadens eval typing. |
| dev/microsoft-agents-testing/microsoft_agents/testing/core/fluent/backend/model_predicate.py | Updates match truthiness computation and broadens accepted input types. |
| dev/microsoft-agents-testing/microsoft_agents/testing/core/fluent/init.py | Exports ExpectBase/SelectBase alongside Expect/Select. |
| dev/microsoft-agents-testing/microsoft_agents/testing/core/agent_client.py | Updates AgentClient fluent shortcuts to return typed wrappers. |
| dev/microsoft-agents-testing/microsoft_agents/testing/core/init.py | Re-exports new typed wrappers and base classes from core. |
| dev/microsoft-agents-testing/microsoft_agents/testing/init.py | Re-exports new typed wrappers and base classes from the top-level package. |
| dev/microsoft-agents-testing/docs/UTILITIES.md | Adds a new utilities guide documenting contains, poll, send, and ex_send. |
| dev/microsoft-agents-testing/docs/samples/utilities.py | Adds a runnable sample demonstrating contains, poll, send, and ex_send. |
| dev/microsoft-agents-testing/docs/samples/transcript_formatting.py | Updates sample to reflect new transcript formatters and convenience functions. |
| dev/microsoft-agents-testing/docs/samples/test_motivation_assertions.py | Normalizes punctuation in the MOTIVATION assertion sample strings. |
| dev/microsoft-agents-testing/docs/samples/scenario_registry_demo.py | Updates sample docstring/comment formatting and wording. |
| dev/microsoft-agents-testing/docs/samples/quickstart.py | Updates sample docstring/comment formatting and wording. |
| dev/microsoft-agents-testing/docs/samples/pytest_plugin_usage.py | Updates sample docs and demonstrates typed expect/select usage. |
| dev/microsoft-agents-testing/docs/samples/multi_client.py | Updates sample output/formatter usage and docstring/comment formatting. |
| dev/microsoft-agents-testing/docs/samples/interactive.py | Updates sample to use format() output and refreshed documentation text. |
| dev/microsoft-agents-testing/docs/samples/deep_dive_assertions.py | Adds a new deep-dive sample walking through assertions, wrappers, and contains. |
| dev/microsoft-agents-testing/docs/samples/init.py | Updates sample index text and includes new samples. |
| dev/microsoft-agents-testing/docs/SAMPLES.md | Updates runnable samples guide, including module-run commands and new samples. |
| dev/microsoft-agents-testing/docs/README.md | Updates docs README with typed shortcut notes and added guide links. |
| dev/microsoft-agents-testing/docs/CLI.md | Adds a new CLI guide for agt, including scenario/env/scaffolding commands. |
| dev/microsoft-agents-testing/docs/ASSERTIONS.md | Adds a comprehensive fluent assertions guide (Expect/Select/matching/lambdas/typed wrappers). |
| dev/microsoft-agents-testing/docs/API.md | Updates API reference to include typed wrappers, contains, and revised CLI option names. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Rodrigo Brandão (rodrigobr-msft)
deleted the
users/robrandao/testing-shortcuts
branch
July 16, 2026 21:00
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 significantly improves the documentation for the
microsoft-agents-testingpackage by clarifying the fluent assertion APIs, introducing new guides, and enhancing the CLI and utility documentation. The changes make it much easier to understand and use the assertion framework, the CLI, and advanced matching features. The most important updates are grouped below.Assertion API and Usage Documentation Improvements:
ASSERTIONS.md, covering theExpectandSelectassertion engine, typed wrappers (ActivityExpect,ExchangeExpect, etc.), matching rules, lambda conventions, and diagnostic output.README.mdandAPI.mdto clarify the differences betweenexpect()/select()(now returningActivityExpect/ActivitySelect) andex_expect()/ex_select()(now returningExchangeExpect/ExchangeSelect). Updated API reference tables and docstrings accordingly. [1] [2] [3] [4] [5] [6]x,actual, orvalueto receive the resolved value during evaluation. [1] [2]Advanced Matching and Utility Functions:
containsutility for matching nested values in models, dicts, or iterables, with usage examples and explanation of valid invocation patterns. Added cross-references toUTILITIES.md. [1] [2] [3]CLI Documentation:
CLI.mdguide detailing theagtcommand, global options, scenario commands (chat, post, load, run), environment commands, and scaffolding.API.md(e.g., changed--json-fileto--json_file).Transcript Formatting Documentation:
ConversationTranscriptFormatter,ActivityTranscriptFormatter, andJsonTranscriptFormatter, and clarified their outputs.Documentation Organization:
docs/directory, includingASSERTIONS.md,CLI.md, andUTILITIES.md. [1] [2]These changes greatly improve the discoverability and clarity of the testing package’s features and should make it much easier for new and existing users to write robust agent tests.