Skip to content

Add integration tests for exception type handling#544

Merged
YunchuWang merged 4 commits intomainfrom
copilot/add-missing-integration-tests
Dec 10, 2025
Merged

Add integration tests for exception type handling#544
YunchuWang merged 4 commits intomainfrom
copilot/add-missing-integration-tests

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Dec 9, 2025

Implements tests for two orchestration patterns that were tracked as TODOs:

Changes

  • CatchingActivityExceptionsByType - Validates exception filtering in orchestrators using IsCausedBy<TException>() with catch blocks. Covers specific exception types (InvalidOperationException, ArgumentException) and base Exception type handling.
// Example from CatchingActivityExceptionsByType
try
{
    await ctx.CallActivityAsync(throwInvalidOpActivityName);
}
catch (TaskFailedException ex) when (ex.FailureDetails?.IsCausedBy<InvalidOperationException>() == true)
{
    // Handle specific exception type
}

Both tests follow existing patterns: Theory for parameterization, proper lifecycle management with await using, and TimeoutToken for completion waits.

Original prompt

This section details on the original issue you should resolve

<issue_title>Add missing integration tests</issue_title>
<issue_description>Not all features are currently tested. There are a set of TODOs here that we can use to help keep track of what still needs to be done.</issue_description>

<agent_instructions>check the todos and add missing integration tests</agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: YunchuWang <12449837+YunchuWang@users.noreply.github.com>
Copilot AI changed the title [WIP] Add missing integration tests for features Add integration tests for multiple external events and exception type handling Dec 9, 2025
Copilot AI requested a review from YunchuWang December 9, 2025 23:15
@YunchuWang YunchuWang changed the title Add integration tests for multiple external events and exception type handling Add integration tests for exception type handling Dec 10, 2025
@YunchuWang YunchuWang marked this pull request as ready for review December 10, 2025 17:43
Copilot AI review requested due to automatic review settings December 10, 2025 17:43
@YunchuWang
Copy link
Copy Markdown
Member

the multiple events testcase is already in place. adding the other one, signing off

Copy link
Copy Markdown
Contributor

Copilot AI left a 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 addresses one of two TODOs from the integration test backlog. The CatchingActivityExceptionsByType test validates exception filtering in orchestrators using the IsCausedBy<TException>() API with catch blocks and exception filters, covering specific exception types (InvalidOperationException, ArgumentException), successful activity calls, and base Exception type handling.

Key changes:

  • Removed two TODO comments from OrchestrationPatterns.cs
  • Added comprehensive test for exception type filtering in orchestrations

However, the PR description claims both TODOs were implemented, but only one test is present.

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.

Add missing integration tests

4 participants