Remove net TFMs from xml doc baseline (#13662)

This commit is contained in:
Michael Simons 2022-04-19 17:00:36 -05:00 committed by GitHub
parent e44e5907d6
commit 65dd7c1427
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 60 additions and 55 deletions

View file

@ -85,6 +85,13 @@ namespace Microsoft.DotNet.SourceBuild.SmokeTests
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) =>
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-]+)*))?");
string result = semanticVersionRegex.Replace(source, $"x.y.z");
// Remove netx.y path segments
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}");
return RemoveNetTfmPaths(result);
}
}
}

View file

@ -37,6 +37,7 @@ public class XmlDocTests : SmokeTests
string pathWithoutPacksPrefix = xmlFile[(targetingPacksDirectory.Length + 1)..];
string[] pathParts = pathWithoutPacksPrefix.Split(Path.DirectorySeparatorChar);
string pathWithoutVersion = string.Join(Path.DirectorySeparatorChar, pathParts.Take(1).Concat(pathParts.Skip(2)));
pathWithoutVersion = BaselineHelper.RemoveNetTfmPaths(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/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
Microsoft.NETCore.App.Ref/ref/netx.y/Microsoft.VisualBasic.xml
Microsoft.NETCore.App.Ref/ref/netx.y/mscorlib.xml
Microsoft.NETCore.App.Ref/ref/netx.y/System.AppContext.xml
Microsoft.NETCore.App.Ref/ref/netx.y/System.Buffers.xml
Microsoft.NETCore.App.Ref/ref/netx.y/System.ComponentModel.DataAnnotations.xml
Microsoft.NETCore.App.Ref/ref/netx.y/System.Configuration.xml
Microsoft.NETCore.App.Ref/ref/netx.y/System.Core.xml
Microsoft.NETCore.App.Ref/ref/netx.y/System.Data.DataSetExtensions.xml
Microsoft.NETCore.App.Ref/ref/netx.y/System.Data.xml
Microsoft.NETCore.App.Ref/ref/netx.y/System.Diagnostics.Debug.xml
Microsoft.NETCore.App.Ref/ref/netx.y/System.Diagnostics.Tools.xml
Microsoft.NETCore.App.Ref/ref/netx.y/System.Drawing.xml
Microsoft.NETCore.App.Ref/ref/netx.y/System.Dynamic.Runtime.xml
Microsoft.NETCore.App.Ref/ref/netx.y/System.Globalization.Calendars.xml
Microsoft.NETCore.App.Ref/ref/netx.y/System.Globalization.Extensions.xml
Microsoft.NETCore.App.Ref/ref/netx.y/System.Globalization.xml
Microsoft.NETCore.App.Ref/ref/netx.y/System.IO.Compression.Brotli.xml
Microsoft.NETCore.App.Ref/ref/netx.y/System.IO.Compression.FileSystem.xml
Microsoft.NETCore.App.Ref/ref/netx.y/System.IO.FileSystem.Primitives.xml
Microsoft.NETCore.App.Ref/ref/netx.y/System.IO.FileSystem.xml
Microsoft.NETCore.App.Ref/ref/netx.y/System.IO.UnmanagedMemoryStream.xml
Microsoft.NETCore.App.Ref/ref/netx.y/System.IO.xml
Microsoft.NETCore.App.Ref/ref/netx.y/System.Net.xml
Microsoft.NETCore.App.Ref/ref/netx.y/System.Numerics.Vectors.xml
Microsoft.NETCore.App.Ref/ref/netx.y/System.Numerics.xml
Microsoft.NETCore.App.Ref/ref/netx.y/System.Reflection.Extensions.xml
Microsoft.NETCore.App.Ref/ref/netx.y/System.Reflection.xml
Microsoft.NETCore.App.Ref/ref/netx.y/System.Resources.Reader.xml
Microsoft.NETCore.App.Ref/ref/netx.y/System.Resources.ResourceManager.xml
Microsoft.NETCore.App.Ref/ref/netx.y/System.Runtime.Extensions.xml
Microsoft.NETCore.App.Ref/ref/netx.y/System.Runtime.Handles.xml
Microsoft.NETCore.App.Ref/ref/netx.y/System.Runtime.Serialization.xml
Microsoft.NETCore.App.Ref/ref/netx.y/System.Security.Principal.xml
Microsoft.NETCore.App.Ref/ref/netx.y/System.Security.SecureString.xml
Microsoft.NETCore.App.Ref/ref/netx.y/System.Security.xml
Microsoft.NETCore.App.Ref/ref/netx.y/System.ServiceModel.Web.xml
Microsoft.NETCore.App.Ref/ref/netx.y/System.ServiceProcess.xml
Microsoft.NETCore.App.Ref/ref/netx.y/System.Text.Encoding.xml
Microsoft.NETCore.App.Ref/ref/netx.y/System.Threading.Tasks.Extensions.xml
Microsoft.NETCore.App.Ref/ref/netx.y/System.Threading.Tasks.xml
Microsoft.NETCore.App.Ref/ref/netx.y/System.Threading.Timer.xml
Microsoft.NETCore.App.Ref/ref/netx.y/System.Transactions.xml
Microsoft.NETCore.App.Ref/ref/netx.y/System.ValueTuple.xml
Microsoft.NETCore.App.Ref/ref/netx.y/System.Web.xml
Microsoft.NETCore.App.Ref/ref/netx.y/System.Windows.xml
Microsoft.NETCore.App.Ref/ref/netx.y/System.xml
Microsoft.NETCore.App.Ref/ref/netx.y/System.Xml.Linq.xml
Microsoft.NETCore.App.Ref/ref/netx.y/System.Xml.Serialization.xml
Microsoft.NETCore.App.Ref/ref/netx.y/System.Xml.xml
Microsoft.NETCore.App.Ref/ref/netx.y/System.Xml.XmlDocument.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/mscorlib.xml
NETStandard.Library.Ref/ref/netstandard2.1/System.AppContext.xml