Merge pull request #13681 from dotnet-maestro-bot/merge/release/6.0.3xx-to-release/6.0.4xx

[automated] Merge branch 'release/6.0.3xx' => 'release/6.0.4xx'
This commit is contained in:
Marc Paine 2022-04-21 13:58:05 -07:00 committed by GitHub
commit a560a9cb51
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 256 additions and 178 deletions

View file

@ -132,7 +132,7 @@ jobs:
customBuildArgs="$customBuildArgs --poison" customBuildArgs="$customBuildArgs --poison"
fi fi
docker run --rm -v $(tarballDir):/tarball -w /tarball ${networkArgs} $(_Container) ./build.sh ${customBuildArgs} $(additionalBuildArgs) -- /p:CleanWhileBuilding=true docker run --rm -v $(tarballDir):/tarball -w /tarball ${networkArgs} $(_Container) ./build.sh --clean-while-building ${customBuildArgs} $(additionalBuildArgs)
displayName: Build Tarball displayName: Build Tarball
- script: | - script: |
@ -146,7 +146,7 @@ jobs:
dockerEnvArgs="-e SMOKE_TESTS_EXCLUDE_OMNISHARP=$(_ExcludeOmniSharpTests) -e SMOKE_TESTS_WARN_SDK_CONTENT_DIFFS=true" dockerEnvArgs="-e SMOKE_TESTS_EXCLUDE_OMNISHARP=$(_ExcludeOmniSharpTests) -e SMOKE_TESTS_WARN_SDK_CONTENT_DIFFS=true"
poisonArg='' poisonArg=''
if [[ '${{ parameters.excludeSdkContentTests}}' != 'true' && '${{ parameters.installerBuildResourceId }}' != 'current' ]]; then if [[ '${{ parameters.excludeSdkContentTests}}' != 'true' ]]; then
dockerVolumeArgs+=" -v $(PIPELINE.WORKSPACE)/${{ parameters.installerBuildResourceId }}/BlobArtifacts/:/BlobArtifacts" dockerVolumeArgs+=" -v $(PIPELINE.WORKSPACE)/${{ parameters.installerBuildResourceId }}/BlobArtifacts/:/BlobArtifacts"
msftSdkTarballName=$(find "$(PIPELINE.WORKSPACE)/${{ parameters.installerBuildResourceId }}/BlobArtifacts/" -name "dotnet-sdk-*-linux-${{ parameters.architecture }}.tar.gz" -exec basename {} \;) msftSdkTarballName=$(find "$(PIPELINE.WORKSPACE)/${{ parameters.installerBuildResourceId }}/BlobArtifacts/" -name "dotnet-sdk-*-linux-${{ parameters.architecture }}.tar.gz" -exec basename {} \;)
dockerEnvArgs+=" -e SMOKE_TESTS_MSFT_SDK_TARBALL_PATH=/BlobArtifacts/$msftSdkTarballName" dockerEnvArgs+=" -e SMOKE_TESTS_MSFT_SDK_TARBALL_PATH=/BlobArtifacts/$msftSdkTarballName"

View file

@ -34,6 +34,8 @@ jobs:
architecture: x64 architecture: x64
condition: ${{ parameters.condition }} condition: ${{ parameters.condition }}
dependsOn: ${{ parameters.dependsOn }} dependsOn: ${{ parameters.dependsOn }}
${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}:
excludeSdkContentTests: true
installerBuildResourceId: ${{ parameters.installerBuildResourceId }} installerBuildResourceId: ${{ parameters.installerBuildResourceId }}
matrix: matrix:
CentOS7-Online: CentOS7-Online:
@ -86,6 +88,8 @@ jobs:
architecture: arm64 architecture: arm64
condition: ${{ parameters.condition }} condition: ${{ parameters.condition }}
dependsOn: ${{ parameters.dependsOn }} dependsOn: ${{ parameters.dependsOn }}
${{ if in(variables['Build.Reason'], 'PullRequest') }}:
excludeSdkContentTests: true
installerBuildResourceId: ${{ parameters.installerBuildResourceId }} installerBuildResourceId: ${{ parameters.installerBuildResourceId }}
matrix: matrix:
${{ if ne(variables['Build.Reason'], 'PullRequest') }}: ${{ if ne(variables['Build.Reason'], 'PullRequest') }}:

View file

@ -5,11 +5,12 @@ IFS=$'\n\t'
usage() { usage() {
echo "usage: $0 [options]" echo "usage: $0 [options]"
echo "options:" echo "options:"
echo " --clean-while-building cleans each repo after building (reduces disk space usage)"
echo " --online build using online sources" echo " --online build using online sources"
echo " --with-packages <dir> use the specified directory of previously-built packages"
echo " --with-sdk <dir> use the SDK in the specified directory for bootstrapping"
echo " --poison build with poisoning checks" echo " --poison build with poisoning checks"
echo " --run-smoke-test don't build; run smoke tests" echo " --run-smoke-test don't build; run smoke tests"
echo " --with-packages <dir> use the specified directory of previously-built packages"
echo " --with-sdk <dir> use the SDK in the specified directory for bootstrapping"
echo "use -- to send the remaining arguments to MSBuild" echo "use -- to send the remaining arguments to MSBuild"
echo "" echo ""
} }
@ -29,9 +30,8 @@ while :; do
lowerI="$(echo $1 | awk '{print tolower($0)}')" lowerI="$(echo $1 | awk '{print tolower($0)}')"
case $lowerI in case $lowerI in
--run-smoke-test) --clean-while-building)
alternateTarget=true MSBUILD_ARGUMENTS+=( "/p:CleanWhileBuilding=true")
MSBUILD_ARGUMENTS+=( "/t:RunSmokeTest" )
;; ;;
--online) --online)
MSBUILD_ARGUMENTS+=( "/p:BuildWithOnlineSources=true") MSBUILD_ARGUMENTS+=( "/p:BuildWithOnlineSources=true")
@ -39,6 +39,10 @@ while :; do
--poison) --poison)
MSBUILD_ARGUMENTS+=( "/p:EnablePoison=true") MSBUILD_ARGUMENTS+=( "/p:EnablePoison=true")
;; ;;
--run-smoke-test)
alternateTarget=true
MSBUILD_ARGUMENTS+=( "/t:RunSmokeTest" )
;;
--with-packages) --with-packages)
CUSTOM_PREVIOUSLY_BUILT_PACKAGES_DIR="$(cd -P "$2" && pwd)" CUSTOM_PREVIOUSLY_BUILT_PACKAGES_DIR="$(cd -P "$2" && pwd)"
if [ ! -d "$CUSTOM_PREVIOUSLY_BUILT_PACKAGES_DIR" ]; then if [ ! -d "$CUSTOM_PREVIOUSLY_BUILT_PACKAGES_DIR" ]; then

View file

@ -561,20 +561,20 @@
BeforeTargets="Build" BeforeTargets="Build"
Condition=" '$(CleanWhileBuilding)' == 'true' "> Condition=" '$(CleanWhileBuilding)' == 'true' ">
<Message Text="DirSize Before Building $(RepositoryName)" Importance="High" /> <Message Text="DirSize Before Building $(RepositoryName)" Importance="High" />
<Exec Command="df --block-size=1M $(ProjectDir)" /> <Exec Command="df -h $(ProjectDir)" />
</Target> </Target>
<Target Name="DisplayDirSizeAfterBuild" <Target Name="DisplayDirSizeAfterBuild"
AfterTargets="Build" AfterTargets="Build"
BeforeTargets="CleanupRepo" BeforeTargets="CleanupRepo"
Condition=" '$(CleanWhileBuilding)' == 'true' "> Condition=" '$(CleanWhileBuilding)' == 'true' ">
<Message Text="DirSize After Building $(RepositoryName)" Importance="High" /> <Message Text="DirSize After Building $(RepositoryName)" Importance="High" />
<Exec Command="df --block-size=1M $(ProjectDir)" /> <Exec Command="df -h $(ProjectDir)" />
</Target> </Target>
<Target Name="DisplayDirSizeAfterClean" <Target Name="DisplayDirSizeAfterClean"
AfterTargets="CleanupRepo" AfterTargets="CleanupRepo"
Condition=" '$(CleanWhileBuilding)' == 'true' "> Condition=" '$(CleanWhileBuilding)' == 'true' ">
<Message Text="DirSize After CleanupRepo $(RepositoryName)" Importance="High" /> <Message Text="DirSize After CleanupRepo $(RepositoryName)" Importance="High" />
<Exec Command="df --block-size=1M $(ProjectDir)" /> <Exec Command="df -h $(ProjectDir)" />
</Target> </Target>
<Target Name="CleanupRepo" <Target Name="CleanupRepo"

View file

@ -85,6 +85,13 @@ namespace Microsoft.DotNet.SourceBuild.SmokeTests
private static string GetBaselineFilePath(string baselineFileName) => Path.Combine(GetAssetsDirectory(), "baselines", baselineFileName); private static string GetBaselineFilePath(string baselineFileName) => Path.Combine(GetAssetsDirectory(), "baselines", baselineFileName);
public static string RemoveNetTfmPaths(string source)
{
string pathSeparator = Regex.Escape(Path.DirectorySeparatorChar.ToString());
Regex netTfmRegex = new($"{pathSeparator}net[1-9]+\\.[0-9]+{pathSeparator}");
return netTfmRegex.Replace(source, $"{Path.DirectorySeparatorChar}netx.y{Path.DirectorySeparatorChar}");
}
public static string RemoveRids(string diff, bool isPortable = false) => public static string RemoveRids(string diff, bool isPortable = false) =>
isPortable ? diff.Replace(Config.PortableRid, "portable-rid") : diff.Replace(Config.TargetRid, "banana-rid"); isPortable ? diff.Replace(Config.PortableRid, "portable-rid") : diff.Replace(Config.TargetRid, "banana-rid");
@ -98,10 +105,7 @@ namespace Microsoft.DotNet.SourceBuild.SmokeTests
+ $"?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?"); + $"?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?");
string result = semanticVersionRegex.Replace(source, $"x.y.z"); string result = semanticVersionRegex.Replace(source, $"x.y.z");
// Remove netx.y path segments return RemoveNetTfmPaths(result);
string pathSeparator = Regex.Escape(Path.DirectorySeparatorChar.ToString());
Regex netTfmRegex = new($"{pathSeparator}net[1-9]+\\.[0-9]+{pathSeparator}");
return netTfmRegex.Replace(result, $"{Path.DirectorySeparatorChar}netx.y{Path.DirectorySeparatorChar}");
} }
} }
} }

View file

@ -30,6 +30,7 @@ internal static class Config
public static string? SdkTarballPath { get; } = Environment.GetEnvironmentVariable(SdkTarballPathEnv); public static string? SdkTarballPath { get; } = Environment.GetEnvironmentVariable(SdkTarballPathEnv);
public static string TargetRid { get; } = Environment.GetEnvironmentVariable(TargetRidEnv) ?? public static string TargetRid { get; } = Environment.GetEnvironmentVariable(TargetRidEnv) ??
throw new InvalidOperationException($"'{Config.TargetRidEnv}' must be specified"); throw new InvalidOperationException($"'{Config.TargetRidEnv}' must be specified");
public static string TargetArchitecture { get; } = TargetRid.Split('-')[1];
public static bool WarnOnPoisonDiffs { get; } = public static bool WarnOnPoisonDiffs { get; } =
bool.TryParse(Environment.GetEnvironmentVariable(WarnPoisonDiffsEnv), out bool excludeOnlineTests) && excludeOnlineTests; bool.TryParse(Environment.GetEnvironmentVariable(WarnPoisonDiffsEnv), out bool excludeOnlineTests) && excludeOnlineTests;
public static bool WarnOnSdkContentDiffs { get; } = public static bool WarnOnSdkContentDiffs { get; } =

View file

@ -5,7 +5,6 @@
using System; using System;
using System.Diagnostics; using System.Diagnostics;
using System.IO; using System.IO;
using Xunit;
using Xunit.Abstractions; using Xunit.Abstractions;
namespace Microsoft.DotNet.SourceBuild.SmokeTests; namespace Microsoft.DotNet.SourceBuild.SmokeTests;
@ -81,15 +80,6 @@ internal class DotNetHelper
public void ExecuteCmd(string args, string? workingDirectory = null, Action<Process>? additionalProcessConfigCallback = null, int expectedExitCode = 0, int millisecondTimeout = -1) public void ExecuteCmd(string args, string? workingDirectory = null, Action<Process>? additionalProcessConfigCallback = null, int expectedExitCode = 0, int millisecondTimeout = -1)
{ {
Action<Process, string?> configureProcess = (Process process, string? workingDirectory) => {
ConfigureProcess(process, workingDirectory);
if (additionalProcessConfigCallback != null)
{
additionalProcessConfigCallback(process);
}
};
(Process Process, string StdOut, string StdErr) executeResult = ExecuteHelper.ExecuteProcess( (Process Process, string StdOut, string StdErr) executeResult = ExecuteHelper.ExecuteProcess(
DotNetPath, DotNetPath,
args, args,
@ -98,6 +88,13 @@ internal class DotNetHelper
millisecondTimeout: millisecondTimeout); millisecondTimeout: millisecondTimeout);
ExecuteHelper.ValidateExitCode(executeResult, expectedExitCode); ExecuteHelper.ValidateExitCode(executeResult, expectedExitCode);
void configureProcess(Process process, string? workingDirectory)
{
ConfigureProcess(process, workingDirectory);
additionalProcessConfigCallback?.Invoke(process);
}
} }
public static void ConfigureProcess(Process process, string? workingDirectory, bool setPath = false) public static void ConfigureProcess(Process process, string? workingDirectory, bool setPath = false)

View file

@ -44,10 +44,24 @@ internal static class ExecuteHelper
configure?.Invoke(process); configure?.Invoke(process);
StringBuilder stdOutput = new(); StringBuilder stdOutput = new();
process.OutputDataReceived += new DataReceivedEventHandler((sender, e) => stdOutput.AppendLine(e.Data)); process.OutputDataReceived += new DataReceivedEventHandler(
(sender, e) =>
{
lock (stdOutput)
{
stdOutput.AppendLine(e.Data);
}
});
StringBuilder stdError = new(); StringBuilder stdError = new();
process.ErrorDataReceived += new DataReceivedEventHandler((sender, e) => stdError.AppendLine(e.Data)); process.ErrorDataReceived += new DataReceivedEventHandler(
(sender, e) =>
{
lock (stdError)
{
stdError.AppendLine(e.Data);
}
});
process.Start(); process.Start();
process.BeginOutputReadLine(); process.BeginOutputReadLine();

View file

@ -6,15 +6,23 @@ using System;
using System.IO; using System.IO;
using System.Net.Http; using System.Net.Http;
using System.Threading.Tasks; using System.Threading.Tasks;
using Xunit.Abstractions;
namespace Microsoft.DotNet.SourceBuild.SmokeTests; namespace Microsoft.DotNet.SourceBuild.SmokeTests;
internal static class HttpClientExtensions internal static class HttpClientExtensions
{ {
public static async Task DownloadFileAsync(this HttpClient client, Uri uri, string path) public static async Task DownloadFileAsync(this HttpClient client, Uri uri, string path, ITestOutputHelper outputHelper)
{ {
using Stream stream = await client.GetStreamAsync(uri); outputHelper.WriteLine($"Downloading {uri}");
using FileStream fileStream = new(path, FileMode.OpenOrCreate);
await stream.CopyToAsync(fileStream); await Utilities.RetryAsync(
async () =>
{
using Stream stream = await client.GetStreamAsync(uri);
using FileStream fileStream = new(path, FileMode.OpenOrCreate);
await stream.CopyToAsync(fileStream);
},
outputHelper);
} }
} }

View file

@ -60,9 +60,9 @@ public class OmniSharpTests : SmokeTests
if (!Directory.Exists(OmniSharpDirectory)) if (!Directory.Exists(OmniSharpDirectory))
{ {
using HttpClient client = new(); using HttpClient client = new();
string omniSharpTarballFile = "omnisharp-linux-x64.tar.gz"; string omniSharpTarballFile = $"omnisharp-linux-{Config.TargetArchitecture}.tar.gz";
Uri omniSharpTarballUrl = new($"https://github.com/OmniSharp/omnisharp-roslyn/releases/latest/download/{omniSharpTarballFile}"); Uri omniSharpTarballUrl = new($"https://github.com/OmniSharp/omnisharp-roslyn/releases/latest/download/{omniSharpTarballFile}");
await client.DownloadFileAsync(omniSharpTarballUrl, omniSharpTarballFile); await client.DownloadFileAsync(omniSharpTarballUrl, omniSharpTarballFile, OutputHelper);
Directory.CreateDirectory(OmniSharpDirectory); Directory.CreateDirectory(OmniSharpDirectory);
ExecuteHelper.ExecuteProcessValidateExitCode("tar", $"xzf {omniSharpTarballFile} -C {OmniSharpDirectory}", OutputHelper); ExecuteHelper.ExecuteProcessValidateExitCode("tar", $"xzf {omniSharpTarballFile} -C {OmniSharpDirectory}", OutputHelper);

View file

@ -5,35 +5,34 @@
using System; using System;
using Xunit; using Xunit;
namespace Microsoft.DotNet.SourceBuild.SmokeTests namespace Microsoft.DotNet.SourceBuild.SmokeTests;
/// <summary>
/// A Fact that will be skipped based on the specified environment variable's value.
/// </summary>
internal class SkippableFactAttribute : FactAttribute
{ {
/// <summary> public SkippableFactAttribute(string envName, bool skipOnNullOrWhiteSpace = false, bool skipOnTrue = false) =>
/// A Fact that will be skipped based on the specified environment variable's value. CheckEnvs(skipOnNullOrWhiteSpace, skipOnTrue, (skip) => Skip = skip, envName);
/// </summary>
internal class SkippableFactAttribute : FactAttribute public SkippableFactAttribute(string[] envNames, bool skipOnNullOrWhiteSpace = false, bool skipOnTrue = false) =>
CheckEnvs(skipOnNullOrWhiteSpace, skipOnTrue, (skip) => Skip = skip, envNames);
public static void CheckEnvs(bool skipOnNullOrWhiteSpace, bool skipOnTrue, Action<string> setSkip, params string[] envNames)
{ {
public SkippableFactAttribute(string envName, bool skipOnNullOrWhiteSpace = false, bool skipOnTrue = false) => foreach (string envName in envNames)
CheckEnvs(skipOnNullOrWhiteSpace, skipOnTrue, (skip) => Skip = skip, envName);
public SkippableFactAttribute(string[] envNames, bool skipOnNullOrWhiteSpace = false, bool skipOnTrue = false) =>
CheckEnvs(skipOnNullOrWhiteSpace, skipOnTrue, (skip) => Skip = skip, envNames);
public static void CheckEnvs(bool skipOnNullOrWhiteSpace, bool skipOnTrue, Action<string> setSkip, params string[] envNames)
{ {
foreach (string envName in envNames) string? envValue = Environment.GetEnvironmentVariable(envName);
{
string? envValue = Environment.GetEnvironmentVariable(envName);
if (skipOnNullOrWhiteSpace && string.IsNullOrWhiteSpace(envValue)) if (skipOnNullOrWhiteSpace && string.IsNullOrWhiteSpace(envValue))
{ {
setSkip($"Skipping because `{envName}` is null or whitespace"); setSkip($"Skipping because `{envName}` is null or whitespace");
break; break;
} }
else if (skipOnTrue && bool.TryParse(envValue, out bool boolValue) && boolValue) else if (skipOnTrue && bool.TryParse(envValue, out bool boolValue) && boolValue)
{ {
setSkip($"Skipping because `{envName}` is set to True"); setSkip($"Skipping because `{envName}` is set to True");
break; break;
}
} }
} }
} }

View file

@ -4,17 +4,16 @@
using Xunit; using Xunit;
namespace Microsoft.DotNet.SourceBuild.SmokeTests namespace Microsoft.DotNet.SourceBuild.SmokeTests;
{
/// <summary>
/// A Theory that will be skipped based on the specified environment variable's value.
/// </summary>
internal class SkippableTheoryAttribute : TheoryAttribute
{
public SkippableTheoryAttribute(string envName, bool skipOnNullOrWhiteSpace = false, bool skipOnTrue = false) =>
SkippableFactAttribute.CheckEnvs(skipOnNullOrWhiteSpace, skipOnTrue, (skip) => Skip = skip, envName);
public SkippableTheoryAttribute(string[] envNames, bool skipOnNullOrWhiteSpace = false, bool skipOnTrue = false) => /// <summary>
SkippableFactAttribute.CheckEnvs(skipOnNullOrWhiteSpace, skipOnTrue, (skip) => Skip = skip, envNames); /// A Theory that will be skipped based on the specified environment variable's value.
} /// </summary>
internal class SkippableTheoryAttribute : TheoryAttribute
{
public SkippableTheoryAttribute(string envName, bool skipOnNullOrWhiteSpace = false, bool skipOnTrue = false) =>
SkippableFactAttribute.CheckEnvs(skipOnNullOrWhiteSpace, skipOnTrue, (skip) => Skip = skip, envName);
public SkippableTheoryAttribute(string[] envNames, bool skipOnNullOrWhiteSpace = false, bool skipOnTrue = false) =>
SkippableFactAttribute.CheckEnvs(skipOnNullOrWhiteSpace, skipOnTrue, (skip) => Skip = skip, envNames);
} }

View file

@ -2,66 +2,63 @@
// The .NET Foundation licenses this file to you under the MIT license. // The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information. // See the LICENSE file in the project root for more information.
using System; namespace Microsoft.DotNet.SourceBuild.SmokeTests;
namespace Microsoft.DotNet.SourceBuild.SmokeTests public class TestScenario
{ {
public class TestScenario public DotNetActions Commands { get; }
public DotNetLanguage Language { get; }
public bool NoHttps { get; set; } = Config.TargetRid.Contains("osx");
public string ScenarioName { get; }
public DotNetTemplate Template { get; }
public TestScenario(string scenarioName, DotNetLanguage language, DotNetTemplate template, DotNetActions commands = DotNetActions.None)
{ {
public DotNetActions Commands { get; } ScenarioName = scenarioName;
public DotNetLanguage Language { get; } Template = template;
public bool NoHttps { get; set; } = Config.TargetRid.Contains("osx"); Language = language;
public string ScenarioName { get; } Commands = commands;
public DotNetTemplate Template { get; } }
public TestScenario(string scenarioName, DotNetLanguage language, DotNetTemplate template, DotNetActions commands = DotNetActions.None) internal void Execute(DotNetHelper dotNetHelper)
{
// Don't use the cli language name in the project name because it may contain '#': https://github.com/dotnet/roslyn/issues/51692
string projectName = $"{ScenarioName}_{Template}_{Language}";
string customNewArgs = Template.IsAspNetCore() && NoHttps ? "--no-https" : string.Empty;
dotNetHelper.ExecuteNew(Template.GetName(), projectName, Language.ToCliName(), customArgs: customNewArgs);
if (Commands.HasFlag(DotNetActions.Build))
{ {
ScenarioName = scenarioName; dotNetHelper.ExecuteBuild(projectName);
Template = template;
Language = language;
Commands = commands;
} }
if (Commands.HasFlag(DotNetActions.Run))
internal void Execute(DotNetHelper dotNetHelper)
{ {
// Don't use the cli language name in the project name because it may contain '#': https://github.com/dotnet/roslyn/issues/51692 if (Template.IsAspNetCore())
string projectName = $"{ScenarioName}_{Template}_{Language}";
string customNewArgs = Template.IsAspNetCore() && NoHttps ? "--no-https" : string.Empty;
dotNetHelper.ExecuteNew(Template.GetName(), projectName, Language.ToCliName(), customArgs: customNewArgs);
if (Commands.HasFlag(DotNetActions.Build))
{ {
dotNetHelper.ExecuteBuild(projectName); dotNetHelper.ExecuteRunWeb(projectName);
} }
if (Commands.HasFlag(DotNetActions.Run)) else
{ {
if (Template.IsAspNetCore()) dotNetHelper.ExecuteRun(projectName);
{
dotNetHelper.ExecuteRunWeb(projectName);
}
else
{
dotNetHelper.ExecuteRun(projectName);
}
}
if (Commands.HasFlag(DotNetActions.Publish))
{
dotNetHelper.ExecutePublish(projectName);
}
if (Commands.HasFlag(DotNetActions.PublishComplex))
{
dotNetHelper.ExecutePublish(projectName, selfContained: false);
dotNetHelper.ExecutePublish(projectName, selfContained: true, Config.TargetRid);
dotNetHelper.ExecutePublish(projectName, selfContained: true, "linux-x64");
}
if (Commands.HasFlag(DotNetActions.PublishR2R))
{
dotNetHelper.ExecutePublish(projectName, selfContained: true, "linux-x64", trimmed: true, readyToRun: true);
}
if (Commands.HasFlag(DotNetActions.Test))
{
dotNetHelper.ExecuteTest(projectName);
} }
} }
if (Commands.HasFlag(DotNetActions.Publish))
{
dotNetHelper.ExecutePublish(projectName);
}
if (Commands.HasFlag(DotNetActions.PublishComplex))
{
dotNetHelper.ExecutePublish(projectName, selfContained: false);
dotNetHelper.ExecutePublish(projectName, selfContained: true, Config.TargetRid);
dotNetHelper.ExecutePublish(projectName, selfContained: true, "linux-x64");
}
if (Commands.HasFlag(DotNetActions.PublishR2R))
{
dotNetHelper.ExecutePublish(projectName, selfContained: true, "linux-x64", trimmed: true, readyToRun: true);
}
if (Commands.HasFlag(DotNetActions.Test))
{
dotNetHelper.ExecuteTest(projectName);
}
} }
} }

View file

@ -0,0 +1,58 @@
// 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;
using System.Threading;
using System.Threading.Tasks;
using Xunit.Abstractions;
namespace Microsoft.DotNet.SourceBuild.SmokeTests;
public static class Utilities
{
public static async Task RetryAsync(Func<Task> executor, ITestOutputHelper outputHelper)
{
await Utilities.RetryAsync(
async () =>
{
try
{
await executor();
return null;
}
catch (Exception e)
{
return e;
}
},
outputHelper);
}
private static async Task RetryAsync(Func<Task<Exception?>> executor, ITestOutputHelper outputHelper)
{
const int maxRetries = 5;
const int waitFactor = 5;
int retryCount = 0;
Exception? exception = await executor();
while (exception != null)
{
retryCount++;
if (retryCount >= maxRetries)
{
throw new InvalidOperationException($"Failed after {retryCount} retries.", exception);
}
int waitTime = Convert.ToInt32(Math.Pow(waitFactor, retryCount - 1));
if (outputHelper != null)
{
outputHelper.WriteLine($"Retry {retryCount}/{maxRetries}, retrying in {waitTime} seconds...");
}
Thread.Sleep(TimeSpan.FromSeconds(waitTime));
exception = await executor();
}
}
}

View file

@ -37,6 +37,7 @@ public class XmlDocTests : SmokeTests
string pathWithoutPacksPrefix = xmlFile[(targetingPacksDirectory.Length + 1)..]; string pathWithoutPacksPrefix = xmlFile[(targetingPacksDirectory.Length + 1)..];
string[] pathParts = pathWithoutPacksPrefix.Split(Path.DirectorySeparatorChar); string[] pathParts = pathWithoutPacksPrefix.Split(Path.DirectorySeparatorChar);
string pathWithoutVersion = string.Join(Path.DirectorySeparatorChar, pathParts.Take(1).Concat(pathParts.Skip(2))); string pathWithoutVersion = string.Join(Path.DirectorySeparatorChar, pathParts.Take(1).Concat(pathParts.Skip(2)));
pathWithoutVersion = BaselineHelper.RemoveNetTfmPaths(pathWithoutVersion);
missingXmlDoc.Add(pathWithoutVersion); missingXmlDoc.Add(pathWithoutVersion);
} }
} }

View file

@ -2,57 +2,57 @@ Microsoft.AspNetCore.App.Ref/analyzers/dotnet/cs/Microsoft.AspNetCore.App.Analyz
Microsoft.AspNetCore.App.Ref/analyzers/dotnet/cs/Microsoft.AspNetCore.App.CodeFixes.xml Microsoft.AspNetCore.App.Ref/analyzers/dotnet/cs/Microsoft.AspNetCore.App.CodeFixes.xml
Microsoft.AspNetCore.App.Ref/analyzers/dotnet/roslyn4.0/cs/Microsoft.Extensions.Logging.Generators.xml Microsoft.AspNetCore.App.Ref/analyzers/dotnet/roslyn4.0/cs/Microsoft.Extensions.Logging.Generators.xml
Microsoft.NETCore.App.Ref/analyzers/dotnet/cs/System.Text.Json.SourceGeneration.xml Microsoft.NETCore.App.Ref/analyzers/dotnet/cs/System.Text.Json.SourceGeneration.xml
Microsoft.NETCore.App.Ref/ref/net6.0/Microsoft.VisualBasic.xml Microsoft.NETCore.App.Ref/ref/netx.y/Microsoft.VisualBasic.xml
Microsoft.NETCore.App.Ref/ref/net6.0/mscorlib.xml Microsoft.NETCore.App.Ref/ref/netx.y/mscorlib.xml
Microsoft.NETCore.App.Ref/ref/net6.0/System.AppContext.xml Microsoft.NETCore.App.Ref/ref/netx.y/System.AppContext.xml
Microsoft.NETCore.App.Ref/ref/net6.0/System.Buffers.xml Microsoft.NETCore.App.Ref/ref/netx.y/System.Buffers.xml
Microsoft.NETCore.App.Ref/ref/net6.0/System.ComponentModel.DataAnnotations.xml Microsoft.NETCore.App.Ref/ref/netx.y/System.ComponentModel.DataAnnotations.xml
Microsoft.NETCore.App.Ref/ref/net6.0/System.Configuration.xml Microsoft.NETCore.App.Ref/ref/netx.y/System.Configuration.xml
Microsoft.NETCore.App.Ref/ref/net6.0/System.Core.xml Microsoft.NETCore.App.Ref/ref/netx.y/System.Core.xml
Microsoft.NETCore.App.Ref/ref/net6.0/System.Data.DataSetExtensions.xml Microsoft.NETCore.App.Ref/ref/netx.y/System.Data.DataSetExtensions.xml
Microsoft.NETCore.App.Ref/ref/net6.0/System.Data.xml Microsoft.NETCore.App.Ref/ref/netx.y/System.Data.xml
Microsoft.NETCore.App.Ref/ref/net6.0/System.Diagnostics.Debug.xml Microsoft.NETCore.App.Ref/ref/netx.y/System.Diagnostics.Debug.xml
Microsoft.NETCore.App.Ref/ref/net6.0/System.Diagnostics.Tools.xml Microsoft.NETCore.App.Ref/ref/netx.y/System.Diagnostics.Tools.xml
Microsoft.NETCore.App.Ref/ref/net6.0/System.Drawing.xml Microsoft.NETCore.App.Ref/ref/netx.y/System.Drawing.xml
Microsoft.NETCore.App.Ref/ref/net6.0/System.Dynamic.Runtime.xml Microsoft.NETCore.App.Ref/ref/netx.y/System.Dynamic.Runtime.xml
Microsoft.NETCore.App.Ref/ref/net6.0/System.Globalization.Calendars.xml Microsoft.NETCore.App.Ref/ref/netx.y/System.Globalization.Calendars.xml
Microsoft.NETCore.App.Ref/ref/net6.0/System.Globalization.Extensions.xml Microsoft.NETCore.App.Ref/ref/netx.y/System.Globalization.Extensions.xml
Microsoft.NETCore.App.Ref/ref/net6.0/System.Globalization.xml Microsoft.NETCore.App.Ref/ref/netx.y/System.Globalization.xml
Microsoft.NETCore.App.Ref/ref/net6.0/System.IO.Compression.Brotli.xml Microsoft.NETCore.App.Ref/ref/netx.y/System.IO.Compression.Brotli.xml
Microsoft.NETCore.App.Ref/ref/net6.0/System.IO.Compression.FileSystem.xml Microsoft.NETCore.App.Ref/ref/netx.y/System.IO.Compression.FileSystem.xml
Microsoft.NETCore.App.Ref/ref/net6.0/System.IO.FileSystem.Primitives.xml Microsoft.NETCore.App.Ref/ref/netx.y/System.IO.FileSystem.Primitives.xml
Microsoft.NETCore.App.Ref/ref/net6.0/System.IO.FileSystem.xml Microsoft.NETCore.App.Ref/ref/netx.y/System.IO.FileSystem.xml
Microsoft.NETCore.App.Ref/ref/net6.0/System.IO.UnmanagedMemoryStream.xml Microsoft.NETCore.App.Ref/ref/netx.y/System.IO.UnmanagedMemoryStream.xml
Microsoft.NETCore.App.Ref/ref/net6.0/System.IO.xml Microsoft.NETCore.App.Ref/ref/netx.y/System.IO.xml
Microsoft.NETCore.App.Ref/ref/net6.0/System.Net.xml Microsoft.NETCore.App.Ref/ref/netx.y/System.Net.xml
Microsoft.NETCore.App.Ref/ref/net6.0/System.Numerics.Vectors.xml Microsoft.NETCore.App.Ref/ref/netx.y/System.Numerics.Vectors.xml
Microsoft.NETCore.App.Ref/ref/net6.0/System.Numerics.xml Microsoft.NETCore.App.Ref/ref/netx.y/System.Numerics.xml
Microsoft.NETCore.App.Ref/ref/net6.0/System.Reflection.Extensions.xml Microsoft.NETCore.App.Ref/ref/netx.y/System.Reflection.Extensions.xml
Microsoft.NETCore.App.Ref/ref/net6.0/System.Reflection.xml Microsoft.NETCore.App.Ref/ref/netx.y/System.Reflection.xml
Microsoft.NETCore.App.Ref/ref/net6.0/System.Resources.Reader.xml Microsoft.NETCore.App.Ref/ref/netx.y/System.Resources.Reader.xml
Microsoft.NETCore.App.Ref/ref/net6.0/System.Resources.ResourceManager.xml Microsoft.NETCore.App.Ref/ref/netx.y/System.Resources.ResourceManager.xml
Microsoft.NETCore.App.Ref/ref/net6.0/System.Runtime.Extensions.xml Microsoft.NETCore.App.Ref/ref/netx.y/System.Runtime.Extensions.xml
Microsoft.NETCore.App.Ref/ref/net6.0/System.Runtime.Handles.xml Microsoft.NETCore.App.Ref/ref/netx.y/System.Runtime.Handles.xml
Microsoft.NETCore.App.Ref/ref/net6.0/System.Runtime.Serialization.xml Microsoft.NETCore.App.Ref/ref/netx.y/System.Runtime.Serialization.xml
Microsoft.NETCore.App.Ref/ref/net6.0/System.Security.Principal.xml Microsoft.NETCore.App.Ref/ref/netx.y/System.Security.Principal.xml
Microsoft.NETCore.App.Ref/ref/net6.0/System.Security.SecureString.xml Microsoft.NETCore.App.Ref/ref/netx.y/System.Security.SecureString.xml
Microsoft.NETCore.App.Ref/ref/net6.0/System.Security.xml Microsoft.NETCore.App.Ref/ref/netx.y/System.Security.xml
Microsoft.NETCore.App.Ref/ref/net6.0/System.ServiceModel.Web.xml Microsoft.NETCore.App.Ref/ref/netx.y/System.ServiceModel.Web.xml
Microsoft.NETCore.App.Ref/ref/net6.0/System.ServiceProcess.xml Microsoft.NETCore.App.Ref/ref/netx.y/System.ServiceProcess.xml
Microsoft.NETCore.App.Ref/ref/net6.0/System.Text.Encoding.xml Microsoft.NETCore.App.Ref/ref/netx.y/System.Text.Encoding.xml
Microsoft.NETCore.App.Ref/ref/net6.0/System.Threading.Tasks.Extensions.xml Microsoft.NETCore.App.Ref/ref/netx.y/System.Threading.Tasks.Extensions.xml
Microsoft.NETCore.App.Ref/ref/net6.0/System.Threading.Tasks.xml Microsoft.NETCore.App.Ref/ref/netx.y/System.Threading.Tasks.xml
Microsoft.NETCore.App.Ref/ref/net6.0/System.Threading.Timer.xml Microsoft.NETCore.App.Ref/ref/netx.y/System.Threading.Timer.xml
Microsoft.NETCore.App.Ref/ref/net6.0/System.Transactions.xml Microsoft.NETCore.App.Ref/ref/netx.y/System.Transactions.xml
Microsoft.NETCore.App.Ref/ref/net6.0/System.ValueTuple.xml Microsoft.NETCore.App.Ref/ref/netx.y/System.ValueTuple.xml
Microsoft.NETCore.App.Ref/ref/net6.0/System.Web.xml Microsoft.NETCore.App.Ref/ref/netx.y/System.Web.xml
Microsoft.NETCore.App.Ref/ref/net6.0/System.Windows.xml Microsoft.NETCore.App.Ref/ref/netx.y/System.Windows.xml
Microsoft.NETCore.App.Ref/ref/net6.0/System.xml Microsoft.NETCore.App.Ref/ref/netx.y/System.xml
Microsoft.NETCore.App.Ref/ref/net6.0/System.Xml.Linq.xml Microsoft.NETCore.App.Ref/ref/netx.y/System.Xml.Linq.xml
Microsoft.NETCore.App.Ref/ref/net6.0/System.Xml.Serialization.xml Microsoft.NETCore.App.Ref/ref/netx.y/System.Xml.Serialization.xml
Microsoft.NETCore.App.Ref/ref/net6.0/System.Xml.xml Microsoft.NETCore.App.Ref/ref/netx.y/System.Xml.xml
Microsoft.NETCore.App.Ref/ref/net6.0/System.Xml.XmlDocument.xml Microsoft.NETCore.App.Ref/ref/netx.y/System.Xml.XmlDocument.xml
Microsoft.NETCore.App.Ref/ref/net6.0/WindowsBase.xml Microsoft.NETCore.App.Ref/ref/netx.y/WindowsBase.xml
NETStandard.Library.Ref/ref/netstandard2.1/Microsoft.Win32.Primitives.xml NETStandard.Library.Ref/ref/netstandard2.1/Microsoft.Win32.Primitives.xml
NETStandard.Library.Ref/ref/netstandard2.1/mscorlib.xml NETStandard.Library.Ref/ref/netstandard2.1/mscorlib.xml
NETStandard.Library.Ref/ref/netstandard2.1/System.AppContext.xml NETStandard.Library.Ref/ref/netstandard2.1/System.AppContext.xml

View file

@ -856,14 +856,6 @@ index ------------
./sdk/x.y.z/SDKPrecomputedAssemblyReferences.cache ./sdk/x.y.z/SDKPrecomputedAssemblyReferences.cache
./sdk/x.y.z/SdkResolvers/ ./sdk/x.y.z/SdkResolvers/
./sdk/x.y.z/SdkResolvers/Microsoft.Build.NuGetSdkResolver/ ./sdk/x.y.z/SdkResolvers/Microsoft.Build.NuGetSdkResolver/
@@ ------------ @@
./sdk/x.y.z/Sdks/FSharp.NET.Sdk/Sdk/Sdk.props
./sdk/x.y.z/Sdks/FSharp.NET.Sdk/Sdk/Sdk.targets
./sdk/x.y.z/Sdks/Microsoft.Docker.Sdk/
+./sdk/x.y.z/Sdks/Microsoft.Docker.Sdk/microsoft.docker.sdk.x.y.z.csproj
./sdk/x.y.z/Sdks/Microsoft.Docker.Sdk/Sdk/
./sdk/x.y.z/Sdks/Microsoft.Docker.Sdk/Sdk/Sdk.props
./sdk/x.y.z/Sdks/Microsoft.Docker.Sdk/Sdk/Sdk.targets
@@ ------------ @@ @@ ------------ @@
./sdk/x.y.z/Sdks/Microsoft.NET.ILLink.Tasks/tools/net472/System.Buffers.dll ./sdk/x.y.z/Sdks/Microsoft.NET.ILLink.Tasks/tools/net472/System.Buffers.dll
./sdk/x.y.z/Sdks/Microsoft.NET.ILLink.Tasks/tools/net472/System.Collections.Immutable.dll ./sdk/x.y.z/Sdks/Microsoft.NET.ILLink.Tasks/tools/net472/System.Collections.Immutable.dll
@ -1478,4 +1470,4 @@ index ------------
+./shared/Microsoft.AspNetCore.App/x.y.z/System.Text.Json.dll +./shared/Microsoft.AspNetCore.App/x.y.z/System.Text.Json.dll
./shared/Microsoft.AspNetCore.App/x.y.z/THIRD-PARTY-NOTICES.txt ./shared/Microsoft.AspNetCore.App/x.y.z/THIRD-PARTY-NOTICES.txt
./shared/Microsoft.NETCore.App/ ./shared/Microsoft.NETCore.App/
./shared/Microsoft.NETCore.App/x.y.z/ ./shared/Microsoft.NETCore.App/x.y.z/