Repository navigation
test(worker): scope Alpine-container Node tests to X64 builds - #234
Closed
florentianayuwono wants to merge 2 commits into
Closed
florentianayuwono wants to merge 2 commits into
florentianayuwono wants to merge 2 commits into
Conversation
StepHost.CheckPlatformForAlpineContainer gates Alpine Node support on Constants.Runner.PlatformArchitecture.Equals(Constants.Architecture.X64). That value is baked in at compile time via the X64/ARM/ARM64 preprocessor symbols (set from the PackageRuntime MSBuild property), not detected at test-runtime. When the Test assembly is built natively on a linux-arm64 self-hosted runner (no explicit PackageRuntime override), PlatformArchitecture compiles to Arm64, so these three tests deterministically throw NotSupportedException instead of exercising the Alpine-specific behavior they were written for. This was previously invisible because a dead matrix condition in build.yml meant the L0 test step never actually ran on the linux-arm64 leg. Gate the three Alpine-container tests with #if X64 so they only compile/run against X64-targeted Test assembly builds, matching the production code's own intentional restriction. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The 'L0' step's condition compared matrix.runtime (always 'linux-*'-
prefixed, e.g. 'linux-x64', 'linux-arm64') against bare arch names
('arm64', 'amd64') that only ever appear in the separate matrix.runs_on
field. This mismatch meant the condition never evaluated true for any
matrix leg, so ./dev.sh test has silently never run as part of this
workflow, on any architecture, on PRs or pushes.
Compared against upstream actions/runner's build.yml to confirm intent:
upstream runs L0 on every runtime except the ones that can't execute
natively on its GitHub-hosted runners (linux-arm64, linux-arm, osx-arm64,
win-arm64, since those jobs run cross-compiled on amd64 hosts). This
fork instead builds each target on matching self-hosted native hardware
(runs-on: matrix.runs_on), so linux-arm64 can safely run its own tests
directly, unlike upstream.
Fix: compare against the correct matrix.runtime values and enable L0 for
linux-x64 and linux-arm64 (native, unpatched builds). linux-arm (32-bit
armv7l, cross-targeted), ppc64le, and s390x are intentionally left
disabled for now -- they require their respective patches applied first,
and their dotnet-test behavior under cross/32-bit targeting is not yet
validated. Enabling genuine L0 coverage for those is tracked as separate
follow-up work.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Author
florentianayuwono
deleted the
fix/alpine-container-tests-x64-only-isd-5856
branch
October 6, 2026 18:10
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.
Summary
Three L0 tests in
StepHostL0.cs(DetermineNodeRuntimeVersionInAlpineContainerAsync,DetermineNode20RuntimeVersionInAlpineContainerAsync,DetermineNode24RuntimeVersionInAlpineContainerAsync) fail deterministically whenever theTestassembly is built natively onlinux-arm64. This surfaced in #233's CI run once the dead L0-test matrix condition there was fixed anddotnet testactually ran on thelinux-arm64leg for the first time.Root cause
StepHost.CheckPlatformForAlpineContainergates Alpine Node support with:Constants.Runner.PlatformArchitectureis not detected at runtime — it's baked in at compile time via#if X86/#if ARM/#if ARM64/elsedirectives inConstants.cs, driven by theX64/ARM/ARM64preprocessor symbols thatDirectory.Build.propssets from thePackageRuntimeMSBuild property../dev.sh testauto-detects the host architecture (viauname -m) and setsPackageRuntimeaccordingly when no explicit target runtime is passed. On alinux-arm64self-hosted runner, that means theTestassembly is built withPackageRuntime=linux-arm64, theARM64symbol is defined, andPlatformArchitecturecompiles toArm64— soCheckPlatformForAlpineContaineralways throws, regardless of what the test is actually trying to verify. This is 100% reproducible, not flaky, and is unrelated to the actual Alpine-container Node-version-detection logic the tests exercise.This was previously invisible because the
build.ymlL0-test-trigger condition was dead (see #233), so the test step never actually executed on thelinux-arm64matrix leg.Fix
Gate the three Alpine-container tests with
#if X64, matching the production code's own intentional X64-only restriction for Alpine support. They now only compile/run as part of an X64-targetedTestassembly build, which is the only configuration where the behavior they exercise is actually reachable.Testing
./dev.sh test— full local suite builds and runs cleanly (one unrelated pre-existing local-environment failure inProcessExtensionL0.SuccessReadProcessEnv, caused by a missing cachednode20external in this sandbox, not by this change).dotnet test --filter "FullyQualifiedName~StepHostL0|FullyQualifiedName~JobExtensionL0"— 41/41 passed.