Skip to content

Commit

Permalink
Ensure we test on TFMs that have unique RID-specific assets (#7470)
Browse files Browse the repository at this point in the history
  • Loading branch information
ericstj committed Jun 5, 2021
1 parent 4a02fbe commit 582981c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public override bool Execute()
foreach (var packagePath in PackagePaths)
{
Package package = NupkgParser.CreatePackageObject(packagePath);
List<NuGetFramework> packageTargetFrameworks = package.PackageAssets.Where(t => t.AssetType != AssetType.RuntimeAsset).Select(t => t.TargetFramework).Distinct().ToList();
List<NuGetFramework> packageTargetFrameworks = package.PackageAssets.Select(asset => asset.TargetFramework).Where(tfm => tfm != null).Distinct().ToList();

List<NuGetFramework> frameworksToTest = GetTestFrameworks(packageTargetFrameworks);
testProjects.AddRange(CreateItemFromTestFramework(package.PackageId, package.Version, frameworksToTest, GetRidsFromPackage(package)));
Expand Down
3 changes: 2 additions & 1 deletion src/Microsoft.DotNet.PackageTesting/NupkgParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ public static PackageAsset ExtractAssetFromFile(string filePath)
else if (filePath.StartsWith("runtimes"))
{
var stringParts = filePath.Split('/');
asset = new PackageAsset(NuGetFramework.Parse(stringParts[3]), stringParts[1], filePath, AssetType.RuntimeAsset);
NuGetFramework framework = stringParts.Length > 3 ? NuGetFramework.Parse(stringParts[3]) : null;
asset = new PackageAsset(framework, stringParts[1], filePath, AssetType.RuntimeAsset);
}

return asset;
Expand Down

0 comments on commit 582981c

Please sign in to comment.