dotnet / dotnet/sdk

It_does_not_download_desktop_targeting_packs_on_unix doesn't work for SDK redist (only redist-installer)

Open
#42,230 0 comments 0 reactions 0 assignees View on GitHub
Test Debt untriaged
Dominant language
C#
Stars
3.2k
Forks
1.3k
PR merge metrics
PR metrics pending

Description

## Summary

When [onboarding the Installer tests to Helix](https://github.com/dotnet/sdk/pull/42195), one test was always failing, `It_does_not_download_desktop_targeting_packs_on_unix`. This test is to check that it doesn't download targeting packs on non-Windows systems. However, it doesn't work with the current design of test running based on the overlayed SDK. Instead, it does work with the 'final' build of the SDK based on the redist-installer output.

## Details

When trying to figure this situation out, I produced binlogs of this test from both the SDK repo and the Install repo for this test (by doing `new DotnetBuildCommand(testInstance, "-bl:build.binlog")` in the test). Looking at them, I noticed that the `ProcessFrameworkReferences` target runs differently. The furthest I got into the investigation was that [this if-else statement](https://github.com/dotnet/sdk/blob/78d0aa4ec2146c58ba22474ab7ca756607e6cffd/src/Tasks/Microsoft.NET.Build.Tasks/ProcessFrameworkReferences.cs#L262-L283) ran differently between the repos. In Installer, it hit the if-statement portion, but the SDK repo hits the else portion. This causes the SDK repo to add the packs for download, downloads them, and fails the test.

Without digging further, I wondered if it was because the tests run against the `redist` output and not the `redist-installer` output. If you change [this line](https://github.com/dotnet/sdk/blob/78d0aa4ec2146c58ba22474ab7ca756607e6cffd/test/Microsoft.NET.TestFramework/ToolsetInfo.cs#L257) to use `"redist-installer"` instead, the test passes. What this means is that when we merge the "redist" and "redist-installer" process together, this test should be re-enabled.

There's clearly something with how the SDK that the tests are being ran on affects it. I looked into it a bit deeper with Jacques, looking at stuff like the SDK version being declared in `global.json` and what packages exist in the NuGet cache. But, it could be a number of reasons this doesn't function properly against the overlayed SDK.

## Binlogs

SDK:
https://microsoft-my.sharepoint.com/:u:/p/miyanni/EUTESSfhChJGoPYYCdXKX_AB6EWagIyfalE8HkQJDuqMkw?e=qxyiOK

Installer:
https://microsoft-my.sharepoint.com/:u:/p/miyanni/EWw4XIdzTm1LoR5kSrudeLEBdqPNGUyzQIFQkmxfWPPDTw?e=s9fiPc

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.