From f3a8630abf70704c3eac5a122ed77690fade922c Mon Sep 17 00:00:00 2001 From: Daniel Plaisted Date: Fri, 1 Mar 2024 12:11:44 -0500 Subject: [PATCH 1/3] Use unique names for aliasing test packages Attempting to fix CI failures for these tests --- .../GivenThatWeHaveAPackageReferenceWithAliases.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/Microsoft.NET.Build.Tests/GivenThatWeHaveAPackageReferenceWithAliases.cs b/test/Microsoft.NET.Build.Tests/GivenThatWeHaveAPackageReferenceWithAliases.cs index 474bab3ad652..024f2eeb2f9f 100644 --- a/test/Microsoft.NET.Build.Tests/GivenThatWeHaveAPackageReferenceWithAliases.cs +++ b/test/Microsoft.NET.Build.Tests/GivenThatWeHaveAPackageReferenceWithAliases.cs @@ -15,7 +15,7 @@ public GivenThatWeHaveAPackageReferenceWithAliases(ITestOutputHelper log) : base public void CanBuildProjectWithPackageReferencesWithConflictingTypes() { var targetFramework = ToolsetInfo.CurrentTargetFramework; - var packageReferences = GetPackageReferencesWithConflictingTypes(targetFramework, packageNames: new string[] { "A", "B" }); + var packageReferences = GetPackageReferencesWithConflictingTypes(targetFramework, packageNames: new string[] { "ConflictingA", "ConflictingB" }); TestProject testProject = new() { @@ -49,7 +49,7 @@ public void CanBuildProjectWithPackageReferencesWithConflictingTypes() .Pass(); } - [RequiresMSBuildVersionFact("16.8.0", Skip = "https://github.com/dotnet/sdk/issues/38268")] + [RequiresMSBuildVersionFact("16.8.0")] public void CanBuildProjectWithMultiplePackageReferencesWithAliases() { var targetFramework = ToolsetInfo.CurrentTargetFramework; @@ -98,7 +98,7 @@ public void CanBuildProjectWithAPackageReferenceWithMultipleAliases() { var targetFramework = ToolsetInfo.CurrentTargetFramework; - var packageReferenceA = GetPackageReference(targetFramework, "A", ClassLibMultipleClasses); + var packageReferenceA = GetPackageReference(targetFramework, "MultipleClasses", ClassLibMultipleClasses); TestProject testProject = new() { From 7d1cdbab74f79b61071fe909e3150847ad07dce1 Mon Sep 17 00:00:00 2001 From: Daniel Plaisted Date: Fri, 1 Mar 2024 14:12:36 -0500 Subject: [PATCH 2/3] Try to gather binlogs from tests --- eng/build.yml | 3 +++ ...GivenThatWeHaveAPackageReferenceWithAliases.cs | 15 +++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/eng/build.yml b/eng/build.yml index d13162be43e3..0d492b54db74 100644 --- a/eng/build.yml +++ b/eng/build.yml @@ -190,6 +190,7 @@ jobs: log/$(_BuildConfig)/**/* TestResults/$(_BuildConfig)/**/* SymStore/$(_BuildConfig)/**/* + tmp/$(_BuildConfig)/**/*.binlog TargetFolder: '$(Build.ArtifactStagingDirectory)' continueOnError: true condition: always() @@ -321,6 +322,7 @@ jobs: log/$(_BuildConfig)/**/* TestResults/$(_BuildConfig)/**/* SymStore/$(_BuildConfig)/**/* + tmp/$(_BuildConfig)/**/*.binlog TargetFolder: '$(Build.ArtifactStagingDirectory)' continueOnError: true condition: always() @@ -463,6 +465,7 @@ jobs: log/$(_BuildConfig)/**/* TestResults/$(_BuildConfig)/**/* SymStore/$(_BuildConfig)/**/* + tmp/$(_BuildConfig)/**/*.binlog TargetFolder: '$(Build.ArtifactStagingDirectory)' continueOnError: true condition: always() diff --git a/test/Microsoft.NET.Build.Tests/GivenThatWeHaveAPackageReferenceWithAliases.cs b/test/Microsoft.NET.Build.Tests/GivenThatWeHaveAPackageReferenceWithAliases.cs index 024f2eeb2f9f..5187a63841a7 100644 --- a/test/Microsoft.NET.Build.Tests/GivenThatWeHaveAPackageReferenceWithAliases.cs +++ b/test/Microsoft.NET.Build.Tests/GivenThatWeHaveAPackageReferenceWithAliases.cs @@ -43,8 +43,9 @@ public void CanBuildProjectWithPackageReferencesWithConflictingTypes() sources.AddRange(packagesPaths); NuGetConfigWriter.Write(testAsset.TestRoot, sources); - var buildCommand = new BuildCommand(testAsset); - buildCommand.Execute() + var buildCommand = new BuildCommand(testAsset) + .WithWorkingDirectory(testAsset.Path); + buildCommand.Execute("-bl") .Should() .Pass(); } @@ -87,8 +88,9 @@ public void CanBuildProjectWithMultiplePackageReferencesWithAliases() List sources = new() { NuGetConfigWriter.DotnetCoreBlobFeed, Path.GetDirectoryName(packageReferenceA.NupkgPath), Path.GetDirectoryName(packageReferenceB.NupkgPath) }; NuGetConfigWriter.Write(testAsset.TestRoot, sources); - var buildCommand = new BuildCommand(testAsset); - buildCommand.Execute() + var buildCommand = new BuildCommand(testAsset) + .WithWorkingDirectory(testAsset.Path); + buildCommand.Execute("-bl") .Should() .Pass(); } @@ -123,8 +125,9 @@ public void CanBuildProjectWithAPackageReferenceWithMultipleAliases() List sources = new() { NuGetConfigWriter.DotnetCoreBlobFeed, Path.GetDirectoryName(packageReferenceA.NupkgPath) }; NuGetConfigWriter.Write(testAsset.TestRoot, sources); - var buildCommand = new BuildCommand(testAsset); - buildCommand.Execute() + var buildCommand = new BuildCommand(testAsset) + .WithWorkingDirectory(testAsset.Path); + buildCommand.Execute("-bl") .Should() .Pass(); } From 7f1d447cd776f3e7ab79e35dbeb0b6ac6b1e9d6c Mon Sep 17 00:00:00 2001 From: Daniel Plaisted Date: Mon, 4 Mar 2024 08:18:17 -0500 Subject: [PATCH 3/3] Disable package reference alias tests --- .../GivenThatWeHaveAPackageReferenceWithAliases.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/Microsoft.NET.Build.Tests/GivenThatWeHaveAPackageReferenceWithAliases.cs b/test/Microsoft.NET.Build.Tests/GivenThatWeHaveAPackageReferenceWithAliases.cs index 5187a63841a7..1d2114cbe0ab 100644 --- a/test/Microsoft.NET.Build.Tests/GivenThatWeHaveAPackageReferenceWithAliases.cs +++ b/test/Microsoft.NET.Build.Tests/GivenThatWeHaveAPackageReferenceWithAliases.cs @@ -11,7 +11,7 @@ public class GivenThatWeHaveAPackageReferenceWithAliases : SdkTest public GivenThatWeHaveAPackageReferenceWithAliases(ITestOutputHelper log) : base(log) { } - [RequiresMSBuildVersionFact("16.8.0")] + [RequiresMSBuildVersionFact("16.8.0", Skip = "https://github.com/dotnet/sdk/issues/39172")] public void CanBuildProjectWithPackageReferencesWithConflictingTypes() { var targetFramework = ToolsetInfo.CurrentTargetFramework; @@ -50,7 +50,7 @@ public void CanBuildProjectWithPackageReferencesWithConflictingTypes() .Pass(); } - [RequiresMSBuildVersionFact("16.8.0")] + [RequiresMSBuildVersionFact("16.8.0", Skip = "https://github.com/dotnet/sdk/issues/39172")] public void CanBuildProjectWithMultiplePackageReferencesWithAliases() { var targetFramework = ToolsetInfo.CurrentTargetFramework; @@ -95,7 +95,7 @@ public void CanBuildProjectWithMultiplePackageReferencesWithAliases() .Pass(); } - [RequiresMSBuildVersionFact("16.8.0")] + [RequiresMSBuildVersionFact("16.8.0", Skip = "https://github.com/dotnet/sdk/issues/39172")] public void CanBuildProjectWithAPackageReferenceWithMultipleAliases() { var targetFramework = ToolsetInfo.CurrentTargetFramework;