Filter src by framework for tests build (#4244)

* Separate build and test into parallel jobs

* Filter source projects by framework for tests build
This commit is contained in:
westey
2026-02-25 11:52:43 +00:00
committed by GitHub
Unverified
parent 9059721788
commit ce9f2cdbb1
3 changed files with 31 additions and 20 deletions
+12 -1
View File
@@ -101,7 +101,18 @@ Tests use the [Microsoft Testing Platform](https://learn.microsoft.com/dotnet/co
```bash
# Run all unit tests across the solution, ignoring projects with no matching tests
dotnet test --solution ./agent-framework-dotnet.slnx --no-build -f net10.0
dotnet test --solution ./agent-framework-dotnet.slnx --no-build -f net10.0 --ignore-exit-code 8
```
- **Running tests with `--solution` for a specific TFM** requires all projects in the solution to support that TFM. Not all projects target every framework (e.g., some are `net10.0`-only). Use `.github/workflows/New-FilteredSolution.ps1` to generate a filtered solution:
```powershell
# Generate a filtered solution for net472 and run tests
$filtered = .github/workflows/New-FilteredSolution.ps1 -Solution dotnet/agent-framework-dotnet.slnx -TargetFramework net472
dotnet test --solution $filtered --no-build -f net472 --ignore-exit-code 8
# Exclude samples and keep only unit test projects
.github/workflows/New-FilteredSolution.ps1 -Solution dotnet/agent-framework-dotnet.slnx -TargetFramework net10.0 -ExcludeSamples -TestProjectNameFilter "*UnitTests*" -OutputPath dotnet/filtered-unit.slnx
```
```bash