Disable R2R publish test for Mono (#16900)

This commit is contained in:
Matt Thalman 2023-07-10 10:08:15 -05:00 committed by GitHub
parent 62ef57f114
commit 9c792aa68d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 2 deletions

View file

@ -27,9 +27,14 @@ public class BasicScenarioTests : SmokeTests
public static IEnumerable<TestScenario> GetScenarios()
{
// Since this has to be a static method, we don't have access to XUnit's output helper. So we use our own version as a placeholder.
DotNetHelper helper = new(new DebugTestOutputHelper());
foreach (DotNetLanguage language in Enum.GetValues<DotNetLanguage>())
{
yield return new(nameof(BasicScenarioTests), language, DotNetTemplate.Console, DotNetActions.Build | DotNetActions.Run | DotNetActions.PublishComplex | DotNetActions.PublishR2R);
yield return new(nameof(BasicScenarioTests), language, DotNetTemplate.Console,
// R2R is not supported on Mono (see https://github.com/dotnet/runtime/issues/88419#issuecomment-1623762676)
DotNetActions.Build | DotNetActions.Run | DotNetActions.PublishComplex | (helper.IsMonoRuntime ? DotNetActions.None : DotNetActions.PublishR2R));
yield return new(nameof(BasicScenarioTests), language, DotNetTemplate.ClassLib, DotNetActions.Build | DotNetActions.Publish);
yield return new(nameof(BasicScenarioTests), language, DotNetTemplate.XUnit, DotNetActions.Test);
yield return new(nameof(BasicScenarioTests), language, DotNetTemplate.NUnit, DotNetActions.Test);

View file

@ -0,0 +1,21 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Diagnostics;
using Xunit.Abstractions;
namespace Microsoft.DotNet.SourceBuild.SmokeTests;
internal class DebugTestOutputHelper : ITestOutputHelper
{
public void WriteLine(string message)
{
Debug.WriteLine(message);
}
public void WriteLine(string format, params object[] args)
{
Debug.WriteLine(format, args);
}
}

View file

@ -26,7 +26,7 @@ internal class DotNetHelper
public static string ProjectsDirectory { get; } = Path.Combine(Directory.GetCurrentDirectory(), $"projects-{DateTime.Now:yyyyMMddHHmmssffff}");
private ITestOutputHelper OutputHelper { get; }
private bool IsMonoRuntime { get; }
public bool IsMonoRuntime { get; }
public DotNetHelper(ITestOutputHelper outputHelper)
{