Skip to content

Build solution in PR pipeline before running tests#3911

Merged
iarekk merged 1 commit into
masterfrom
iarekk/pipeline-add-build
Jul 2, 2026
Merged

Build solution in PR pipeline before running tests#3911
iarekk merged 1 commit into
masterfrom
iarekk/pipeline-add-build

Conversation

@iarekk

@iarekk iarekk commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

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.yml only ran template-install-dependencies.yaml (SDKs, NuGet, KeyVault) and then template-run-unit-tests.yaml (VSTest@2 against pre-built bin assemblies). There was no build step.

  • On the old MwWilson1EsHostedPool (persistent/self-hosted) pool, build output lingered in the workspace between runs, so VSTest found stale assemblies.
  • After Use Microsoft-hosted windows-2022 pool for PR pipeline #3908 moved the job to the Microsoft-hosted windows-2022 pool (clean, ephemeral VM per run), nothing is pre-built → the bin glob matches nothing → no tests run.

Fix

Add build/template-build.yaml and run it between dependency install and the test steps:

  1. Install the wasm-tools workload.
  2. 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

  • Structure follows the MSAL.NET ADO pipeline (discrete DotNetCoreCLI@2 restore/build/workload steps).
  • Uses the dotnet-SDK MSBuild (dotnet msbuild -r) rather than VSBuild@1 (which MSAL.NET uses) because IdWeb multi-targets net10.0; the dotnet SDK installed via UseDotNet resolves the net10 SDK reliably, whereas VS-bundled MSBuild can struggle with newer SDKs.
  • Validation of the Windows/net462/net472 build happens in CI (can't be built on Linux).

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>
@iarekk
iarekk requested a review from a team as a code owner July 2, 2026 09:54
@iarekk
iarekk merged commit ca9889b into master Jul 2, 2026
4 checks passed
@iarekk
iarekk deleted the iarekk/pipeline-add-build branch July 2, 2026 10:16
This was referenced Jul 3, 2026
This was referenced Jul 14, 2026
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