Skip to content

Add integration test project for Actors.Generators (replaces E2E tests)#1791

Merged
WhitWaldo merged 4 commits intomasterfrom
copilot/add-integration-tests-for-actors-generators
Apr 16, 2026
Merged

Add integration test project for Actors.Generators (replaces E2E tests)#1791
WhitWaldo merged 4 commits intomasterfrom
copilot/add-integration-tests-for-actors-generators

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 16, 2026

Description

New test/Dapr.IntegrationTest.Actors.Generators project that replaces the E2E tests in Dapr.E2E.Test.Actors.Generators with testcontainer-based integration tests matching the existing Dapr.IntegrationTest.Actors patterns. Removes the dependency on the Dapr CLI and manual sidecar/port management.

Project structure:

  • Infrastructure/ActorTestContext and ActorRuntimeHelper (same patterns as Dapr.IntegrationTest.Actors)
  • Actors/IPingActor, IRemoteActor/RemoteActor (server-side), IClientActor with [GenerateActorClient] (source-generated client)
  • GeneratedClientTests.cs — 8 integration tests

Test coverage (8 tests, up from 1 in E2E):

  • Default state retrieval and set/get round-trip (E2E equivalent)
  • [ActorMethod(Name)] attribute mapping verification
  • Void method with no parameters (fire-and-forget + side-effect check)
  • Multiple sequential state updates (last-write-wins)
  • Actor ID isolation (independent state across actors)
  • CancellationToken passthrough
  • JSON serialization with special characters

The IClientActor interface exercises the source generator end-to-end:

[GenerateActorClient]
public interface IClientActor
{
    [ActorMethod(Name = "GetState")]
    Task<ClientState> GetStateAsync(CancellationToken cancellationToken = default);

    [ActorMethod(Name = "SetState")]
    Task SetStateAsync(ClientState state, CancellationToken cancellationToken = default);
    // ...
}

Code quality:

  • RemoteActor uses C# primary constructor matching existing actor patterns in Dapr.IntegrationTest.Actors
  • All logging uses [LoggerMessage] source-generated extension methods (via RemoteActorLogMessages partial class)

Issue reference

Checklist

  • Code compiles correctly
  • Created/updated tests
  • Extended the documentation

…ent integration tests

Agent-Logs-Url: https://github.com/dapr/dotnet-sdk/sessions/f4b37eda-ad54-4022-b2f2-8a0e2455ae00

Co-authored-by: WhitWaldo <2238529+WhitWaldo@users.noreply.github.com>
@WhitWaldo
Copy link
Copy Markdown
Contributor

@copilot Please resolve the merge conflicts

Co-authored-by: WhitWaldo <2238529+WhitWaldo@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 16, 2026

@copilot Please resolve the merge conflicts

Resolved in b3f8b51. The conflict was in all.sln where our new Dapr.IntegrationTest.Actors.Generators project entry overlapped with the WorkflowRetryPolicy example added on master — kept both.

Copilot AI requested a review from WhitWaldo April 16, 2026 10:58
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 62.37%. Comparing base (5169561) to head (9ef744f).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1791   +/-   ##
=======================================
  Coverage   62.37%   62.37%           
=======================================
  Files         285      285           
  Lines        8421     8421           
  Branches      980      980           
=======================================
  Hits         5253     5253           
  Misses       2935     2935           
  Partials      233      233           
Flag Coverage Δ
net10.0 62.36% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

@WhitWaldo WhitWaldo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please review and correct what I identified

Comment thread test/Dapr.IntegrationTest.Actors.Generators/Actors/RemoteActor.cs Outdated
Comment thread test/Dapr.IntegrationTest.Actors.Generators/Actors/RemoteActor.cs Outdated
…llable to Directory.Build.props

Agent-Logs-Url: https://github.com/dapr/dotnet-sdk/sessions/5e15d763-38d4-40d1-92ae-368f5e5cb51d

Co-authored-by: WhitWaldo <2238529+WhitWaldo@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 16, 2026

Please review and correct what I identified

All three items addressed in 6f15733: primary constructor, [LoggerMessage] source-generated logging, and <Nullable> moved to test/Directory.Build.props.

Copilot AI requested a review from WhitWaldo April 16, 2026 22:02
@WhitWaldo
Copy link
Copy Markdown
Contributor

@copilot Well, maybe it was a step too far to pull in the Directory.Props in the integration test directory since that's breaking some of the other integration tests now. Please roll that change back.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 16, 2026

@copilot Well, maybe it was a step too far to pull in the Directory.Props in the integration test directory since that's breaking some of the other integration tests now. Please roll that c...

Reverted in 9ef744f — moved <Nullable>enable</Nullable> back to the project csproj and restored test/Directory.Build.props to its original state.

@WhitWaldo WhitWaldo marked this pull request as ready for review April 16, 2026 22:28
@WhitWaldo WhitWaldo requested review from a team as code owners April 16, 2026 22:29
@WhitWaldo WhitWaldo merged commit 7585d2d into master Apr 16, 2026
284 of 286 checks passed
@WhitWaldo WhitWaldo deleted the copilot/add-integration-tests-for-actors-generators branch April 16, 2026 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants