Update poison baseline. (#14345)

* Update poison baseline.

* Fix RIDs by replacing with placeholders.

* Exclude a few more non-binary file types from poison checking.

* Ignore empty files when checking for poison.

* Update baseline with new exclusions.

* Poison report can have both portable and non-portable RIDs in it, remove both.
This commit is contained in:
Chris Rummel 2022-08-22 22:40:20 -05:00 committed by GitHub
parent b3b7f58e8a
commit 58d9018a7b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 694 additions and 602 deletions

View file

@ -24,6 +24,7 @@ namespace Microsoft.DotNet.SourceBuild.SmokeTests
string currentPoisonReport = File.ReadAllText(Config.PoisonReportPath);
currentPoisonReport = RemoveHashes(currentPoisonReport);
currentPoisonReport = BaselineHelper.RemoveRids(currentPoisonReport);
currentPoisonReport = BaselineHelper.RemoveRids(currentPoisonReport, true);
currentPoisonReport = BaselineHelper.RemoveVersions(currentPoisonReport);
BaselineHelper.CompareContents("PoisonUsage.txt", currentPoisonReport, OutputHelper, Config.WarnOnPoisonDiffs);

View file

@ -79,7 +79,6 @@ namespace Microsoft.DotNet.SourceBuild.Tasks.LeakDetection
"_._",
"-.-",
".bowerrc",
".editorconfig",
".gitignore",
".gitkeep",
".rels",
@ -97,9 +96,11 @@ namespace Microsoft.DotNet.SourceBuild.Tasks.LeakDetection
".csproj",
".css",
".db",
".editorconfig",
".eot",
".fs",
".fsproj",
".h",
".html",
".ico",
".js",
@ -107,18 +108,26 @@ namespace Microsoft.DotNet.SourceBuild.Tasks.LeakDetection
".map",
".md",
".nuspec",
".otf",
".png",
".props",
".proto",
".proj",
".psmdcp",
".pubxml",
".razor",
".rtf",
".scss",
".sln",
".svg",
".targets",
".transform",
".ts",
".ttf",
".txt",
".vb",
".vbproj",
".win32manifest",
".woff",
".woff2",
".xaml",
@ -209,7 +218,8 @@ namespace Microsoft.DotNet.SourceBuild.Tasks.LeakDetection
// skip some common files that get copied verbatim from nupkgs - LICENSE, _._, etc as well as
// file types that we never care about - text files, .gitconfig, etc.
if (FileNamesToSkip.Any(f => Path.GetFileName(fileToCheck).ToLowerInvariant() == f.ToLowerInvariant()) ||
FileExtensionsToSkip.Any(e => Path.GetExtension(fileToCheck).ToLowerInvariant() == e.ToLowerInvariant()))
FileExtensionsToSkip.Any(e => Path.GetExtension(fileToCheck).ToLowerInvariant() == e.ToLowerInvariant()) ||
(new FileInfo(fileToCheck).Length == 0))
{
return null;
}