Skip to content

Commit a00a519

Browse files
committed
document the sadness that is cross-platform container execution
1 parent 4743318 commit a00a519

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

.github/workflows/dotnet.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,5 @@ jobs:
2626
global-json-file: 'global.json' # in addition to the 6.0 we need for tests, install "latest"
2727
- name: Build
2828
run: dotnet build --consoleloggerparameters:NoSummary --warnAsError
29-
- name: Set up Docker Buildx to handle more platforms
30-
uses: docker/setup-buildx-action@v2
31-
with:
32-
platforms: linux/amd64,linux/arm64,linux/386,linux/arm/v7,linux/arm/v6
33-
- name: Discover docker platforms
34-
run: docker buildx ls
3529
- name: Test
3630
run: dotnet test --no-build --logger GitHubActions

Test.Microsoft.NET.Build.Containers.Filesystem/EndToEnd.cs

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -276,17 +276,23 @@ public async Task EndToEnd_NoAPI()
276276
privateNuGetAssets.Delete(true);
277277
}
278278

279-
[DataRow("linux-arm", false, "/app", "linux/arm/v7")] // packaging framework-dependent because emulating arm on x64 Docker host doesn't work
280-
//[DataRow("linux-x86", false, "/app", "linux/386")] // packaging framework-dependent because missing runtime packs for x86 linux. // MS doesn't ship a linux-x86 image
281-
[DataRow("linux-arm64", false, "/app", "linux/arm64/v8")] // packaging framework-dependent because emulating arm64 on x64 Docker host doesn't work
282-
[DataRow("win-x64", true, "C:\\app", "windows/amd64")] // packaging self-contained because Windows containers can't run on Linux hosts
279+
// These two are commented because the Github Actions runers don't let us easily configure the Docker Buildx config -
280+
// we need to configure it to allow emulation of other platforms on amd64 hosts before these two will run.
281+
// They do run locally, however.
282+
283+
//[DataRowAttribute("linux-arm", false, "/app", "linux/arm/v7")] // packaging framework-dependent because emulating arm on x64 Docker host doesn't work
284+
//[DataRowAttribute("linux-arm64", false, "/app", "linux/arm64/v8")] // packaging framework-dependent because emulating arm64 on x64 Docker host doesn't work
285+
286+
// this one should be skipped in all cases because we don't ship linux-x86 runtime packs, so we can't execute the 'apphost' version of the app
287+
//[DataRowAttribute("linux-x86", false, "/app", "linux/386")] // packaging framework-dependent because missing runtime packs for x86 linux.
288+
289+
// This one should be skipped because containers can't be configured to run on Linux hosts :(
290+
//[DataRow("win-x64", true, "C:\\app", "windows/amd64")]
291+
292+
// As a result, we only have one actual data-driven test
283293
[DataRow("linux-x64", true, "/app", "linux/amd64")]
284-
[TestMethod]
294+
[DataTestMethod]
285295
public async Task CanPackageForAllSupportedContainerRIDs(string rid, bool isRIDSpecific, string workingDir, string dockerPlatform) {
286-
if (rid == "win-x64") {
287-
Assert.Inconclusive("Cannot run Windows containers on Linux hosts (or at the same time as Linux containers), so skipping for now");
288-
return;
289-
}
290296
string publishDirectory = await BuildLocalApp(tfm : "net7.0", rid : (isRIDSpecific ? rid : null));
291297

292298
// Build the image

0 commit comments

Comments
 (0)