Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable format tests on Alpine #17247

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion eng/pipelines/templates/jobs/vmr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ parameters:
- name: excludeOmniSharpTests
type: boolean

- name: excludeDotnetFormatTests
type: boolean

- name: enablePoison
type: boolean

Expand Down Expand Up @@ -218,7 +221,7 @@ jobs:
set -x

dockerVolumeArgs="-v $(sourcesPath):/vmr"
dockerEnvArgs="-e SMOKE_TESTS_EXCLUDE_OMNISHARP=${{ parameters.excludeOmniSharpTests }} -e SMOKE_TESTS_WARN_SDK_CONTENT_DIFFS=true -e SMOKE_TESTS_RUNNING_IN_CI=true"
dockerEnvArgs="-e SMOKE_TESTS_EXCLUDE_OMNISHARP=${{ parameters.excludeOmniSharpTests }} -e SMOKE_TESTS_EXCLUDE_DOTNETFORMAT=${{ parameters.excludeDotnetFormatTests }} -e SMOKE_TESTS_WARN_SDK_CONTENT_DIFFS=true -e SMOKE_TESTS_RUNNING_IN_CI=true"
poisonArg=''

if [[ '${{ parameters.enablePoison }}' == 'True' ]]; then
Expand Down
12 changes: 12 additions & 0 deletions eng/pipelines/templates/stages/vmr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ stages:
buildFromArchive: false # 🚫
enablePoison: false # 🚫
excludeOmniSharpTests: true # ✅
excludeDotnetFormatTests: false # 🚫
runOnline: true # ✅
useMonoRuntime: false # 🚫
withPreviousSDK: false # 🚫
Expand All @@ -101,6 +102,7 @@ stages:
buildFromArchive: true # ✅
enablePoison: false # 🚫
excludeOmniSharpTests: true # ✅
excludeDotnetFormatTests: false # 🚫
runOnline: false # 🚫
useMonoRuntime: false # 🚫
withPreviousSDK: false # 🚫
Expand All @@ -123,6 +125,7 @@ stages:
buildFromArchive: false # ✅
enablePoison: false # 🚫
excludeOmniSharpTests: true # ✅
excludeDotnetFormatTests: true # ✅ - https://github.com/dotnet/format/issues/1945
runOnline: false # 🚫
useMonoRuntime: false # 🚫
withPreviousSDK: false # 🚫
Expand All @@ -141,6 +144,7 @@ stages:
buildFromArchive: false # 🚫
enablePoison: false # 🚫
excludeOmniSharpTests: true # ✅
excludeDotnetFormatTests: false # 🚫
runOnline: true # ✅
useMonoRuntime: false # 🚫
withPreviousSDK: true # ✅
Expand All @@ -159,6 +163,7 @@ stages:
buildFromArchive: false # 🚫
enablePoison: false # 🚫
excludeOmniSharpTests: true # ✅
excludeDotnetFormatTests: false # 🚫
runOnline: false # 🚫
useMonoRuntime: false # 🚫
withPreviousSDK: true # ✅
Expand All @@ -177,6 +182,7 @@ stages:
buildFromArchive: true # ✅
enablePoison: false # 🚫
excludeOmniSharpTests: true # ✅
excludeDotnetFormatTests: false # 🚫
runOnline: false # 🚫
useMonoRuntime: true # ✅
withPreviousSDK: false # 🚫
Expand All @@ -195,6 +201,7 @@ stages:
buildFromArchive: true # ✅
enablePoison: false # 🚫
excludeOmniSharpTests: false # 🚫
excludeDotnetFormatTests: false # 🚫
runOnline: false # 🚫
useMonoRuntime: false # 🚫
withPreviousSDK: false # 🚫
Expand All @@ -213,6 +220,7 @@ stages:
buildFromArchive: true # ✅
enablePoison: true # ✅
excludeOmniSharpTests: false # 🚫
excludeDotnetFormatTests: false # 🚫
runOnline: false # 🚫
useMonoRuntime: false # 🚫
withPreviousSDK: false # 🚫
Expand All @@ -231,6 +239,7 @@ stages:
buildFromArchive: false # 🚫
enablePoison: false # 🚫
excludeOmniSharpTests: false # 🚫
excludeDotnetFormatTests: false # 🚫
runOnline: false # 🚫
useMonoRuntime: false # 🚫
withPreviousSDK: false # 🚫
Expand All @@ -249,6 +258,7 @@ stages:
buildFromArchive: false # 🚫
enablePoison: false # 🚫
excludeOmniSharpTests: false # 🚫
excludeDotnetFormatTests: false # 🚫
runOnline: false # 🚫
useMonoRuntime: false # 🚫
withPreviousSDK: false # 🚫
Expand All @@ -269,6 +279,7 @@ stages:
buildFromArchive: false # 🚫
enablePoison: false # 🚫
excludeOmniSharpTests: true # ✅
excludeDotnetFormatTests: false # 🚫
runOnline: false # 🚫
useMonoRuntime: false # 🚫
withPreviousSDK: false # 🚫
Expand All @@ -288,6 +299,7 @@ stages:
buildFromArchive: false # 🚫
enablePoison: false # 🚫
excludeOmniSharpTests: false # 🚫
excludeDotnetFormatTests: false # 🚫
runOnline: false # 🚫
useMonoRuntime: false # 🚫
withPreviousSDK: false # 🚫
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace Microsoft.DotNet.SourceBuild.SmokeTests;
internal static class Config
{
public const string DotNetDirectoryEnv = "SMOKE_TESTS_DOTNET_DIR";
public const string ExcludeDotnetFormatEnv = "SMOKE_TESTS_EXCLUDE_DOTNETFORMAT";
public const string ExcludeOmniSharpEnv = "SMOKE_TESTS_EXCLUDE_OMNISHARP";
public const string MsftSdkTarballPathEnv = "SMOKE_TESTS_MSFT_SDK_TARBALL_PATH";
public const string PoisonReportPathEnv = "SMOKE_TESTS_POISON_REPORT_PATH";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public DotNetFormatTests(ITestOutputHelper outputHelper) : base(outputHelper) {
/// <Summary>
/// Format an unformatted project and verify that the output matches the pre-computed solution.
/// </Summary>
[Fact]
[SkippableFact(Config.ExcludeDotnetFormatEnv, skipOnTrue: true)]
Copy link
Member

Choose a reason for hiding this comment

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

The disadvantage of this approach is that the test is going to fail by default when run on Alpine. This is going to impact our Alpine distro maintainer friends. An alternative approach is to utilize the Config.TargetRid and conditionally run the test based on if it contains "alpine". We do something similar for osx today - https://github.com/dotnet/dotnet/blob/main/test/Microsoft.DotNet.SourceBuild.SmokeTests/TestScenario.cs#L14

The other advantage of this approach is that I see this workaround as being temporary until the dotnet-format issue is resolved. Utilizing Config.TargetRid would be a more scoped change (only needing to touch one place in the code).

public void FormatProject()
{
string unformattedCsFilePath = Path.Combine(BaselineHelper.GetAssetsDirectory(), UnformattedFileName);
Expand Down