Skip to content

Add test coverage for LargePayloads capability registration#504

Closed
Copilot wants to merge 2 commits intowangbill/logwokfrom
copilot/sub-pr-502
Closed

Add test coverage for LargePayloads capability registration#504
Copilot wants to merge 2 commits intowangbill/logwokfrom
copilot/sub-pr-502

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Nov 14, 2025

Addresses missing test coverage for capability registration when calling UseExternalizedPayloads(). The extension method adds WorkerCapability.LargePayloads to worker options but lacked verification.

Changes

  • Added DurableTaskWorkerBuilderExtensionsAzureBlobPayloadsTests.cs with unit tests covering both UseExternalizedPayloads() overloads
  • Tests verify WorkerCapability.LargePayloads is correctly added to GrpcDurableTaskWorkerOptions.Capabilities
  • Updated Worker.Grpc.Tests.csproj to reference AzureBlobPayloads project

Test Pattern

[Fact]
public void UseExternalizedPayloads_AddsLargePayloadsCapability()
{
    ServiceCollection services = new();
    DefaultDurableTaskWorkerBuilder builder = new("test", services);
    
    builder.UseGrpc(opt => opt.Channel = channel);
    services.AddSingleton<PayloadStore>(new FakePayloadStore());
    
    builder.UseExternalizedPayloads();
    
    var options = provider.GetService<IOptionsMonitor<GrpcDurableTaskWorkerOptions>>()!.Get("test");
    options.Capabilities.Should().Contain(P.WorkerCapability.LargePayloads);
}

Follows existing test patterns for worker builder extension methods (e.g., UseScheduledTasks).


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: YunchuWang <12449837+YunchuWang@users.noreply.github.com>
Copilot AI changed the title [WIP] WIP to address feedback on support worker features announcement PR Add test coverage for LargePayloads capability registration Nov 14, 2025
Copilot AI requested a review from YunchuWang November 14, 2025 22:29
@YunchuWang YunchuWang marked this pull request as ready for review November 14, 2025 22:33
@YunchuWang YunchuWang closed this Nov 14, 2025
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.

2 participants