Skip to content

Run deploy pipeline tests in the configuration it actually builds - #764

Merged
KrzysztofPajak merged 1 commit into
developfrom
fix/deploy-pipeline-test-configuration
Aug 8, 2026
Merged

Run deploy pipeline tests in the configuration it actually builds#764
KrzysztofPajak merged 1 commit into
developfrom
fix/deploy-pipeline-test-configuration

Conversation

@KrzysztofPajak

Copy link
Copy Markdown
Member

Type: bugfix

Issue

Build and deploy .NET Core app to Linux WebApp grandnode fails on every push to
develop, 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:

Test run for .../src/Tests/Grand.SharedKernel.Tests/bin/Debug/net10.0/Grand.SharedKernel.Tests.dll
The argument .../bin/Debug/net10.0/Grand.SharedKernel.Tests.dll is invalid.

No test actually ran. The Build sln step produced bin/Release (visible at
line 345 of the same log), while run-tests.sh was told Debug and 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 --configuration flag. 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.

Confirming it locally:

$ CONFIGURATION=Release dotnet build src/Tests/Grand.SharedKernel.Tests/Grand.SharedKernel.Tests.csproj
$ ls src/Tests/Grand.SharedKernel.Tests/bin/Release/net10.0/Grand.SharedKernel.Tests.dll

The same script invoked as run-tests.sh Release from aspnetcore.yml passes on the
identical commit (run 31268755713),
which is what isolates this to the configuration mismatch rather than the script or
the tests.

Solution

  • The Unit tests step uses ${{ env.CONFIGURATION }} instead of the hard-coded
    Debug, so it looks where the build actually wrote.
  • The Build sln step 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.
  • A comment records why the coupling exists, so the next person does not "fix" the
    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

  1. Merge and push to develop; the Unit tests step should report
    All 21 test projects passed. and the job should proceed to Publish and Deploy.
  2. Locally, CONFIGURATION=Release dotnet build <any test csproj> writes to
    bin/Release/net10.0/ despite no --configuration flag, which is the mechanism
    behind the failure.
  3. ./.github/scripts/run-tests.sh Release after a Release build of the solution
    runs all 21 projects.

🤖 Generated with Claude Code

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>
Copilot AI lite review requested due to automatic review settings August 8, 2026 20:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@KrzysztofPajak
KrzysztofPajak merged commit 9deb834 into develop Aug 8, 2026
4 of 5 checks passed
@KrzysztofPajak
KrzysztofPajak deleted the fix/deploy-pipeline-test-configuration branch August 8, 2026 20:31
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