Skip to content

Add integration test project to validate example projects build successfully#1792

Merged
WhitWaldo merged 5 commits into
masterfrom
copilot/add-integration-test-examples
Apr 17, 2026
Merged

Add integration test project to validate example projects build successfully#1792
WhitWaldo merged 5 commits into
masterfrom
copilot/add-integration-test-examples

Conversation

Copilot AI commented Apr 16, 2026

Copy link
Copy Markdown
Contributor

Description

Adds test/Dapr.IntegrationTest.Examples — an xUnit test project that automatically discovers all .csproj files under examples/ and validates they compile against the current SDK source. This catches breaking API changes, missing types, and dependency issues before they ship.

  • Auto-discovery: Finds all example projects via filesystem scan — new examples are covered automatically with no test updates needed
  • Build validation: Parameterized [Theory] runs dotnet build --framework net10.0 on each example project
  • Exclusions: Hosting/ examples are excluded (external Aspire SDK NuGet deps, not testing source-level SDK compat)
  • CI-safe: 5-min per-project timeout, process tree cleanup, serial execution to avoid build contention
[Theory]
[MemberData(nameof(GetExampleProjects))]
public async Task ExampleProject_ShouldBuildSuccessfully(string relativeProjectPath)
{
    var fullPath = Path.Combine(repoRoot, "examples", relativeProjectPath);
    var (exitCode, output) = await RunDotnetBuildAsync(fullPath);
    Assert.True(exitCode == 0, $"Build failed for '{relativeProjectPath}':\n{output}");
}

Issue reference

Checklist

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

Copilot AI and others added 2 commits April 16, 2026 10:04
@WhitWaldo

Copy link
Copy Markdown
Contributor

@copilot Please resolve the merge conflict

…tion-test-examples

# Conflicts:
#	all.sln

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

Copilot AI commented Apr 16, 2026

Copy link
Copy Markdown
Contributor Author

@copilot Please resolve the merge conflict

Resolved the merge conflict in all.sln — both the new Dapr.IntegrationTest.Examples project and the WorkflowRetryPolicy example from master are now included. See merge commit 73279fe.

Copilot AI requested a review from WhitWaldo April 16, 2026 10:59
@WhitWaldo

Copy link
Copy Markdown
Contributor

@copilot Please fix the merge conflicts

…lot/add-integration-test-examples

# Conflicts:
#	all.sln

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

Copilot AI commented Apr 16, 2026

Copy link
Copy Markdown
Contributor Author

@copilot Please fix the merge conflicts

Resolved the merge conflict in all.sln — both Dapr.IntegrationTest.Examples and Dapr.IntegrationTest.Actors.Generators (from #1791) are now included. See merge commit 284edb1.

@codecov

codecov Bot commented Apr 17, 2026

Copy link
Copy Markdown

Codecov Report

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

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

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.

@WhitWaldo WhitWaldo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please remove the unnecessary test

/// Verifies that the WorkflowUnitTest example's tests pass when executed.
/// </summary>
[Fact]
public async Task WorkflowUnitTestExample_ShouldPassTests()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This test is unnecessary

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed the WorkflowUnitTestExample_ShouldPassTests test and its RunDotnetTestAsync helper in e77d8de.

Copilot AI requested a review from WhitWaldo April 17, 2026 07:43
@WhitWaldo WhitWaldo marked this pull request as ready for review April 17, 2026 20:23
@WhitWaldo WhitWaldo requested review from a team as code owners April 17, 2026 20:24
@WhitWaldo WhitWaldo merged commit a5f2008 into master Apr 17, 2026
297 of 299 checks passed
@WhitWaldo WhitWaldo deleted the copilot/add-integration-test-examples branch April 17, 2026 20:24
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