From 78d73f21d1287d4b40a0d98cb9b68eca1f833be2 Mon Sep 17 00:00:00 2001 From: Iarek Kovtunenko <16271112+iarekk@users.noreply.github.com> Date: Thu, 2 Jul 2026 10:54:25 +0100 Subject: [PATCH] Build solution in PR pipeline before running tests 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> --- azure-pipelines.yml | 1 + build/template-build.yaml | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 build/template-build.yaml diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 0f611f3cc..b2fcfe3c9 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -16,4 +16,5 @@ jobs: - visualstudio steps: - template: build/template-install-dependencies.yaml + - template: build/template-build.yaml - template: build/template-run-unit-tests.yaml diff --git a/build/template-build.yaml b/build/template-build.yaml new file mode 100644 index 000000000..785dbef2f --- /dev/null +++ b/build/template-build.yaml @@ -0,0 +1,19 @@ +# template-build.yaml +# Restore and build the solution so that the test assemblies exist before +# the VSTest steps run. This is required on Microsoft-hosted (ephemeral) +# agents, which start from a clean workspace with no pre-built output. + +steps: +- task: DotNetCoreCLI@2 + displayName: 'Install wasm-tools workload' + inputs: + command: 'custom' + custom: 'workload' + arguments: 'install wasm-tools' + +- task: DotNetCoreCLI@2 + displayName: 'Build solution (Release)' + inputs: + command: 'custom' + custom: 'msbuild' + arguments: 'Microsoft.Identity.Web.sln -r -t:build -verbosity:m -property:Configuration=Release'