Skip to content

Harden affected test selection for example changes#1415

Merged
aaronpowell merged 1 commit into
mainfrom
aaronpowell/harden-example-test-selection
Jun 18, 2026
Merged

Harden affected test selection for example changes#1415
aaronpowell merged 1 commit into
mainfrom
aaronpowell/harden-example-test-selection

Conversation

@aaronpowell

Copy link
Copy Markdown
Member

Closes #<ISSUE_NUMBER>
N/A

This hardens the affected-test selector so non-project files under examples/**, such as a new example .gitignore, no longer force the entire integration test matrix to run.

The selector now derives the example root from the changed path, gathers the projects under that example, and reuses the existing dependency graph to select only the tests tied to those example projects. It still falls back to the full matrix when an example change cannot be resolved to any affected tests.

PR Checklist

  • Created a feature/dev branch in your fork (vs. submitting directly from a commit on main)
  • Based off latest main branch of toolkit
  • PR doesn't include merge commits (always rebase on top of our main, if needed)
  • New integration
    • Docs are written
    • Added description of major feature to project description for NuGet package (4000 total character limit, so don't push entire description over that)
  • Tests for the changes have been added (for bug fixes / features) (if applicable)
  • Contains NO breaking changes
  • Every new API (including internal ones) has full XML docs
  • Code follows all style conventions

Other information

This is intentionally narrow: it only changes the fallback behavior for unmapped examples/** files and preserves the existing full-matrix fallback for truly ambiguous inputs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 17, 2026 07:27
@github-actions

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 -- 1415

Or

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

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 refines the eng/testing/select-affected-tests.cs “affected test” selector so that changes to non-project files under examples/** (e.g., examples/<name>/.gitignore) can be mapped to tests associated with projects under that example, instead of immediately falling back to running the full test matrix.

Changes:

  • Adds example-scoped test selection by deriving the example root from the changed file path and selecting tests mapped to projects under that example.
  • Preserves the existing “run full matrix” fallback when an example change can’t be mapped to any impacted tests.
Show a summary per file
File Description
eng/testing/select-affected-tests.cs Adds TryGetExampleTests and integrates it into the selection flow to avoid full-matrix fallback for resolvable examples/** changes.

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 0

@github-actions

Copy link
Copy Markdown
Contributor

Code Coverage

Package Line Rate Branch Rate Complexity Health
CommunityToolkit.Aspire.DuckDB.Api 99% 100% 13
CommunityToolkit.Aspire.DuckDB.NET.Data 67% 77% 32
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.DuckDB 98% 90% 16
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.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 88% 100% 19
CommunityToolkit.Aspire.Hosting.LavinMQ 90% 83% 18
CommunityToolkit.Aspire.Hosting.LavinMQ.MassTransit 100% 100% 15
CommunityToolkit.Aspire.Hosting.Logto 73% 67% 24
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 76% 59% 107
CommunityToolkit.Aspire.Hosting.Python.Extensions 46% 31% 44
CommunityToolkit.Aspire.Hosting.RavenDB 63% 46% 118
CommunityToolkit.Aspire.Hosting.RavenDB.ApiService 21% 33% 16
CommunityToolkit.Aspire.Hosting.Redis.Extensions 100% 71% 14
CommunityToolkit.Aspire.Hosting.Rust 96% 90% 13
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 70% 52% 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.Logto.Client 53% 62% 38
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 98% 78% 87
CommunityToolkit.Aspire.Sftp 83% 76% 54
CommunityToolkit.Aspire.Sqlite.Api 93% 93% 68
CommunityToolkit.Aspire.SurrealDb 87% 73% 39
Summary 76% (8802 / 11543) 61% (2594 / 4223) 5082

Minimum allowed line rate is 60%

@aaronpowell aaronpowell merged commit bf90b41 into main Jun 18, 2026
136 checks passed
@aaronpowell aaronpowell deleted the aaronpowell/harden-example-test-selection branch June 18, 2026 01:54
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