From 0dec52840014f11f0b9747709976f271cc3666ea Mon Sep 17 00:00:00 2001 From: Michael Simons Date: Fri, 21 Jan 2022 07:59:36 -0600 Subject: [PATCH] Implement beginnings of C# based tests (#13052) * Implement beginnings of C# based tests * Convert xml dox tests * Updates per code review * Fixup of previous commit * Edits per code review * Refactor testRunTitle to make distinguishable between build legs --- .../steps/source-build-build-tarball.yml | 14 +- src/SourceBuild/tarball/content/build.proj | 21 +- .../content/test/Directory.Build.props | 7 + .../content/test/Directory.Build.targets | 7 + .../BaselineHelper.cs | 37 +++ .../Config.cs | 15 + .../DotNetHelper.cs | 41 +++ .../ExecuteHelper.cs | 55 ++++ ...osoft.DotNet.SourceBuild.SmokeTests.csproj | 28 ++ .../SmokeTests.cs | 37 +++ .../XmlDocTests.cs | 54 ++++ .../baselines/MissingXmlDoc.txt | 175 ++++++++++++ .../smoke-tests}/smoke-test.sh | 256 +----------------- .../smoke-tests}/smoke-testNuGet.Config | 0 14 files changed, 484 insertions(+), 263 deletions(-) create mode 100644 src/SourceBuild/tarball/content/test/Directory.Build.props create mode 100644 src/SourceBuild/tarball/content/test/Directory.Build.targets create mode 100644 src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/BaselineHelper.cs create mode 100644 src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/Config.cs create mode 100644 src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/DotNetHelper.cs create mode 100644 src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/ExecuteHelper.cs create mode 100644 src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/Microsoft.DotNet.SourceBuild.SmokeTests.csproj create mode 100644 src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/SmokeTests.cs create mode 100644 src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/XmlDocTests.cs create mode 100644 src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/baselines/MissingXmlDoc.txt rename src/SourceBuild/tarball/content/{ => test/Microsoft.DotNet.SourceBuild.SmokeTests/smoke-tests}/smoke-test.sh (66%) rename src/SourceBuild/tarball/content/{ => test/Microsoft.DotNet.SourceBuild.SmokeTests/smoke-tests}/smoke-testNuGet.Config (100%) diff --git a/src/SourceBuild/Arcade/eng/common/templates/steps/source-build-build-tarball.yml b/src/SourceBuild/Arcade/eng/common/templates/steps/source-build-build-tarball.yml index 2891bdc13..981fe31e3 100644 --- a/src/SourceBuild/Arcade/eng/common/templates/steps/source-build-build-tarball.yml +++ b/src/SourceBuild/Arcade/eng/common/templates/steps/source-build-build-tarball.yml @@ -82,7 +82,7 @@ steps: find artifacts/prebuilt-report/ -exec cp {} --parents -t ${targetFolder} \; find src/ -type f -name "*.binlog" -exec cp {} --parents -t ${targetFolder} \; find src/ -type f -name "*.log" -exec cp {} --parents -t ${targetFolder} \; - find testing-smoke/logs -exec cp {} --parents -t ${targetFolder} \; + find test/*/*/*/*/*/testing-smoke/logs -exec cp {} --parents -t ${targetFolder} \; displayName: Prepare BuildLogs staging directory continueOnError: true condition: succeededOrFailed() @@ -93,6 +93,18 @@ steps: continueOnError: true condition: succeededOrFailed() + - task: PublishTestResults@2 + displayName: Publish Test Results + condition: succeededOrFailed() + continueOnError: true + inputs: + testRunner: vSTest + testResultsFiles: 'test/**/*.trx' + searchFolder: ${{ parameters.tarballDir }} + mergeTestResults: true + publishRunAttachments: true + testRunTitle: SourceBuild_SmokeTests_$(Agent.JobName) + - publish: '${{ parameters.tarballDir }}/artifacts/${{ parameters.buildArch}}/Release/' artifact: $(Agent.JobName)_Artifacts displayName: Publish Artifacts diff --git a/src/SourceBuild/tarball/content/build.proj b/src/SourceBuild/tarball/content/build.proj index 3a43b32ab..1b5adfdc5 100644 --- a/src/SourceBuild/tarball/content/build.proj +++ b/src/SourceBuild/tarball/content/build.proj @@ -14,7 +14,7 @@ - + @@ -91,20 +91,19 @@ - - ./smoke-test.sh - $(SmokeTestCommand) --minimal - $(SmokeTestCommand) --projectOutput - $(SmokeTestCommand) --configuration $(Configuration) - $(SmokeTestCommand) --archiveRestoredPackages + + + - - $(SmokeTestCommand) --excludeWebHttpsTests + + %(SdkTarballItem.Identity) - + DOTNET_TARBALL_PATH=$(SdkTarballPath); + TARGET_RID=$(TargetRid); + " /> diff --git a/src/SourceBuild/tarball/content/test/Directory.Build.props b/src/SourceBuild/tarball/content/test/Directory.Build.props new file mode 100644 index 000000000..5bec34ce2 --- /dev/null +++ b/src/SourceBuild/tarball/content/test/Directory.Build.props @@ -0,0 +1,7 @@ + + + + + diff --git a/src/SourceBuild/tarball/content/test/Directory.Build.targets b/src/SourceBuild/tarball/content/test/Directory.Build.targets new file mode 100644 index 000000000..5bec34ce2 --- /dev/null +++ b/src/SourceBuild/tarball/content/test/Directory.Build.targets @@ -0,0 +1,7 @@ + + + + + diff --git a/src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/BaselineHelper.cs b/src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/BaselineHelper.cs new file mode 100644 index 000000000..73c2951f7 --- /dev/null +++ b/src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/BaselineHelper.cs @@ -0,0 +1,37 @@ +// 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.Collections.Generic; +using System.IO; +using System.Linq; +using Xunit; + +namespace Microsoft.DotNet.SourceBuild.SmokeTests +{ + internal class BaselineHelper + { + public static void Compare(string baselineFileName, IOrderedEnumerable actualEntries) + { + IEnumerable baseline = File.ReadAllLines(GetBaselineFilePath(baselineFileName)); + string[] missingEntries = actualEntries.Except(baseline).ToArray(); + string[] extraEntries = baseline.Except(actualEntries).ToArray(); + + string? message = null; + if (missingEntries.Length > 0) + { + message = $"Missing entries in '{baselineFileName}' baseline: {Environment.NewLine}{string.Join(Environment.NewLine, missingEntries)}{Environment.NewLine}{Environment.NewLine}"; + } + + if (extraEntries.Length > 0) + { + message += $"Extra entries in '{baselineFileName}' baseline: {Environment.NewLine}{string.Join(Environment.NewLine, extraEntries)}{Environment.NewLine}{Environment.NewLine}"; + } + + Assert.Null(message); + } + + private static string GetBaselineFilePath(string baselineFileName) => Path.Combine(Directory.GetCurrentDirectory(), "baselines", baselineFileName); + } +} diff --git a/src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/Config.cs b/src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/Config.cs new file mode 100644 index 000000000..3dfc38f69 --- /dev/null +++ b/src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/Config.cs @@ -0,0 +1,15 @@ +// 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; + +namespace Microsoft.DotNet.SourceBuild.SmokeTests; + +internal static class Config +{ + public static string DotNetDirectory { get; } = Environment.GetEnvironmentVariable("DOTNET_DIR") ?? "./.dotnet"; + public static string DotNetTarballPath { get; } = Environment.GetEnvironmentVariable(DotNetTarballPathEnv) ?? string.Empty; + public const string DotNetTarballPathEnv = "DOTNET_TARBALL_PATH"; + public static string TargetRid { get; } = Environment.GetEnvironmentVariable("TARGET_RID") ?? string.Empty; +} diff --git a/src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/DotNetHelper.cs b/src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/DotNetHelper.cs new file mode 100644 index 000000000..5a6716030 --- /dev/null +++ b/src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/DotNetHelper.cs @@ -0,0 +1,41 @@ +// 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.Diagnostics; +using System.IO; +using Xunit; +using Xunit.Abstractions; + +namespace Microsoft.DotNet.SourceBuild.SmokeTests; + +internal class DotNetHelper +{ + public string DotNetPath { get; } + public string DotNetInstallDirectory { get; } + + public DotNetHelper(ITestOutputHelper outputHelper) + { + if (!Directory.Exists(Config.DotNetDirectory)) + { + if (!File.Exists(Config.DotNetTarballPath)) + { + throw new InvalidOperationException($"Tarball path '{Config.DotNetTarballPath}' specified in {Config.DotNetTarballPathEnv} does not exist."); + } + + Directory.CreateDirectory(Config.DotNetDirectory); + ExecuteHelper.ExecuteProcess("tar", $"xzf {Config.DotNetTarballPath} -C {Config.DotNetDirectory}", outputHelper); + } + + DotNetInstallDirectory = Path.Combine(Directory.GetCurrentDirectory(), Config.DotNetDirectory); + DotNetPath = Path.Combine(DotNetInstallDirectory, "dotnet"); + } + + public void ExecuteDotNetCmd(string args, ITestOutputHelper outputHelper) + { + (Process Process, string StdOut, string StdErr) executeResult = ExecuteHelper.ExecuteProcess(DotNetPath, args, outputHelper); + + Assert.Equal(0, executeResult.Process.ExitCode); + } +} diff --git a/src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/ExecuteHelper.cs b/src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/ExecuteHelper.cs new file mode 100644 index 000000000..35c6dc7a7 --- /dev/null +++ b/src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/ExecuteHelper.cs @@ -0,0 +1,55 @@ +// 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 System.Text; +using Xunit.Abstractions; + +namespace Microsoft.DotNet.SourceBuild.SmokeTests; + +internal static class ExecuteHelper +{ + public static (Process Process, string StdOut, string StdErr) ExecuteProcess( + string fileName, string args, ITestOutputHelper outputHelper) + { + outputHelper.WriteLine($"Executing: {fileName} {args}"); + + Process process = new() + { + EnableRaisingEvents = true, + StartInfo = + { + FileName = fileName, + Arguments = args, + RedirectStandardOutput = true, + RedirectStandardError = true, + } + }; + + StringBuilder stdOutput = new(); + process.OutputDataReceived += new DataReceivedEventHandler((sender, e) => stdOutput.AppendLine(e.Data)); + + StringBuilder stdError = new(); + process.ErrorDataReceived += new DataReceivedEventHandler((sender, e) => stdError.AppendLine(e.Data)); + + process.Start(); + process.BeginOutputReadLine(); + process.BeginErrorReadLine(); + process.WaitForExit(); + + string output = stdOutput.ToString().Trim(); + if (outputHelper != null && !string.IsNullOrWhiteSpace(output)) + { + outputHelper.WriteLine(output); + } + + string error = stdError.ToString().Trim(); + if (outputHelper != null && !string.IsNullOrWhiteSpace(error)) + { + outputHelper.WriteLine(error); + } + + return (process, output, error); + } +} diff --git a/src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/Microsoft.DotNet.SourceBuild.SmokeTests.csproj b/src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/Microsoft.DotNet.SourceBuild.SmokeTests.csproj new file mode 100644 index 000000000..54d87df9d --- /dev/null +++ b/src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/Microsoft.DotNet.SourceBuild.SmokeTests.csproj @@ -0,0 +1,28 @@ + + + + net6.0 + enable + + false + true + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + PreserveNewest + + + PreserveNewest + + + diff --git a/src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/SmokeTests.cs b/src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/SmokeTests.cs new file mode 100644 index 000000000..869e97276 --- /dev/null +++ b/src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/SmokeTests.cs @@ -0,0 +1,37 @@ +// 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 System.IO; +using Xunit; +using Xunit.Abstractions; + +namespace Microsoft.DotNet.SourceBuild.SmokeTests; + +// This test suite invokes the smoke-test.sh which should be considered legacy. Those tests should be migrated to this test suite overtime. +public class SmokeTests +{ + private ITestOutputHelper OutputHelper { get; } + private DotNetHelper DotNetHelper { get; } + + public SmokeTests(ITestOutputHelper outputHelper) + { + OutputHelper = outputHelper; + DotNetHelper = new DotNetHelper(outputHelper); + } + + [Fact] + public void SmokeTestsScript() + { + string smokeTestArgs = $"--dotnetDir {Directory.GetParent(DotNetHelper.DotNetPath)} --minimal --projectOutput --archiveRestoredPackages --targetRid {Config.TargetRid}"; + if (Config.TargetRid.Contains("osx")) + { + smokeTestArgs += " --excludeWebHttpsTests"; + } + + (Process Process, string StdOut, string StdErr) executeResult = ExecuteHelper.ExecuteProcess("./smoke-tests/smoke-test.sh", smokeTestArgs, OutputHelper); + + Assert.Equal(0, executeResult.Process.ExitCode); + } +} diff --git a/src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/XmlDocTests.cs b/src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/XmlDocTests.cs new file mode 100644 index 000000000..dd4cadf70 --- /dev/null +++ b/src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/XmlDocTests.cs @@ -0,0 +1,54 @@ +// 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.Collections.Generic; +using System.IO; +using Xunit; +using Xunit.Abstractions; +using System; +using System.Linq; + +namespace Microsoft.DotNet.SourceBuild.SmokeTests; + +public class XmlDocTests +{ + private ITestOutputHelper OutputHelper { get; } + private DotNetHelper DotNetHelper { get; } + + public XmlDocTests(ITestOutputHelper outputHelper) + { + OutputHelper = outputHelper; + DotNetHelper = new DotNetHelper(outputHelper); + } + + /// + /// Verifies every targeting pack assembly has a xml doc file. + /// There are exceptions which are specified in baselines/XmlDocIgnore.*.txt. + /// + [Fact] + public void VerifyTargetingPacksHaveDoc() + { + List missingXmlDoc = new(); + + string targetingPacksDirectory = Path.Combine(DotNetHelper.DotNetInstallDirectory, "packs"); + foreach (string targetingPackAssembly in Directory.EnumerateFiles(targetingPacksDirectory, "*.dll", SearchOption.AllDirectories)) + { + if (targetingPackAssembly.EndsWith("resources.dll")) + { + continue; + } + + string xmlFile = Path.ChangeExtension(targetingPackAssembly, ".xml"); + if (!File.Exists(xmlFile)) + { + string pathWithoutPacksPrefix = xmlFile.Substring(targetingPacksDirectory.Length + 1); + String[] pathParts = pathWithoutPacksPrefix.Split(Path.DirectorySeparatorChar); + string pathWithoutVersion = string.Join(Path.DirectorySeparatorChar, pathParts.Take(1).Concat(pathParts.Skip(2))); + missingXmlDoc.Add(pathWithoutVersion); + } + } + + BaselineHelper.Compare("MissingXmlDoc.txt", missingXmlDoc.OrderBy(entry => entry)); + } +} diff --git a/src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/baselines/MissingXmlDoc.txt b/src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/baselines/MissingXmlDoc.txt new file mode 100644 index 000000000..8db91d9d7 --- /dev/null +++ b/src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/baselines/MissingXmlDoc.txt @@ -0,0 +1,175 @@ +Microsoft.AspNetCore.App.Ref/analyzers/dotnet/cs/Microsoft.AspNetCore.App.Analyzers.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.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/net6.0/mscorlib.xml +Microsoft.NETCore.App.Ref/ref/net6.0/System.AppContext.xml +Microsoft.NETCore.App.Ref/ref/net6.0/System.Buffers.xml +Microsoft.NETCore.App.Ref/ref/net6.0/System.ComponentModel.DataAnnotations.xml +Microsoft.NETCore.App.Ref/ref/net6.0/System.Configuration.xml +Microsoft.NETCore.App.Ref/ref/net6.0/System.Core.xml +Microsoft.NETCore.App.Ref/ref/net6.0/System.Data.DataSetExtensions.xml +Microsoft.NETCore.App.Ref/ref/net6.0/System.Data.xml +Microsoft.NETCore.App.Ref/ref/net6.0/System.Diagnostics.Debug.xml +Microsoft.NETCore.App.Ref/ref/net6.0/System.Diagnostics.Tools.xml +Microsoft.NETCore.App.Ref/ref/net6.0/System.Drawing.xml +Microsoft.NETCore.App.Ref/ref/net6.0/System.Dynamic.Runtime.xml +Microsoft.NETCore.App.Ref/ref/net6.0/System.Globalization.Calendars.xml +Microsoft.NETCore.App.Ref/ref/net6.0/System.Globalization.Extensions.xml +Microsoft.NETCore.App.Ref/ref/net6.0/System.Globalization.xml +Microsoft.NETCore.App.Ref/ref/net6.0/System.IO.Compression.Brotli.xml +Microsoft.NETCore.App.Ref/ref/net6.0/System.IO.Compression.FileSystem.xml +Microsoft.NETCore.App.Ref/ref/net6.0/System.IO.FileSystem.Primitives.xml +Microsoft.NETCore.App.Ref/ref/net6.0/System.IO.FileSystem.xml +Microsoft.NETCore.App.Ref/ref/net6.0/System.IO.UnmanagedMemoryStream.xml +Microsoft.NETCore.App.Ref/ref/net6.0/System.IO.xml +Microsoft.NETCore.App.Ref/ref/net6.0/System.Net.xml +Microsoft.NETCore.App.Ref/ref/net6.0/System.Numerics.Vectors.xml +Microsoft.NETCore.App.Ref/ref/net6.0/System.Numerics.xml +Microsoft.NETCore.App.Ref/ref/net6.0/System.Reflection.Extensions.xml +Microsoft.NETCore.App.Ref/ref/net6.0/System.Reflection.xml +Microsoft.NETCore.App.Ref/ref/net6.0/System.Resources.Reader.xml +Microsoft.NETCore.App.Ref/ref/net6.0/System.Resources.ResourceManager.xml +Microsoft.NETCore.App.Ref/ref/net6.0/System.Runtime.Extensions.xml +Microsoft.NETCore.App.Ref/ref/net6.0/System.Runtime.Handles.xml +Microsoft.NETCore.App.Ref/ref/net6.0/System.Runtime.Serialization.xml +Microsoft.NETCore.App.Ref/ref/net6.0/System.Security.Principal.xml +Microsoft.NETCore.App.Ref/ref/net6.0/System.Security.SecureString.xml +Microsoft.NETCore.App.Ref/ref/net6.0/System.Security.xml +Microsoft.NETCore.App.Ref/ref/net6.0/System.ServiceModel.Web.xml +Microsoft.NETCore.App.Ref/ref/net6.0/System.ServiceProcess.xml +Microsoft.NETCore.App.Ref/ref/net6.0/System.Text.Encoding.xml +Microsoft.NETCore.App.Ref/ref/net6.0/System.Threading.Tasks.Extensions.xml +Microsoft.NETCore.App.Ref/ref/net6.0/System.Threading.Tasks.xml +Microsoft.NETCore.App.Ref/ref/net6.0/System.Threading.Timer.xml +Microsoft.NETCore.App.Ref/ref/net6.0/System.Transactions.xml +Microsoft.NETCore.App.Ref/ref/net6.0/System.ValueTuple.xml +Microsoft.NETCore.App.Ref/ref/net6.0/System.Web.xml +Microsoft.NETCore.App.Ref/ref/net6.0/System.Windows.xml +Microsoft.NETCore.App.Ref/ref/net6.0/System.xml +Microsoft.NETCore.App.Ref/ref/net6.0/System.Xml.Linq.xml +Microsoft.NETCore.App.Ref/ref/net6.0/System.Xml.Serialization.xml +Microsoft.NETCore.App.Ref/ref/net6.0/System.Xml.xml +Microsoft.NETCore.App.Ref/ref/net6.0/System.Xml.XmlDocument.xml +Microsoft.NETCore.App.Ref/ref/net6.0/WindowsBase.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/System.AppContext.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Buffers.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Collections.Concurrent.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Collections.NonGeneric.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Collections.Specialized.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Collections.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.ComponentModel.Composition.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.ComponentModel.EventBasedAsync.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.ComponentModel.Primitives.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.ComponentModel.TypeConverter.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.ComponentModel.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Console.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Core.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Data.Common.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Data.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Diagnostics.Contracts.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Diagnostics.Debug.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Diagnostics.FileVersionInfo.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Diagnostics.Process.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Diagnostics.StackTrace.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Diagnostics.TextWriterTraceListener.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Diagnostics.Tools.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Diagnostics.TraceSource.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Diagnostics.Tracing.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Drawing.Primitives.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Drawing.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Dynamic.Runtime.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Globalization.Calendars.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Globalization.Extensions.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Globalization.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.IO.Compression.FileSystem.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.IO.Compression.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.IO.Compression.ZipFile.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.IO.FileSystem.DriveInfo.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.IO.FileSystem.Primitives.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.IO.FileSystem.Watcher.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.IO.FileSystem.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.IO.IsolatedStorage.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.IO.MemoryMappedFiles.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.IO.Pipes.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.IO.UnmanagedMemoryStream.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.IO.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Linq.Expressions.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Linq.Parallel.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Linq.Queryable.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Linq.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Memory.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Net.Http.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Net.NameResolution.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Net.NetworkInformation.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Net.Ping.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Net.Primitives.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Net.Requests.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Net.Security.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Net.Sockets.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Net.WebHeaderCollection.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Net.WebSockets.Client.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Net.WebSockets.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Net.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Numerics.Vectors.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Numerics.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.ObjectModel.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Reflection.DispatchProxy.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Reflection.Emit.ILGeneration.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Reflection.Emit.Lightweight.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Reflection.Emit.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Reflection.Extensions.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Reflection.Primitives.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Reflection.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Resources.Reader.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Resources.ResourceManager.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Resources.Writer.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Runtime.CompilerServices.VisualC.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Runtime.Extensions.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Runtime.Handles.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Runtime.InteropServices.RuntimeInformation.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Runtime.InteropServices.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Runtime.Numerics.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Runtime.Serialization.Formatters.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Runtime.Serialization.Json.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Runtime.Serialization.Primitives.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Runtime.Serialization.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Runtime.Serialization.Xml.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Runtime.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Security.Claims.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Security.Cryptography.Algorithms.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Security.Cryptography.Csp.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Security.Cryptography.Encoding.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Security.Cryptography.Primitives.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Security.Cryptography.X509Certificates.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Security.Principal.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Security.SecureString.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.ServiceModel.Web.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Text.Encoding.Extensions.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Text.Encoding.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Text.RegularExpressions.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Threading.Overlapped.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Threading.Tasks.Extensions.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Threading.Tasks.Parallel.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Threading.Tasks.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Threading.Thread.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Threading.ThreadPool.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Threading.Timer.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Threading.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Transactions.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.ValueTuple.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Web.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Windows.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Xml.Linq.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Xml.ReaderWriter.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Xml.Serialization.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Xml.XDocument.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Xml.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Xml.XmlDocument.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Xml.XmlSerializer.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Xml.XPath.XDocument.xml +NETStandard.Library.Ref/ref/netstandard2.1/System.Xml.XPath.xml diff --git a/src/SourceBuild/tarball/content/smoke-test.sh b/src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/smoke-tests/smoke-test.sh similarity index 66% rename from src/SourceBuild/tarball/content/smoke-test.sh rename to src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/smoke-tests/smoke-test.sh index a1c43673d..ccd15fd27 100755 --- a/src/SourceBuild/tarball/content/smoke-test.sh +++ b/src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/smoke-tests/smoke-test.sh @@ -7,7 +7,8 @@ VERSION_PREFIX=6.0 # See https://github.com/dotnet/source-build/issues/579, this version # needs to be compatible with the runtime produced from source-build DEV_CERTS_VERSION_DEFAULT=6.0.0-preview.6.21355.2 -__ROOT_REPO=$(sed 's/\r$//' "$SCRIPT_ROOT/artifacts/obj/rootrepo.txt") # remove CR if mounted repo on Windows drive +ARTIFACTS_DIR="$SCRIPT_ROOT/../../../../../../artifacts/" +__ROOT_REPO=$(sed 's/\r$//' "${ARTIFACTS_DIR}obj/rootrepo.txt") # remove CR if mounted repo on Windows drive executingUserHome=${HOME:-} export DOTNET_CLI_TELEMETRY_OPTOUT=1 @@ -362,247 +363,6 @@ function runWebTests() { doCommand F# webapi "$@" new restore build run multi-rid-publish } -function runXmlDocTests() { - targetingPacksDir="$dotnetDir/packs/" - echo "Looking for xml docs in targeting packs in $targetingPacksDir" - - netstandardIgnoreList=( - Microsoft.Win32.Primitives.xml - mscorlib.xml - System.AppContext.xml - System.Buffers.xml - System.Collections.Concurrent.xml - System.Collections.NonGeneric.xml - System.Collections.Specialized.xml - System.Collections.xml - System.ComponentModel.Composition.xml - System.ComponentModel.EventBasedAsync.xml - System.ComponentModel.Primitives.xml - System.ComponentModel.TypeConverter.xml - System.ComponentModel.xml - System.Console.xml - System.Core.xml - System.Data.Common.xml - System.Data.xml - System.Diagnostics.Contracts.xml - System.Diagnostics.Debug.xml - System.Diagnostics.FileVersionInfo.xml - System.Diagnostics.Process.xml - System.Diagnostics.StackTrace.xml - System.Diagnostics.TextWriterTraceListener.xml - System.Diagnostics.Tools.xml - System.Diagnostics.TraceSource.xml - System.Diagnostics.Tracing.xml - System.Drawing.Primitives.xml - System.Drawing.xml - System.Dynamic.Runtime.xml - System.Globalization.Calendars.xml - System.Globalization.Extensions.xml - System.Globalization.xml - System.IO.Compression.FileSystem.xml - System.IO.Compression.xml - System.IO.Compression.ZipFile.xml - System.IO.FileSystem.DriveInfo.xml - System.IO.FileSystem.Primitives.xml - System.IO.FileSystem.Watcher.xml - System.IO.FileSystem.xml - System.IO.IsolatedStorage.xml - System.IO.MemoryMappedFiles.xml - System.IO.Pipes.xml - System.IO.UnmanagedMemoryStream.xml - System.IO.xml - System.Linq.Expressions.xml - System.Linq.Parallel.xml - System.Linq.Queryable.xml - System.Linq.xml - System.Memory.xml - System.Net.Http.xml - System.Net.NameResolution.xml - System.Net.NetworkInformation.xml - System.Net.Ping.xml - System.Net.Primitives.xml - System.Net.Requests.xml - System.Net.Security.xml - System.Net.Sockets.xml - System.Net.WebHeaderCollection.xml - System.Net.WebSockets.Client.xml - System.Net.WebSockets.xml - System.Net.xml - System.Numerics.Vectors.xml - System.Numerics.xml - System.ObjectModel.xml - System.Reflection.DispatchProxy.xml - System.Reflection.Emit.ILGeneration.xml - System.Reflection.Emit.Lightweight.xml - System.Reflection.Emit.xml - System.Reflection.Extensions.xml - System.Reflection.Primitives.xml - System.Reflection.xml - System.Resources.Reader.xml - System.Resources.ResourceManager.xml - System.Resources.Writer.xml - System.Runtime.CompilerServices.VisualC.xml - System.Runtime.Extensions.xml - System.Runtime.Handles.xml - System.Runtime.InteropServices.RuntimeInformation.xml - System.Runtime.InteropServices.xml - System.Runtime.Numerics.xml - System.Runtime.Serialization.Formatters.xml - System.Runtime.Serialization.Json.xml - System.Runtime.Serialization.Primitives.xml - System.Runtime.Serialization.xml - System.Runtime.Serialization.Xml.xml - System.Runtime.xml - System.Security.Claims.xml - System.Security.Cryptography.Algorithms.xml - System.Security.Cryptography.Csp.xml - System.Security.Cryptography.Encoding.xml - System.Security.Cryptography.Primitives.xml - System.Security.Cryptography.X509Certificates.xml - System.Security.Principal.xml - System.Security.SecureString.xml - System.ServiceModel.Web.xml - System.Text.Encoding.Extensions.xml - System.Text.Encoding.xml - System.Text.RegularExpressions.xml - System.Threading.Overlapped.xml - System.Threading.Tasks.Extensions.xml - System.Threading.Tasks.Parallel.xml - System.Threading.Tasks.xml - System.Threading.ThreadPool.xml - System.Threading.Thread.xml - System.Threading.Timer.xml - System.Threading.xml - System.Transactions.xml - System.ValueTuple.xml - System.Web.xml - System.Windows.xml - System.xml - System.Xml.Linq.xml - System.Xml.ReaderWriter.xml - System.Xml.Serialization.xml - System.Xml.XDocument.xml - System.Xml.xml - System.Xml.XmlDocument.xml - System.Xml.XmlSerializer.xml - System.Xml.XPath.XDocument.xml - System.Xml.XPath.xml - ) - - netcoreappIgnoreList=( - mscorlib.xml - Microsoft.VisualBasic.xml - System.AppContext.xml - System.Buffers.xml - System.ComponentModel.DataAnnotations.xml - System.Configuration.xml - System.Core.xml - System.Data.DataSetExtensions.xml - System.Data.xml - System.Diagnostics.Debug.xml - System.Diagnostics.Tools.xml - System.Drawing.xml - System.Dynamic.Runtime.xml - System.Globalization.Calendars.xml - System.Globalization.Extensions.xml - System.Globalization.xml - System.IO.Compression.Brotli.xml - System.IO.Compression.FileSystem.xml - System.IO.FileSystem.xml - System.IO.FileSystem.Primitives.xml - System.IO.UnmanagedMemoryStream.xml - System.IO.xml - System.Net.xml - System.Numerics.xml - System.Numerics.Vectors.xml - System.Reflection.Extensions.xml - System.Reflection.xml - System.Resources.Reader.xml - System.Resources.ResourceManager.xml - System.Runtime.Extensions.xml - System.Runtime.Handles.xml - System.Runtime.Serialization.xml - System.Security.Principal.xml - System.Security.SecureString.xml - System.Security.xml - System.ServiceModel.Web.xml - System.ServiceProcess.xml - System.Text.Encoding.xml - System.Text.Json.SourceGeneration.resources.xml - System.Text.Json.SourceGeneration.xml - System.Threading.Tasks.Extensions.xml - System.Threading.Tasks.xml - System.Threading.Timer.xml - System.Transactions.xml - System.ValueTuple.xml - System.Web.xml - System.Windows.xml - System.xml - System.Xml.Linq.xml - System.Xml.Serialization.xml - System.Xml.xml - System.Xml.XmlDocument.xml - WindowsBase.xml - ) - - aspnetcoreappIgnoreList=( - Microsoft.AspNetCore.App.Analyzers.xml - Microsoft.AspNetCore.App.CodeFixes.xml - Microsoft.Extensions.Logging.Generators.resources.xml - Microsoft.Extensions.Logging.Generators.xml - ) - - error=0 - while IFS= read -r -d '' dllFile; do - xmlDocFile=${dllFile%.*}.xml - skip=0 - if [[ "$xmlDocFile" == *"/packs/Microsoft.NETCore.App.Ref"* ]]; then - xmlFileBasename=$(basename "$xmlDocFile") - for ignoreItem in "${netcoreappIgnoreList[@]}"; do - if [[ "$ignoreItem" == "$xmlFileBasename" ]]; then - skip=1; - break - fi - done - fi - if [[ "$xmlDocFile" == *"/packs/NETStandard.Library.Ref"* ]]; then - xmlFileBasename=$(basename "$xmlDocFile") - for ignoreItem in "${netstandardIgnoreList[@]}"; do - if [[ "$ignoreItem" == "$xmlFileBasename" ]]; then - skip=1; - break - fi - done - fi - if [[ "$xmlDocFile" == *"/packs/Microsoft.AspNetCore.App.Ref"* ]]; then - xmlFileBasename=$(basename "$xmlDocFile") - for ignoreItem in "${aspnetcoreappIgnoreList[@]}"; do - if [[ "$ignoreItem" == "$xmlFileBasename" ]]; then - skip=1; - break - fi - done - fi - if [[ $skip == 0 ]] && [[ ! -f "$xmlDocFile" ]]; then - error=1 - echo "error: missing $xmlDocFile" - fi - - if [[ $skip == 1 ]] && [[ -f "$xmlDocFile" ]]; then - error=1 - echo "error: Ignored xml doc was found: $xmlDocFile" - fi - - done < <(find "$targetingPacksDir" -name '*.dll' -print0) - - if [[ $error != 0 ]]; then - echo "error: Missing or unexpected xml documents" - exit 1 - else - echo "All expected xml docs are present" - fi -} - function runOmniSharpTests() { dotnetCmd=${dotnetDir}/dotnet @@ -701,11 +461,7 @@ fi # Clean up and create directory if [ -e "$testingDir" ]; then - read -p "testing-smoke directory exists, remove it? [Y]es / [n]o" -n 1 -r - echo - if [[ $REPLY == "" || $REPLY == " " || $REPLY =~ ^[Yy]$ ]]; then - rm -rf "$testingDir" - fi + rm -rf "$testingDir" fi mkdir -p "$testingDir" @@ -717,7 +473,7 @@ echo "" | tee Directory.Build.props > Directory.Build.targets # Unzip dotnet if the dotnetDir is not specified if [ "$dotnetDir" == "" ]; then - OUTPUT_DIR="$SCRIPT_ROOT/artifacts/$buildArch/$configuration/" + OUTPUT_DIR="$ARTIFACTS_DIR$buildArch/$configuration/" DOTNET_TARBALL="$(ls "${OUTPUT_DIR}${TARBALL_PREFIX}${VERSION_PREFIX}"*)" mkdir -p "$cliDir" @@ -734,7 +490,7 @@ echo SDK under test is: # setup restore path export NUGET_PACKAGES="$restoredPackagesDir" -SOURCE_BUILT_PKGS_PATH="$SCRIPT_ROOT/artifacts/obj/$buildArch/$configuration/blob-feed/packages/" +SOURCE_BUILT_PKGS_PATH="${ARTIFACTS_DIR}obj/$buildArch/$configuration/blob-feed/packages/" export DOTNET_ROOT="$dotnetDir" export PATH="$dotnetDir:$PATH" @@ -775,8 +531,6 @@ if [ "$excludeOnlineTests" == "false" ]; then echo "ONLINE RESTORE SOURCE - ALL TESTS PASSED!" fi -runXmlDocTests - if [ "$excludeOmniSharpTests" == "false" ]; then runOmniSharpTests fi diff --git a/src/SourceBuild/tarball/content/smoke-testNuGet.Config b/src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/smoke-tests/smoke-testNuGet.Config similarity index 100% rename from src/SourceBuild/tarball/content/smoke-testNuGet.Config rename to src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/smoke-tests/smoke-testNuGet.Config