From 049e823177d70874001f5cd9e55ac86bc1458a6d Mon Sep 17 00:00:00 2001 From: Giles Odigwe Date: Tue, 12 May 2026 07:22:36 -0700 Subject: [PATCH] Rename filter parameters for consistency TestProjectNameFilter -> TestProjectNameIncludeFilter TestProjectNameExclude -> TestProjectNameExcludeFilter Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/dotnet-build-and-test.yml | 6 +++--- dotnet/eng/scripts/New-FilteredSolution.ps1 | 20 ++++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/dotnet-build-and-test.yml b/.github/workflows/dotnet-build-and-test.yml index a4ce1963d2..74bda66e49 100644 --- a/.github/workflows/dotnet-build-and-test.yml +++ b/.github/workflows/dotnet-build-and-test.yml @@ -230,11 +230,11 @@ jobs: Verbose = $true } ./dotnet/eng/scripts/New-FilteredSolution.ps1 @commonArgs ` - -TestProjectNameFilter "*UnitTests*" ` + -TestProjectNameIncludeFilter "*UnitTests*" ` -OutputPath dotnet/filtered-unit.slnx ./dotnet/eng/scripts/New-FilteredSolution.ps1 @commonArgs ` - -TestProjectNameFilter "*IntegrationTests*" ` - -TestProjectNameExclude "*DurableTask.IntegrationTests*","*AzureFunctions.IntegrationTests*" ` + -TestProjectNameIncludeFilter "*IntegrationTests*" ` + -TestProjectNameExcludeFilter "*DurableTask.IntegrationTests*","*AzureFunctions.IntegrationTests*" ` -OutputPath dotnet/filtered-integration.slnx - name: Run Unit Tests diff --git a/dotnet/eng/scripts/New-FilteredSolution.ps1 b/dotnet/eng/scripts/New-FilteredSolution.ps1 index 84b4c86aa2..4dde9aaee5 100644 --- a/dotnet/eng/scripts/New-FilteredSolution.ps1 +++ b/dotnet/eng/scripts/New-FilteredSolution.ps1 @@ -21,14 +21,14 @@ .PARAMETER Configuration Optional MSBuild configuration used when querying TargetFrameworks. Defaults to Debug. -.PARAMETER TestProjectNameFilter +.PARAMETER TestProjectNameIncludeFilter Optional wildcard pattern to filter test project names (e.g., *UnitTests*, *IntegrationTests*). When specified, only test projects whose filename matches this pattern are kept. -.PARAMETER TestProjectNameExclude +.PARAMETER TestProjectNameExcludeFilter Optional wildcard pattern(s) to exclude test projects by name (e.g., *DurableTask.IntegrationTests*). When specified, test projects whose filename matches any of these patterns are removed. - Applied after TestProjectNameFilter. Can be a single string or an array of strings. + Applied after TestProjectNameIncludeFilter. Can be a single string or an array of strings. .PARAMETER ExcludeSamples When specified, removes all projects under the samples/ directory from the solution. @@ -43,7 +43,7 @@ .EXAMPLE # Generate a solution with only unit test projects - ./dotnet/eng/scripts/New-FilteredSolution.ps1 -Solution dotnet/agent-framework-dotnet.slnx -TargetFramework net10.0 -TestProjectNameFilter "*UnitTests*" -OutputPath filtered-unit.slnx + ./dotnet/eng/scripts/New-FilteredSolution.ps1 -Solution dotnet/agent-framework-dotnet.slnx -TargetFramework net10.0 -TestProjectNameIncludeFilter "*UnitTests*" -OutputPath filtered-unit.slnx .EXAMPLE # Inline usage with dotnet test (PowerShell) @@ -51,7 +51,7 @@ .EXAMPLE # Generate integration tests excluding DurableTask and AzureFunctions - ./dotnet/eng/scripts/New-FilteredSolution.ps1 -Solution dotnet/agent-framework-dotnet.slnx -TargetFramework net10.0 -TestProjectNameFilter "*IntegrationTests*" -TestProjectNameExclude "*DurableTask.IntegrationTests*","*AzureFunctions.IntegrationTests*" -OutputPath filtered-other-integration.slnx + ./dotnet/eng/scripts/New-FilteredSolution.ps1 -Solution dotnet/agent-framework-dotnet.slnx -TargetFramework net10.0 -TestProjectNameIncludeFilter "*IntegrationTests*" -TestProjectNameExcludeFilter "*DurableTask.IntegrationTests*","*AzureFunctions.IntegrationTests*" -OutputPath filtered-other-integration.slnx #> [CmdletBinding()] @@ -64,9 +64,9 @@ param( [string]$Configuration = "Debug", - [string]$TestProjectNameFilter, + [string]$TestProjectNameIncludeFilter, - [string[]]$TestProjectNameExclude, + [string[]]$TestProjectNameExcludeFilter, [switch]$ExcludeSamples, @@ -111,7 +111,7 @@ foreach ($proj in $allProjects) { $isTestProject = $projRelPath -like "*tests/*" # Filter test projects by name pattern if specified - if ($isTestProject -and $TestProjectNameFilter -and ($projFileName -notlike $TestProjectNameFilter)) { + if ($isTestProject -and $TestProjectNameIncludeFilter -and ($projFileName -notlike $TestProjectNameIncludeFilter)) { Write-Verbose "Removing (name filter): $projRelPath" $removed += $projRelPath $proj.ParentNode.RemoveChild($proj) | Out-Null @@ -119,9 +119,9 @@ foreach ($proj in $allProjects) { } # Exclude test projects matching any exclusion pattern - if ($isTestProject -and $TestProjectNameExclude) { + if ($isTestProject -and $TestProjectNameExcludeFilter) { $excluded = $false - foreach ($pattern in $TestProjectNameExclude) { + foreach ($pattern in $TestProjectNameExcludeFilter) { if ($projFileName -like $pattern) { $excluded = $true break