Skip to content

Analyzing and improving PR test execution efficiency#1355

Merged
aaronpowell merged 10 commits into
mainfrom
copilot/improve-test-execution-strategy
May 25, 2026
Merged

Analyzing and improving PR test execution efficiency#1355
aaronpowell merged 10 commits into
mainfrom
copilot/improve-test-execution-strategy

Conversation

Copilot AI commented May 25, 2026

Copy link
Copy Markdown
Contributor

Pull request created by AI Agent

Copilot AI and others added 6 commits May 25, 2026 02:40
Co-authored-by: aaronpowell <434140+aaronpowell@users.noreply.github.com>
Co-authored-by: aaronpowell <434140+aaronpowell@users.noreply.github.com>
Co-authored-by: aaronpowell <434140+aaronpowell@users.noreply.github.com>
Co-authored-by: aaronpowell <434140+aaronpowell@users.noreply.github.com>
Co-authored-by: aaronpowell <434140+aaronpowell@users.noreply.github.com>
Co-authored-by: aaronpowell <434140+aaronpowell@users.noreply.github.com>
@aaronpowell

Copy link
Copy Markdown
Member

@copilot we probably don't need the workflow that validates the list of tests, since it was only used to ensure that the static-matrix was setup. Since we're now generating a matrix, it's not needed.

Co-authored-by: aaronpowell <434140+aaronpowell@users.noreply.github.com>

Copilot AI commented May 25, 2026

Copy link
Copy Markdown
Contributor Author

@copilot we probably don't need the workflow that validates the list of tests, since it was only used to ensure that the static-matrix was setup. Since we're now generating a matrix, it's not needed.

Fixed in fb85d17.

Copilot AI requested a review from aaronpowell May 25, 2026 03:15
@github-actions

github-actions Bot commented May 25, 2026

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/CommunityToolkit/Aspire/main/eng/scripts/dogfood-pr.sh | bash -s -- 1355

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/CommunityToolkit/Aspire/main/eng/scripts/dogfood-pr.ps1) } 1355"

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@aaronpowell aaronpowell marked this pull request as ready for review May 25, 2026 04:37
Copilot AI review requested due to automatic review settings May 25, 2026 04:38

Copilot AI 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.

Pull request overview

This PR updates the repository’s CI to compute and run a reduced integration-test matrix based on the files changed in a pull request, aiming to improve test execution efficiency while preserving a full-matrix fallback when impact is uncertain.

Changes:

  • Added a git-diff–based affected-test selector that emits a JSON selection plus a human-readable summary.
  • Updated the reusable integration-test workflow to accept a JSON list of tests and dynamically build the matrix.
  • Extended the test-list generator script with --json/--plain modes and removed the previous workflow/list verification job.
Show a summary per file
File Description
eng/testing/select-affected-tests.cs New selector app that maps changed files/package updates to impacted integration test projects and outputs selection artifacts.
eng/testing/generate-test-list-for-workflow.sh Adds structured output modes (--json, --plain) to feed workflows while keeping the existing workflow-friendly output.
.github/workflows/tests.yaml Resolves test matrix from provided JSON (or generated full list) and uses it to drive the matrix dynamically, with a noop path when empty.
.github/workflows/pr-tests.yaml Removes the prior “Verify Test List” workflow (no longer needed with dynamic generation).
.github/workflows/dotnet-ci.yml Adds an affected-tests job and wires its selected matrix into the reusable tests.yaml workflow.

Copilot's findings

  • Files reviewed: 5/5 changed files
  • Comments generated: 3

Comment thread eng/testing/select-affected-tests.cs Outdated
Comment on lines +134 to +139
if (filePath == ".github/workflows/tests.yaml")
{
ignoredFiles.Add(filePath);
continue;
}

selected.UnionWith(impacted);
if (missing.Count > 0)
{
reasons.Add($"Ignored package changes for {string.Join(", ", missing.OrderBy(static packageId => packageId, StringComparer.Ordinal))} because they only affect projects already changed in this PR.");
Comment on lines +261 to +311
private static async Task<(Dictionary<string, HashSet<string>> ProjectRefs, Dictionary<string, HashSet<string>> PackageRefs, List<string> ProjectPaths)> ProjectDataAsync(
string repoRoot,
string headSha,
IReadOnlyList<string> diffFiles)
{
var projectRefs = new Dictionary<string, HashSet<string>>(StringComparer.Ordinal);
var packageRefs = new Dictionary<string, HashSet<string>>(StringComparer.Ordinal);
var projectPaths = new List<string>();
var seenProjectPaths = new HashSet<string>(StringComparer.Ordinal);
var changedProjectFiles = new HashSet<string>(
diffFiles.Where(static filePath => filePath.EndsWith(".csproj", StringComparison.Ordinal)),
StringComparer.Ordinal);

foreach (var rootName in new[] { "src", "tests", "examples", "tests-app-hosts" })
{
var rootPath = Path.Combine(repoRoot, rootName);
if (!Directory.Exists(rootPath))
{
continue;
}

foreach (var projectPath in Directory.EnumerateFiles(rootPath, "*.csproj", SearchOption.AllDirectories).OrderBy(static path => path, StringComparer.Ordinal))
{
var relative = RelativePath(repoRoot, projectPath);
var document = changedProjectFiles.Contains(relative)
? XDocument.Parse(await RunGitAsync(repoRoot, "show", $"{headSha}:{relative}"))
: XDocument.Load(projectPath);

AddProjectData(repoRoot, projectPath, relative, document, projectRefs, packageRefs);
projectPaths.Add(relative);
seenProjectPaths.Add(relative);
}
}

foreach (var projectPath in diffFiles.Where(static filePath => filePath.EndsWith(".csproj", StringComparison.Ordinal)))
{
if (seenProjectPaths.Contains(projectPath))
{
continue;
}

var output = await RunGitAsync(repoRoot, "show", $"{headSha}:{projectPath}");
var document = XDocument.Parse(output);
AddProjectData(repoRoot, Path.Combine(repoRoot, projectPath), projectPath, document, projectRefs, packageRefs);
projectPaths.Add(projectPath);
seenProjectPaths.Add(projectPath);
}

return (projectRefs, packageRefs, projectPaths);
}

@github-actions

Copy link
Copy Markdown
Contributor

Code Coverage

Package Line Rate Branch Rate Complexity Health
CommunityToolkit.Aspire.GoFeatureFlag 100% 97% 44
CommunityToolkit.Aspire.Hosting.ActiveMQ 88% 48% 95
CommunityToolkit.Aspire.Hosting.ActiveMQ.MassTransit 100% 100% 15
CommunityToolkit.Aspire.Hosting.Adminer 89% 70% 20
CommunityToolkit.Aspire.Hosting.Azure.Dapr 28% 5% 38
CommunityToolkit.Aspire.Hosting.Azure.Dapr.Redis 56% 46% 26
CommunityToolkit.Aspire.Hosting.Azure.DataApiBuilder 85% 83% 18
CommunityToolkit.Aspire.Hosting.Azure.Extensions 64% 30% 27
CommunityToolkit.Aspire.Hosting.Bun 88% 69% 20
CommunityToolkit.Aspire.Hosting.Dapr 43% 25% 648
CommunityToolkit.Aspire.Hosting.DbGate 96% 62% 12
CommunityToolkit.Aspire.Hosting.Deno 95% 85% 24
CommunityToolkit.Aspire.Hosting.Elasticsearch.Extensions 100% 94% 30
CommunityToolkit.Aspire.Hosting.Flagd 80% 100% 16
CommunityToolkit.Aspire.Hosting.Flyway 88% 100% 6
CommunityToolkit.Aspire.Hosting.GoFeatureFlag 80% 50% 24
CommunityToolkit.Aspire.Hosting.GoFeatureFlag.ApiService 100% 100% 3
CommunityToolkit.Aspire.Hosting.Golang 59% 46% 49
CommunityToolkit.Aspire.Hosting.Java 86% 75% 207
CommunityToolkit.Aspire.Hosting.Java.ApiApp 65% 50% 11
CommunityToolkit.Aspire.Hosting.Java.WebApp 25% 18% 59
CommunityToolkit.Aspire.Hosting.JavaScript.Extensions 92% 83% 190
CommunityToolkit.Aspire.Hosting.k6 70% 10% 8
CommunityToolkit.Aspire.Hosting.k6.ApiService 64% 67% 13
CommunityToolkit.Aspire.Hosting.Keycloak.Extensions 100% 100% 11
CommunityToolkit.Aspire.Hosting.KurrentDB 86% 88% 19
CommunityToolkit.Aspire.Hosting.LavinMQ 90% 83% 18
CommunityToolkit.Aspire.Hosting.LavinMQ.MassTransit 100% 100% 15
CommunityToolkit.Aspire.Hosting.MailPit 91% 100% 13
CommunityToolkit.Aspire.Hosting.McpInspector 85% 60% 100
CommunityToolkit.Aspire.Hosting.McpInspector.McpServer 89% 100% 2
CommunityToolkit.Aspire.Hosting.Meilisearch 95% 85% 30
CommunityToolkit.Aspire.Hosting.Meilisearch.ApiService 82% 100% 15
CommunityToolkit.Aspire.Hosting.Minio 99% 91% 32
CommunityToolkit.Aspire.Hosting.Minio.ApiService 98% 92% 15
CommunityToolkit.Aspire.Hosting.MongoDB.Extensions 91% 90% 11
CommunityToolkit.Aspire.Hosting.MySql.Extensions 98% 93% 37
CommunityToolkit.Aspire.Hosting.Ngrok 55% 43% 106
CommunityToolkit.Aspire.Hosting.Ollama 77% 67% 267
CommunityToolkit.Aspire.Hosting.OpenTelemetryCollector 79% 70% 42
CommunityToolkit.Aspire.Hosting.PapercutSmtp 100% 100% 9
CommunityToolkit.Aspire.Hosting.Perl 85% 76% 745
CommunityToolkit.Aspire.Hosting.PostgreSQL.Extensions 93% 91% 47
CommunityToolkit.Aspire.Hosting.PowerShell 70% 51% 100
CommunityToolkit.Aspire.Hosting.Python.Extensions 46% 31% 44
CommunityToolkit.Aspire.Hosting.RavenDB 63% 46% 118
CommunityToolkit.Aspire.Hosting.RavenDB.ApiService 3% 0% 16
CommunityToolkit.Aspire.Hosting.Redis.Extensions 100% 71% 14
CommunityToolkit.Aspire.Hosting.Rust 94% 83% 8
CommunityToolkit.Aspire.Hosting.Sftp 90% 62% 15
CommunityToolkit.Aspire.Hosting.Sftp.ApiService 94% 100% 10
CommunityToolkit.Aspire.Hosting.Solr 88% 100% 19
CommunityToolkit.Aspire.Hosting.SqlDatabaseProjects 68% 59% 146
CommunityToolkit.Aspire.Hosting.Sqlite 88% 93% 25
CommunityToolkit.Aspire.Hosting.SqlServer.Extensions 86% 81% 41
CommunityToolkit.Aspire.Hosting.Stripe 50% 17% 119
CommunityToolkit.Aspire.Hosting.SurrealDb 69% 51% 216
CommunityToolkit.Aspire.Hosting.SurrealDb.ApiService 81% 52% 299
CommunityToolkit.Aspire.Hosting.Umami 98% 75% 9
CommunityToolkit.Aspire.Hosting.Zitadel 97% 86% 31
CommunityToolkit.Aspire.KurrentDB 97% 95% 33
CommunityToolkit.Aspire.MassTransit.RabbitMQ 100% 100% 24
CommunityToolkit.Aspire.Meilisearch 97% 96% 38
CommunityToolkit.Aspire.Microsoft.Data.Sqlite 94% 85% 26
CommunityToolkit.Aspire.Microsoft.EntityFrameworkCore.Sqlite 71% 73% 117
CommunityToolkit.Aspire.Minio.Client 93% 87% 67
CommunityToolkit.Aspire.OllamaSharp 78% 74% 76
CommunityToolkit.Aspire.RavenDB.Client 89% 73% 87
CommunityToolkit.Aspire.Sftp 94% 94% 54
CommunityToolkit.Aspire.Sqlite.Api 93% 90% 68
CommunityToolkit.Aspire.SurrealDb 99% 85% 39
Summary 76% (8542 / 11282) 61% (2539 / 4177) 4996

Minimum allowed line rate is 60%

@aaronpowell aaronpowell temporarily deployed to azure-artifacts May 25, 2026 04:43 — with GitHub Actions Inactive
@aaronpowell aaronpowell merged commit d889b79 into main May 25, 2026
6 checks passed
@aaronpowell aaronpowell deleted the copilot/improve-test-execution-strategy branch May 25, 2026 04:47
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.

3 participants