Remove parsing for SBRP from SDK tarball, simplify return after regex match replace

This commit is contained in:
Ella Hathaway 2023-08-25 21:23:46 +00:00
parent de0b323118
commit 00b01acd87
2 changed files with 2 additions and 6 deletions

View file

@ -20,7 +20,6 @@ public class ArtifactsSizeTest : SmokeTests
{
private static readonly string BaselineFilePath = BaselineHelper.GetBaselineFilePath($"ArtifactsSizes/{Config.TargetRid}.txt");
private static readonly Dictionary<string, long> BaselineFileContent = new Dictionary<string, long>();
private static readonly Regex BuildVersionPattern = new(@"\b\d+\.\d+\.\d+[-@](alpha|preview|rc|rtm)\.\d(\.\d+\.\d+)?\b");
private const int SizeThresholdPercentage = 25;
@ -52,8 +51,7 @@ public class ArtifactsSizeTest : SmokeTests
.Where(entry => entry.EntryType == TarEntryType.RegularFile)
.Where(entry => !entry.Name.Contains("SourceBuildReferencePackages"));
IEnumerable<TarEntry> sdkTarEntries = Utilities.GetTarballContent(Config.SdkTarballPath)
.Where(entry => entry.EntryType == TarEntryType.RegularFile)
.Where(entry => !entry.Name.Contains("SourceBuildReferencePackages"));
.Where(entry => entry.EntryType == TarEntryType.RegularFile);
Dictionary<string, int> fileNameCountMap = new Dictionary<string, int>();
(string FilePath, long Bytes)[] tarEntries = sdkTarEntries.Concat(artifactsTarEntries)

View file

@ -116,9 +116,7 @@ namespace Microsoft.DotNet.SourceBuild.SmokeTests
$"(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)"
+ $"(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))"
+ $"?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?");
result = semanticVersionRegex.Replace(result, VersionPlaceholder);
return result;
return semanticVersionRegex.Replace(result, VersionPlaceholder);
}
/// <summary>