From dec5515f3635e390a5e9353347a847d3a5500d5d Mon Sep 17 00:00:00 2001 From: Viktor Hofer Date: Tue, 21 May 2024 13:25:34 +0000 Subject: [PATCH] Simplify scenario-tests test invocation & define dependencies 1. Simplify scenario-tests test invocation by avoiding the intermediate NoTargets wrapper project. 2. Declare the dependency on extract-sdk-archive.proj in the test projects directly to avoid race conditions. https://github.com/dotnet/sdk/pull/41014 failed because the scenario-tests already ran but the SDK test folder wasn't yet ready. --- .../repo-projects/Directory.Build.targets | 29 +++++++++++++ .../content/repo-projects/scenario-tests.proj | 42 ++++++++----------- ...osoft.DotNet.SourceBuild.SmokeTests.csproj | 3 +- ...Microsoft.DotNet.UnifiedBuild.Tests.csproj | 3 +- .../scenario-tests/Directory.Build.targets | 9 ---- .../test/scenario-tests/scenario-tests.proj | 17 -------- src/SourceBuild/content/test/tests.proj | 9 ++-- 7 files changed, 57 insertions(+), 55 deletions(-) delete mode 100644 src/SourceBuild/content/test/scenario-tests/Directory.Build.targets delete mode 100644 src/SourceBuild/content/test/scenario-tests/scenario-tests.proj diff --git a/src/SourceBuild/content/repo-projects/Directory.Build.targets b/src/SourceBuild/content/repo-projects/Directory.Build.targets index ee1c94163b80..b6265ee9df7d 100644 --- a/src/SourceBuild/content/repo-projects/Directory.Build.targets +++ b/src/SourceBuild/content/repo-projects/Directory.Build.targets @@ -620,6 +620,35 @@ ExtractToolPackage; CleanupRepo" /> + + + + + + + + + $(TestCommand) + $(FullTestCommand) /v:$(LogVerbosity) + + + + + + + + + + + + + + + + + + false + + $([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'scenario-tests')) + $([MSBuild]::NormalizeDirectory('$(ArtifactsTestResultsDir)', 'scenario-tests')) + $([MSBuild]::NormalizePath('$(SrcDir)', 'sdk', 'NuGet.config')) + $(ScenarioTestsArtifactsDir)NuGet.config + + @@ -10,28 +20,16 @@ - - - false - - $([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'scenario-tests')) - $([MSBuild]::NormalizeDirectory('$(ArtifactsTestResultsDir)', 'scenario-tests')) - <_ScenarioTestsNuGetConfig>$(ScenarioTestsArtifactsDir)NuGet.config - <_SdkNuGetConfig>$([MSBuild]::NormalizePath('$(SrcDir)', 'sdk', 'NuGet.config')) - - - - - + Inputs="$(NuGetConfigInputForScenarioTests)" + Outputs="$(NuGetConfigOutputForScenarioTests)"> + - - + <_CurrentDateTime>$([System.DateTime]::Now.ToString("yyyy-MM-dd_HH_mm_ss")) <_TestXmlOutputPath>$(ScenarioTestsResultsDir)$(_CurrentDateTime).xml @@ -49,7 +47,7 @@ - <_ScenarioTestEnvVars Include=" + - - diff --git a/src/SourceBuild/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/Microsoft.DotNet.SourceBuild.SmokeTests.csproj b/src/SourceBuild/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/Microsoft.DotNet.SourceBuild.SmokeTests.csproj index 0448a8064331..e298aca90d7f 100644 --- a/src/SourceBuild/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/Microsoft.DotNet.SourceBuild.SmokeTests.csproj +++ b/src/SourceBuild/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/Microsoft.DotNet.SourceBuild.SmokeTests.csproj @@ -17,6 +17,7 @@ + @@ -71,7 +72,7 @@ $(MsftSdkTarballPath) - + $(PoisonUsageReportFile) diff --git a/src/SourceBuild/content/test/Microsoft.DotNet.UnifiedBuild.Tests/Microsoft.DotNet.UnifiedBuild.Tests.csproj b/src/SourceBuild/content/test/Microsoft.DotNet.UnifiedBuild.Tests/Microsoft.DotNet.UnifiedBuild.Tests.csproj index 86b3f1f15955..3a2bdeeb632f 100644 --- a/src/SourceBuild/content/test/Microsoft.DotNet.UnifiedBuild.Tests/Microsoft.DotNet.UnifiedBuild.Tests.csproj +++ b/src/SourceBuild/content/test/Microsoft.DotNet.UnifiedBuild.Tests/Microsoft.DotNet.UnifiedBuild.Tests.csproj @@ -11,7 +11,8 @@ - + + diff --git a/src/SourceBuild/content/test/scenario-tests/Directory.Build.targets b/src/SourceBuild/content/test/scenario-tests/Directory.Build.targets deleted file mode 100644 index 56dccb4796da..000000000000 --- a/src/SourceBuild/content/test/scenario-tests/Directory.Build.targets +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/src/SourceBuild/content/test/scenario-tests/scenario-tests.proj b/src/SourceBuild/content/test/scenario-tests/scenario-tests.proj deleted file mode 100644 index 410ac2f54c4c..000000000000 --- a/src/SourceBuild/content/test/scenario-tests/scenario-tests.proj +++ /dev/null @@ -1,17 +0,0 @@ - - - - $(NetCurrent) - true - - - - - - - - diff --git a/src/SourceBuild/content/test/tests.proj b/src/SourceBuild/content/test/tests.proj index 2f8df9ccb659..83314d1fa783 100644 --- a/src/SourceBuild/content/test/tests.proj +++ b/src/SourceBuild/content/test/tests.proj @@ -4,7 +4,7 @@ <_RunScenarioTests>true <_RunScenarioTests Condition="'$(BuildArchitecture.ToLowerInvariant())' != '$(TargetArchitecture.ToLowerInvariant())'">false @@ -18,12 +18,15 @@ - - + + + +