Skip to content

Commit

Permalink
[uitests] Work for get appium uitests with CI (#14488)
Browse files Browse the repository at this point in the history
* More stuff with query

* Update to Appium 2.0

* Cleanup

* Fix tests

* Add mac tests

* Multiple testcase

* Fixes for  windows

* Deploy as unpackaged app

* Fixes for run UITests on windows

* Cleanup and move to TestUtils projects for Appium and Xamarin.UITest

* Fix references

* Add to mac sln

* Fix sln

* Add uitest yaml

* Fix sln

* Update yml

* more fixes

* again powershell

* fix ident

* Add path and try call cake

* Fix

* Start background

* Start appium on the background

* Just run android for now

* try install app

* try again

* if it fails continue

* fix paths

* appium

* try again

* try again

* fix

* again

* try again

* location of samples

* build samples

* do not skip xcode

* more debug info

* Publish test results

* nUnit tests for now

* try any file

* no retry

* try vstest

* FIX PATH

* install more drivers

* usenuget when building samples

* Move to helpers

* Try run iOS tests

* try build both

* Add ALLTests

* Android folder

* fixes

* try again

* Fix path

* Cleanup android cake

* cleanup iOS cake

* add mac cake

* fix version

* try again

* try again

* upDATE TOOLS

* try again

* fix again

* again

* again

* again

* rollback xharness

* increase timeout

* run with dotnet path

* Fix dir

* Try again

* fix

* Fix

* build and then run tests

* fix platformVersion passed to APPIUM

* Don t do verbosity

* Log for appium

* Try 16.2

* Add platform to appium logs

* Fix

* Start test server

* Wait for server to start

* Fix typo

* Add windows cake

* Set uitests windows yaml

* provision on macos only

* Fix path for app windows

* Rename winui

* Try again

* Make sure to stop and dispose the server

* fix template

* Install windows driver too

* Better appium install drivers

* specify device

* Fix binlog android

* Run device tests in release

* Try no path

* Try with debug configuration

* try build samples just for that platform

* Release

* rename to match platform

* try cleanup

* Add mac uitests

* Build only for catalyst

* Add information

* Version mac

* Fix folder path

* Try build and run windows tests

* more stuff on install script

* Add retry for ios

* run always on xamarin pool

* Fix windows

* Allow to pass configuration to catalyst

* Add bindir info

* Try fix windows build

* Try set env variables before

* [Sample] Clean fields when tapping login button

* Take screenshot before querying text element

* Enable automationmode-without-authentication

* Try using action instead

* Use same machine pool as ios/android for mac

* Change entry to not get autocorrect pop-up and add delay before click

* Disable keyboard completion for catalyst runs

* Auto-format source code

* Update sln

* Fix csproj

* Add Sample UITests

* Fix yaml

* Use the new app uitest sandbox project

* Remove old code

* Cleanup

* Fix Android manifest

* Fix build for tizen

* Rename projects

* Some more renames

* Fix ios for PR's

* Update MainPageTests.cs

* Add to mac slnf

* Try more stuff for the mac

* Try run before

* don t set automation mode

* Try Xcode select and move to ventura

* Fix script

* Dont xcode select

* Bool and not string

* try old appium

* Fix version

* Can we skip provisioning

* We can't skip provisioning

* Dont provision on windows

* Update sln and packages

* Update node

* Configure the windows path to the exe

* Auto-format source code

---------

Co-authored-by: Scott Banning <scoban@microsoft.com>
Co-authored-by: GitHub Actions Autoformatter <autoformat@example.com>
  • Loading branch information
3 people committed May 30, 2023
1 parent a50128d commit 49ec8b7
Show file tree
Hide file tree
Showing 58 changed files with 4,051 additions and 15 deletions.
36 changes: 36 additions & 0 deletions Microsoft.Maui-dev.sln
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,16 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Controls.Xaml.UnitTests.Int
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Controls.Xaml.UnitTests.InternalsHiddenAssembly", "src\Controls\tests\Xaml.UnitTests.InternalsHiddenAssembly\Controls.Xaml.UnitTests.InternalsHiddenAssembly.csproj", "{FB39FACE-BAF2-4F97-A249-E45BA63D77FE}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Controls.AppiumTests", "src\Controls\tests\UITests\Controls.AppiumTests.csproj", "{2A0CB35C-ED05-4FCB-91BC-21B288B749B1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestUtils.Appium", "src\TestUtils\src\TestUtils.Appium\TestUtils.Appium.csproj", "{FABB4FE3-AD90-479E-B7F1-BEF110181196}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestUtils.Appium.UITests", "src\TestUtils\src\TestUtils.Appium.UITests\TestUtils.Appium.UITests.csproj", "{E06CEFD4-237C-49F0-BE0F-C5F80AD8F64C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Controls.Sample.UITests", "src\Controls\samples\Controls.Sample.UITests\Controls.Sample.UITests.csproj", "{07C26A25-08C2-4C52-9574-1C33EC8E7919}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Maui.IntegrationTests", "src\TestUtils\src\Microsoft.Maui.IntegrationTests\Microsoft.Maui.IntegrationTests.csproj", "{A6976D43-B3A4-47AF-89D9-FA388B56B52B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -519,6 +529,27 @@ Global
{FB39FACE-BAF2-4F97-A249-E45BA63D77FE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FB39FACE-BAF2-4F97-A249-E45BA63D77FE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FB39FACE-BAF2-4F97-A249-E45BA63D77FE}.Release|Any CPU.Build.0 = Release|Any CPU
{2A0CB35C-ED05-4FCB-91BC-21B288B749B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2A0CB35C-ED05-4FCB-91BC-21B288B749B1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2A0CB35C-ED05-4FCB-91BC-21B288B749B1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2A0CB35C-ED05-4FCB-91BC-21B288B749B1}.Release|Any CPU.Build.0 = Release|Any CPU
{FABB4FE3-AD90-479E-B7F1-BEF110181196}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FABB4FE3-AD90-479E-B7F1-BEF110181196}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FABB4FE3-AD90-479E-B7F1-BEF110181196}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FABB4FE3-AD90-479E-B7F1-BEF110181196}.Release|Any CPU.Build.0 = Release|Any CPU
{E06CEFD4-237C-49F0-BE0F-C5F80AD8F64C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E06CEFD4-237C-49F0-BE0F-C5F80AD8F64C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E06CEFD4-237C-49F0-BE0F-C5F80AD8F64C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E06CEFD4-237C-49F0-BE0F-C5F80AD8F64C}.Release|Any CPU.Build.0 = Release|Any CPU
{07C26A25-08C2-4C52-9574-1C33EC8E7919}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{07C26A25-08C2-4C52-9574-1C33EC8E7919}.Debug|Any CPU.Build.0 = Debug|Any CPU
{07C26A25-08C2-4C52-9574-1C33EC8E7919}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{07C26A25-08C2-4C52-9574-1C33EC8E7919}.Release|Any CPU.ActiveCfg = Release|Any CPU
{07C26A25-08C2-4C52-9574-1C33EC8E7919}.Release|Any CPU.Build.0 = Release|Any CPU
{A6976D43-B3A4-47AF-89D9-FA388B56B52B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A6976D43-B3A4-47AF-89D9-FA388B56B52B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A6976D43-B3A4-47AF-89D9-FA388B56B52B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A6976D43-B3A4-47AF-89D9-FA388B56B52B}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -613,6 +644,11 @@ Global
{B5F38A9E-1949-4779-8739-D682B09E0CB3} = {25D0D27A-C5FE-443D-8B65-D6C987F4A80E}
{B5F38A9E-1949-4779-6666-D682B09E0CB3} = {25D0D27A-C5FE-443D-8B65-D6C987F4A80E}
{FB39FACE-BAF2-4F97-A249-E45BA63D77FE} = {25D0D27A-C5FE-443D-8B65-D6C987F4A80E}
{2A0CB35C-ED05-4FCB-91BC-21B288B749B1} = {25D0D27A-C5FE-443D-8B65-D6C987F4A80E}
{FABB4FE3-AD90-479E-B7F1-BEF110181196} = {7AC28763-9C68-4BF9-A1BA-25CBFFD2D15C}
{E06CEFD4-237C-49F0-BE0F-C5F80AD8F64C} = {7AC28763-9C68-4BF9-A1BA-25CBFFD2D15C}
{07C26A25-08C2-4C52-9574-1C33EC8E7919} = {E1082E26-D700-4127-9329-66D673FD2D55}
{A6976D43-B3A4-47AF-89D9-FA388B56B52B} = {7AC28763-9C68-4BF9-A1BA-25CBFFD2D15C}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {0B8ABEAD-D2B5-4370-A187-62B5ABE4EE50}
Expand Down
4 changes: 4 additions & 0 deletions Microsoft.Maui-mac.slnf
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"src\\Controls\\samples\\Controls.Sample.Profiling\\Maui.Controls.Sample.Profiling.csproj",
"src\\Controls\\samples\\Controls.Sample.Sandbox\\Maui.Controls.Sample.Sandbox.csproj",
"src\\Controls\\samples\\Controls.Sample\\Maui.Controls.Sample.csproj",
"src\\Controls\\samples\\Controls.Sample.UITests\\Controls.Sample.UITests.csproj",
"src\\Controls\\src\\Build.Tasks\\Controls.Build.Tasks.csproj",
"src\\Controls\\src\\Core.Design\\Controls.Core.Design.csproj",
"src\\Controls\\src\\Core\\Controls.Core.csproj",
Expand All @@ -21,6 +22,7 @@
"src\\Controls\\tests\\Core.UnitTests\\Controls.Core.UnitTests.csproj",
"src\\Controls\\tests\\CustomAttributes\\Controls.CustomAttributes.csproj",
"src\\Controls\\tests\\DeviceTests\\Controls.DeviceTests.csproj",
"src\\Controls\\tests\\UITests\\Controls.AppiumTests.csproj",
"src\\Controls\\tests\\Xaml.UnitTests.ExternalAssembly\\Controls.Xaml.UnitTests.ExternalAssembly.csproj",
"src\\Controls\\tests\\Xaml.UnitTests.InternalsVisibleAssembly\\Controls.Xaml.UnitTests.InternalsVisibleAssembly.csproj",
"src\\Controls\\tests\\Xaml.UnitTests.InternalsHiddenAssembly\\Controls.Xaml.UnitTests.InternalsHiddenAssembly.csproj",
Expand Down Expand Up @@ -48,6 +50,8 @@
"src\\TestUtils\\src\\DeviceTests.Runners\\TestUtils.DeviceTests.Runners.csproj",
"src\\TestUtils\\src\\DeviceTests\\TestUtils.DeviceTests.csproj",
"src\\TestUtils\\src\\TestUtils\\TestUtils.csproj",
"src\\TestUtils\\src\\TestUtils.Appium.UITests\\TestUtils.Appium.UITests.csproj",
"src\\TestUtils\\src\\TestUtils.Appium\\TestUtils.Appium.csproj",
"src\\Workload\\Microsoft.Maui.Sdk\\Microsoft.Maui.Sdk.csproj",
"src\\Workload\\Microsoft.NET.Sdk.Maui\\Microsoft.NET.Sdk.Maui.csproj"
]
Expand Down
5 changes: 5 additions & 0 deletions Microsoft.Maui-windows.slnf
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"src\\Controls\\Maps\\src\\Controls.Maps.csproj",
"src\\Controls\\samples\\Controls.Sample.Profiling\\Maui.Controls.Sample.Profiling.csproj",
"src\\Controls\\samples\\Controls.Sample.Sandbox\\Maui.Controls.Sample.Sandbox.csproj",
"src\\Controls\\samples\\Controls.Sample.UITests\\Controls.Sample.UITests.csproj",
"src\\Controls\\samples\\Controls.Sample\\Maui.Controls.Sample.csproj",
"src\\Controls\\src\\Build.Tasks\\Controls.Build.Tasks.csproj",
"src\\Controls\\src\\Core.Design\\Controls.Core.Design.csproj",
Expand All @@ -26,6 +27,7 @@
"src\\Controls\\tests\\Core.UnitTests\\Controls.Core.UnitTests.csproj",
"src\\Controls\\tests\\CustomAttributes\\Controls.CustomAttributes.csproj",
"src\\Controls\\tests\\DeviceTests\\Controls.DeviceTests.csproj",
"src\\Controls\\tests\\UITests\\Controls.AppiumTests.csproj",
"src\\Controls\\tests\\Xaml.UnitTests.ExternalAssembly\\Controls.Xaml.UnitTests.ExternalAssembly.csproj",
"src\\Controls\\tests\\Xaml.UnitTests.InternalsHiddenAssembly\\Controls.Xaml.UnitTests.InternalsHiddenAssembly.csproj",
"src\\Controls\\tests\\Xaml.UnitTests.InternalsVisibleAssembly\\Controls.Xaml.UnitTests.InternalsVisibleAssembly.csproj",
Expand Down Expand Up @@ -64,6 +66,9 @@
"src\\TestUtils\\src\\DeviceTests.Runners.SourceGen\\TestUtils.DeviceTests.Runners.SourceGen.csproj",
"src\\TestUtils\\src\\DeviceTests.Runners\\TestUtils.DeviceTests.Runners.csproj",
"src\\TestUtils\\src\\DeviceTests\\TestUtils.DeviceTests.csproj",
"src\\TestUtils\\src\\Microsoft.Maui.IntegrationTests\\Microsoft.Maui.IntegrationTests.csproj",
"src\\TestUtils\\src\\TestUtils.Appium.UITests\\TestUtils.Appium.UITests.csproj",
"src\\TestUtils\\src\\TestUtils.Appium\\TestUtils.Appium.csproj",
"src\\TestUtils\\src\\TestUtils\\TestUtils.csproj",
"src\\Workload\\Microsoft.Maui.Sdk\\Microsoft.Maui.Sdk.csproj",
"src\\Workload\\Microsoft.NET.Sdk.Maui\\Microsoft.NET.Sdk.Maui.csproj"
Expand Down
3 changes: 2 additions & 1 deletion Microsoft.Maui.Samples.slnf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"projects": [
"src\\BlazorWebView\\samples\\MauiRazorClassLibrarySample\\MauiRazorClassLibrarySample.csproj",
"src\\Controls\\samples\\Controls.Sample.Sandbox\\Maui.Controls.Sample.Sandbox.csproj",
"src\\Controls\\samples\\Controls.Sample.UITests\\Controls.Sample.UITests.csproj",
"src\\Controls\\samples\\Controls.Sample\\Maui.Controls.Sample.csproj"
]
}
}
}
28 changes: 28 additions & 0 deletions Microsoft.Maui.sln
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Core.DeviceTests.Shared", "
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Graphics.DeviceTests", "src\Graphics\tests\DeviceTests\Graphics.DeviceTests.csproj", "{34969E49-FA6E-41BB-9813-5689BB14021E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Controls.AppiumTests", "src\Controls\tests\UITests\Controls.AppiumTests.csproj", "{A23B108A-AB56-4692-B9DA-0E23602E3955}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestUtils.Appium", "src\TestUtils\src\TestUtils.Appium\TestUtils.Appium.csproj", "{EDADE060-6B61-4006-BB7D-CB7710F08E87}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestUtils.Appium.UITests", "src\TestUtils\src\TestUtils.Appium.UITests\TestUtils.Appium.UITests.csproj", "{0930F067-A388-4C9C-A249-653B74625A4E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Compatibility.Core.UnitTests", "src\Compatibility\Core\tests\Compatibility.UnitTests\Compatibility.Core.UnitTests.csproj", "{13A1AFD2-78D3-4463-9977-C8B642BCE2E2}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Controls.Xaml.UnitTests.ExternalAssembly", "src\Controls\tests\Xaml.UnitTests.ExternalAssembly\Controls.Xaml.UnitTests.ExternalAssembly.csproj", "{F2ADA552-6328-4B2D-8D48-FCDD32C4AF60}"
Expand All @@ -255,6 +261,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Maui.IntegrationT
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Controls.Xaml.UnitTests.InternalsHiddenAssembly", "src\Controls\tests\Xaml.UnitTests.InternalsHiddenAssembly\Controls.Xaml.UnitTests.InternalsHiddenAssembly.csproj", "{FB39FACE-BAF2-4F97-A249-E45BA63D77FE}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Controls.Sample.UITests", "src\Controls\samples\Controls.Sample.UITests\Controls.Sample.UITests.csproj", "{F39F75DC-671B-4649-8005-1929797B3217}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -619,6 +627,18 @@ Global
{34969E49-FA6E-41BB-9813-5689BB14021E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{34969E49-FA6E-41BB-9813-5689BB14021E}.Release|Any CPU.Build.0 = Release|Any CPU
{34969E49-FA6E-41BB-9813-5689BB14021E}.Release|Any CPU.Deploy.0 = Release|Any CPU
{A23B108A-AB56-4692-B9DA-0E23602E3955}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A23B108A-AB56-4692-B9DA-0E23602E3955}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A23B108A-AB56-4692-B9DA-0E23602E3955}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A23B108A-AB56-4692-B9DA-0E23602E3955}.Release|Any CPU.Build.0 = Release|Any CPU
{EDADE060-6B61-4006-BB7D-CB7710F08E87}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EDADE060-6B61-4006-BB7D-CB7710F08E87}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EDADE060-6B61-4006-BB7D-CB7710F08E87}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EDADE060-6B61-4006-BB7D-CB7710F08E87}.Release|Any CPU.Build.0 = Release|Any CPU
{0930F067-A388-4C9C-A249-653B74625A4E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0930F067-A388-4C9C-A249-653B74625A4E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0930F067-A388-4C9C-A249-653B74625A4E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0930F067-A388-4C9C-A249-653B74625A4E}.Release|Any CPU.Build.0 = Release|Any CPU
{13A1AFD2-78D3-4463-9977-C8B642BCE2E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{13A1AFD2-78D3-4463-9977-C8B642BCE2E2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{13A1AFD2-78D3-4463-9977-C8B642BCE2E2}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand All @@ -639,6 +659,10 @@ Global
{FB39FACE-BAF2-4F97-A249-E45BA63D77FE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FB39FACE-BAF2-4F97-A249-E45BA63D77FE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FB39FACE-BAF2-4F97-A249-E45BA63D77FE}.Release|Any CPU.Build.0 = Release|Any CPU
{F39F75DC-671B-4649-8005-1929797B3217}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F39F75DC-671B-4649-8005-1929797B3217}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F39F75DC-671B-4649-8005-1929797B3217}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F39F75DC-671B-4649-8005-1929797B3217}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -752,11 +776,15 @@ Global
{4A6930AE-B67C-4D29-B1A8-ED9EB7F923A7} = {50C758FE-4E10-409A-94F5-A75480960864}
{66CC98E3-6A1A-4C44-A23C-B575E82106EC} = {C564DDD6-DE79-45CD-88EA-3F690481572A}
{34969E49-FA6E-41BB-9813-5689BB14021E} = {936C47A9-A7EA-4FBD-8733-CED1D4100E69}
{A23B108A-AB56-4692-B9DA-0E23602E3955} = {E1082E26-D700-4127-9329-66D673FD2D55}
{EDADE060-6B61-4006-BB7D-CB7710F08E87} = {7AC28763-9C68-4BF9-A1BA-25CBFFD2D15C}
{0930F067-A388-4C9C-A249-653B74625A4E} = {7AC28763-9C68-4BF9-A1BA-25CBFFD2D15C}
{13A1AFD2-78D3-4463-9977-C8B642BCE2E2} = {85EBD2BA-EA5A-4B1F-AF16-81FBD58579DF}
{F2ADA552-6328-4B2D-8D48-FCDD32C4AF60} = {25D0D27A-C5FE-443D-8B65-D6C987F4A80E}
{B5F38A9E-1949-4779-6666-D682B09E0CB3} = {25D0D27A-C5FE-443D-8B65-D6C987F4A80E}
{1C899C94-8744-4E2A-8E23-1660393236FD} = {7AC28763-9C68-4BF9-A1BA-25CBFFD2D15C}
{FB39FACE-BAF2-4F97-A249-E45BA63D77FE} = {25D0D27A-C5FE-443D-8B65-D6C987F4A80E}
{F39F75DC-671B-4649-8005-1929797B3217} = {E1082E26-D700-4127-9329-66D673FD2D55}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {0B8ABEAD-D2B5-4370-A187-62B5ABE4EE50}
Expand Down
17 changes: 12 additions & 5 deletions eng/cake/dotnet.cake
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ string MSBuildExe = Argument("msbuild", EnvironmentVariable("MSBUILD_EXE", ""));
string nugetSource = Argument("nugetsource", "");

string TestTFM = Argument("testtfm", "");
var useNuget = Argument("usenuget", true);
if (TestTFM == "default")
TestTFM = "";

Expand Down Expand Up @@ -143,11 +144,17 @@ Task("dotnet-samples")
{
var tempDir = PrepareSeparateBuildContext("samplesTest");

RunMSBuildWithDotNet("./Microsoft.Maui.Samples.slnf", new Dictionary<string, string> {
["UseWorkload"] = "true",
// ["GenerateAppxPackageOnBuild"] = "true",
["RestoreConfigFile"] = tempDir.CombineWithFilePath("NuGet.config").FullPath,
}, binlogPrefix: "sample-");
var properties = new Dictionary<string, string>();

if(useNuget)
{
properties = new Dictionary<string, string> {
["UseWorkload"] = "true",
// ["GenerateAppxPackageOnBuild"] = "true",
["RestoreConfigFile"] = tempDir.CombineWithFilePath("NuGet.config").FullPath,
};
}
RunMSBuildWithDotNet("./Microsoft.Maui.Samples.slnf", properties, binlogPrefix: "sample-");
});

Task("dotnet-samples-test")
Expand Down
37 changes: 37 additions & 0 deletions eng/cake/helpers.cake
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,40 @@ bool IsTarget(string target) =>

bool TargetStartsWith(string target) =>
Argument<string>("target", "Default").StartsWith(target, StringComparison.InvariantCultureIgnoreCase);

void RunTestWithLocalDotNet(string csproj, string configuration, string dotnetPath = null, Dictionary<string,string> argsExtra = null, bool noBuild = false)
{
var name = System.IO.Path.GetFileNameWithoutExtension(csproj);
var binlog = $"{GetLogDirectory()}/{name}-{configuration}.binlog";
var results = $"{name}-{configuration}.trx";

Information("Run Test binlog: {0}", binlog);

var settings = new DotNetCoreTestSettings
{
Configuration = configuration,
NoBuild = noBuild,
Logger = $"trx;LogFileName={results}",
ResultsDirectory = GetTestResultsDirectory(),
//Verbosity = Cake.Common.Tools.DotNetCore.DotNetCoreVerbosity.Diagnostic,
ArgumentCustomization = args =>
{
args.Append($"-bl:{binlog}");
if(argsExtra != null)
{
foreach(var prop in argsExtra)
{
args.Append($"/p:{prop.Key}={prop.Value}");
}
}
return args;
}
};

if(!string.IsNullOrEmpty(dotnetPath))
{
settings.ToolPath = dotnetPath;
}

DotNetCoreTest(csproj, settings);
}
Loading

0 comments on commit 49ec8b7

Please sign in to comment.