Build solution in PR pipeline before running tests#3911
Merged
Conversation
The PR pipeline ran VSTest against pre-built assemblies in tests\**\bin but never built the solution. On the old persistent MwWilson1EsHostedPool this happened to work because build output lingered between runs; on the Microsoft-hosted windows-2022 pool each run starts clean, so VSTest reported 'No test sources found' and zero unit tests executed. Add build/template-build.yaml (install wasm-tools workload + 'dotnet msbuild ... -r -t:build' in Release, mirroring the GitHub Actions build) and run it between dependency install and the test steps. Structure follows the MSAL.NET ADO pipeline (discrete DotNetCoreCLI@2 steps); the dotnet-SDK MSBuild is used instead of VSBuild@1 to reliably resolve the net10.0 SDK. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
bgavrilMS
approved these changes
Jul 2, 2026
This was referenced Jul 3, 2026
Closed
This was referenced Jul 14, 2026
Closed
Closed
Closed
Closed
Open
Open
Closed
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The PR pipeline reported
##[warning]No test sources found matching the given filter 'tests\Microsoft.Identity.Web.Test\bin\**\Microsoft.Identity.Web.Test.dll'and ran zero unit tests.Root cause:
azure-pipelines.ymlonly rantemplate-install-dependencies.yaml(SDKs, NuGet, KeyVault) and thentemplate-run-unit-tests.yaml(VSTest@2against pre-builtbinassemblies). There was no build step.MwWilson1EsHostedPool(persistent/self-hosted) pool, build output lingered in the workspace between runs, so VSTest found stale assemblies.windows-2022pool (clean, ephemeral VM per run), nothing is pre-built → thebinglob matches nothing → no tests run.Fix
Add
build/template-build.yamland run it between dependency install and the test steps:wasm-toolsworkload.dotnet msbuild Microsoft.Identity.Web.sln -r -t:build -verbosity:m -property:Configuration=Release.This mirrors the repo's GitHub Actions build command, so the VSTest steps then find the freshly-built
bin\Release\**assemblies.Notes / references
DotNetCoreCLI@2restore/build/workload steps).dotnet msbuild -r) rather thanVSBuild@1(which MSAL.NET uses) because IdWeb multi-targets net10.0; the dotnet SDK installed viaUseDotNetresolves the net10 SDK reliably, whereas VS-bundled MSBuild can struggle with newer SDKs.