From 97ac84f4a7493328642daf98d257c358c5f684b4 Mon Sep 17 00:00:00 2001 From: KrzysztofPajak Date: Sat, 8 Aug 2026 22:28:33 +0200 Subject: [PATCH] Run deploy pipeline tests in the configuration it actually builds The deploy workflow has been failing on every push to develop since the shared test script landed: all 21 test projects reported as failed, each in under half a second, with vstest rejecting the assembly path itself as an invalid argument. Nothing was wrong with the tests. "Build sln" produced bin/Release, while run-tests.sh was told Debug and ran with --no-build, so it pointed vstest at bin/Debug paths that were never built. The build step has no --configuration flag, so it looks like it produces Debug. It does not: the job declares `CONFIGURATION: Release` at the env level for the later publish and deploy steps, and MSBuild reads environment variables as properties, so Configuration resolves to Release. The same script invoked as `run-tests.sh Release` from aspnetcore.yml passes on the identical commit. The test step now uses the same env.CONFIGURATION, and the build step states it explicitly rather than relying on the environment doing it invisibly. Co-Authored-By: Claude Opus 5 --- .github/workflows/grandnode.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/grandnode.yml b/.github/workflows/grandnode.yml index 95e4ce74e..a12893703 100644 --- a/.github/workflows/grandnode.yml +++ b/.github/workflows/grandnode.yml @@ -32,9 +32,12 @@ jobs: - name: Restore run: dotnet restore "${{ env.WORKING_DIRECTORY }}" - name: Build sln - run: dotnet build "GrandNode.sln" + run: dotnet build "GrandNode.sln" --configuration ${{ env.CONFIGURATION }} - name: Unit tests - run: ./.github/scripts/run-tests.sh Debug + # The job-level CONFIGURATION env var is picked up by MSBuild as the Configuration + # property, so "Build sln" above produces Release regardless of the missing + # --configuration flag. The tests must look in the same place. + run: ./.github/scripts/run-tests.sh ${{ env.CONFIGURATION }} - name: Build run: dotnet build "${{ env.WORKING_DIRECTORY }}" --configuration ${{ env.CONFIGURATION }} --no-restore -p:SourceRevisionId=${{ github.sha }} -p:GitBranch=${{ github.ref_name }} - name: Publish