Run deploy pipeline tests in the configuration it actually builds - #764
Merged
Merged
Conversation
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 <noreply@anthropic.com>
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.
Type: bugfix
Issue
Build and deploy .NET Core app to Linux WebApp grandnodefails on every push todevelop, so nothing has deployed since the shared test script landed in #759.Example: run 31268755721.
All 21 test projects are reported as failed, each in well under a second:
No test actually ran. The
Build slnstep producedbin/Release(visible atline 345 of the same log), while
run-tests.shwas toldDebugand runs with--no-build, so it pointed vstest at Debug assemblies that were never built.The build step looks like it produces Debug - it has no
--configurationflag. Itdoes not. The job declares
CONFIGURATION: Releaseat theenvlevel for the laterpublish and deploy steps, and MSBuild reads environment variables as properties, so
Configurationresolves toRelease.Confirming it locally:
The same script invoked as
run-tests.sh Releasefromaspnetcore.ymlpasses on theidentical commit (run 31268755713),
which is what isolates this to the configuration mismatch rather than the script or
the tests.
Solution
Unit testsstep uses${{ env.CONFIGURATION }}instead of the hard-codedDebug, so it looks where the build actually wrote.Build slnstep states--configuration ${{ env.CONFIGURATION }}explicitly.This changes nothing about what it produces; it stops the configuration being
decided invisibly by an environment variable, which is what made the mismatch hard
to see in the first place.
test step back to Debug.
Breaking changes
None. Tests now run in Release in this workflow, which is the configuration the job
builds, publishes and deploys.
Testing
develop; theUnit testsstep should reportAll 21 test projects passed.and the job should proceed to Publish and Deploy.CONFIGURATION=Release dotnet build <any test csproj>writes tobin/Release/net10.0/despite no--configurationflag, which is the mechanismbehind the failure.
./.github/scripts/run-tests.sh Releaseafter a Release build of the solutionruns all 21 projects.
🤖 Generated with Claude Code