-
Notifications
You must be signed in to change notification settings - Fork 447
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable scenario test execution in VMR build (#19222)
- Loading branch information
Showing
14 changed files
with
212 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<Project Sdk="Microsoft.Build.NoTargets"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>$(NetCurrent)</TargetFramework> | ||
</PropertyGroup> | ||
|
||
<Target Name="ExtractSdkArchive" | ||
BeforeTargets="AfterBuild" | ||
DependsOnTargets="DetermineSourceBuiltSdkVersion" | ||
Inputs="$(SdkTarballPath)" | ||
Outputs="$(DotNetSdkExtractDir)"> | ||
<MakeDir Directories="$(DotNetSdkExtractDir)" /> | ||
<Exec Condition="'$(ArchiveExtension)' == '.tar.gz'" | ||
Command="tar -xzf $(SdkTarballPath) -C $(DotNetSdkExtractDir)" /> | ||
<Unzip Condition="'$(ArchiveExtension)' == '.zip'" | ||
SourceFiles="$(SdkTarballPath)" | ||
DestinationFolder="$(DotNetSdkExtractDir)" /> | ||
</Target> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
src/SourceBuild/content/test/scenario-tests/Directory.Build.targets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<Project> | ||
|
||
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.targets, $(MSBuildThisFileDirectory)..))" /> | ||
|
||
<!-- scenario-tests test execution requires a custom test target. --> | ||
<Target Name="Test" DependsOnTargets="RunScenarioTests" /> | ||
<Target Name="VSTest" DependsOnTargets="RunScenarioTests" /> | ||
|
||
</Project> |
17 changes: 17 additions & 0 deletions
17
src/SourceBuild/content/test/scenario-tests/scenario-tests.proj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<Project Sdk="Microsoft.Build.NoTargets"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>$(NetCurrent)</TargetFramework> | ||
<IsTestProject>true</IsTestProject> | ||
</PropertyGroup> | ||
|
||
<!-- Scenarios tests are handled separately from the other test projects. This is because the output of the scenario tests is | ||
an executable that is used to run the tests and so using the VSTest runner doesn't work with them. They also require | ||
some setup steps to be configured with the VMR. --> | ||
<Target Name="RunScenarioTests"> | ||
<MSBuild Projects="$(RepoProjectsDir)scenario-tests.proj" | ||
Properties="Configuration=$(Configuration)" | ||
Targets="RunScenarioTests" /> | ||
</Target> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,29 @@ | ||
<Project Sdk="Microsoft.Build.Traversal"> | ||
|
||
<PropertyGroup> | ||
<_RunScenarioTests>true</_RunScenarioTests> | ||
|
||
<!-- Skip scenario tests if the host architecture is different from the target architecture since the tests | ||
require the ability to execute the built SDK. But the CLI is not capable of running on a host with a | ||
different architecture (i.e. "cannot execute binary file: Exec format error"). --> | ||
<_RunScenarioTests Condition="'$(BuildArchitecture.ToLowerInvariant())' != '$(TargetArchitecture.ToLowerInvariant())'">false</_RunScenarioTests> | ||
|
||
<!-- Skip scenario tests if the portable OS (determined from the host machine) is different from the target OS | ||
since the tests require the ability to execute the built SDK. An example of where this would be disabled is | ||
cross-build of using Mariner to build for Alpine (linux vs linux-musl). --> | ||
<_RunScenarioTests Condition="'$(BuildOS)' != 'windows' and '$(__PortableTargetOS.ToLowerInvariant())' != '$(TargetOS.ToLowerInvariant())'">false</_RunScenarioTests> | ||
|
||
<!-- The scenario tests are not supported when unofficial build versioning is used. --> | ||
<_RunScenarioTests Condition="'$(UseOfficialBuildVersioning)' == 'false'">false</_RunScenarioTests> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="$(RepositoryEngineeringDir)extract-sdk-archive.proj" /> | ||
<ProjectReference Include="Microsoft.DotNet.SourceBuild.SmokeTests\Microsoft.DotNet.SourceBuild.SmokeTests.csproj" | ||
Condition="'$(DotNetBuildSourceOnly)' == 'true'" /> | ||
<ProjectReference Include="Microsoft.DotNet.UnifiedBuild.Tests\Microsoft.DotNet.UnifiedBuild.Tests.csproj" | ||
Condition="'$(ShortStack)' != 'true' and '$(PortableBuild)' == 'true' and '$(PgoInstrument)' != 'true'" /> | ||
<ProjectReference Include="scenario-tests\scenario-tests.proj" Condition="'$(_RunScenarioTests)' == 'true'" /> | ||
</ItemGroup> | ||
|
||
</Project> | ||
</Project> |
23 changes: 23 additions & 0 deletions
23
src/SourceBuild/patches/scenario-tests/0001-Disable-Aspire-scenario-test.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: Matt Thalman <mthalman@microsoft.com> | ||
Date: Tue, 30 Apr 2024 08:34:08 -0500 | ||
Subject: [PATCH] Disable Aspire scenario test | ||
|
||
Backport: https://github.com/dotnet/sdk/pull/40485 | ||
--- | ||
.../SdkTemplateTests.cs | 2 +- | ||
1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
||
diff --git a/src/Microsoft.DotNet.ScenarioTests.SdkTemplateTests/SdkTemplateTests.cs b/src/Microsoft.DotNet.ScenarioTests.SdkTemplateTests/SdkTemplateTests.cs | ||
index c43fdd6..bb5c52d 100644 | ||
--- a/src/Microsoft.DotNet.ScenarioTests.SdkTemplateTests/SdkTemplateTests.cs | ||
+++ b/src/Microsoft.DotNet.ScenarioTests.SdkTemplateTests/SdkTemplateTests.cs | ||
@@ -217,7 +217,7 @@ public class SdkTemplateTests : IClassFixture<ScenarioTestFixture> | ||
newTest.Execute(_sdkHelper, _scenarioTestInput.TestRoot, "wasm-tools"); | ||
} | ||
|
||
- [Fact] | ||
+ //[Fact] | ||
[Trait("Category", "Workload")] | ||
[Trait("Category", "InProgress")] | ||
public void VerifyAspireTemplate() |
23 changes: 23 additions & 0 deletions
23
src/SourceBuild/patches/scenario-tests/0002-Disable-WPF-scenario-test.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: Matt Thalman <mthalman@microsoft.com> | ||
Date: Tue, 30 Apr 2024 10:21:32 -0500 | ||
Subject: [PATCH] Disable WPF scenario test | ||
|
||
Backport: https://github.com/dotnet/source-build/issues/4361 | ||
--- | ||
.../SdkTemplateTests.cs | 2 +- | ||
1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
||
diff --git a/src/Microsoft.DotNet.ScenarioTests.SdkTemplateTests/SdkTemplateTests.cs b/src/Microsoft.DotNet.ScenarioTests.SdkTemplateTests/SdkTemplateTests.cs | ||
index c43fdd6..35279a9 100644 | ||
--- a/src/Microsoft.DotNet.ScenarioTests.SdkTemplateTests/SdkTemplateTests.cs | ||
+++ b/src/Microsoft.DotNet.ScenarioTests.SdkTemplateTests/SdkTemplateTests.cs | ||
@@ -84,7 +84,7 @@ public class SdkTemplateTests : IClassFixture<ScenarioTestFixture> | ||
newTest.Execute(_sdkHelper, _scenarioTestInput.TestRoot); | ||
} | ||
|
||
- [Theory] | ||
+ //[Theory] | ||
[InlineData(DotNetLanguage.CSharp)] | ||
[InlineData(DotNetLanguage.VB)] | ||
[Trait("Category", "Offline")] |