dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
21.84k stars 1.67k forks source link

[testing] Run Windows UITests with new .net sdk #20692

Open rmarinho opened 4 months ago

rmarinho commented 4 months ago

Description

Right now when we launch the Windows UITests app, we rely on the existing .NET install to actually launch/host the application, instead of using the sdk we have provision on bin/dotnet

This is more of an issue with preview sdks like .NET9 where you get a error saying the version your application was built is not present on the system.

We need to or install the .NET version major preview globally first, or try to see how launch the appium tests can use the bin/dotnet.

Affected platforms

Windows


Workload updates are available. Run `dotnet workload list` for more information.
Setting environment variable: WINDOWS_APP_PATH = 'D:/a/1/s/src/Controls/samples/Controls.Sample.UITests/bin/Release/net9.0-windows10.0.19041/win10-x64/Controls.Sample.UITests.exe'
Setting environment variable: APPIUM_LOG_FILE = 'D:/a/1/a/logs/appium_windows.log'
Run UITests project D:/a/1/s/src/Controls/tests/UITests/Controls.AppiumTests.csproj
Setting environment variable: VSDebugger_ValidateDotnetDebugLibSignatures = '0'
Setting environment variable: DOTNET_INSTALL_DIR = 'D:/a/1/s/eng/devices/bin/dotnet'
Setting environment variable: DOTNET_ROOT = 'D:/a/1/s/eng/devices/bin/dotnet'
Setting environment variable: DOTNET_MSBUILD_SDK_RESOLVER_CLI_DIR = 'D:/a/1/s/eng/devices/bin/dotnet'
Setting environment variable: DOTNET_MULTILEVEL_LOOKUP = '0'
Setting environment variable: MSBuildEnableWorkloadResolver = 'true'
Setting environment variable: ForceNet8Current = 'true'
Setting environment variable: PATH = 'D:/a/1/s/eng/devices/bin/dotnet;D:/a/1/s/bin/dotnet;C:\Program Files\PowerShell\7;D:\a\1\s/bin/dotnet;C:\hostedtoolcache\windows\node\20.3.1\x64;C:\Users\VssAdministrator\.dotnet\tools;C:\hostedtoolcache\windows/dotnet;C:\agents\3.234.0\externals\git\cmd;C:\agents\3.234.0\externals\git\mingw64\bin;C:\Program Files\MongoDB\Server\5.0\bin;C:\aliyun-cli;C:\vcpkg;C:\Program Files (x86)\NSIS\;C:\tools\zstd;C:\Program Files\Mercurial\;C:\hostedtoolcache\windows\stack\2.15.1\x64;C:\cabal\bin;C:\\ghcup\bin;C:\mingw64\bin;C:\Program Files\dotnet;C:\Program Files\MySQL\MySQL Server 8.0\bin;C:\Program Files\R\R-4.3.2\bin\x64;C:\SeleniumWebDrivers\GeckoDriver;C:\SeleniumWebDrivers\EdgeDriver\;C:\SeleniumWebDrivers\ChromeDriver;C:\Program Files (x86)\sbt\bin;C:\Program Files (x86)\GitHub CLI;C:\Program Files\Git\bin;C:\Program Files (x86)\pipx_bin;C:\npm\prefix;C:\hostedtoolcache\windows\go\1.20.14\x64\bin;C:\hostedtoolcache\windows\Python\3.9.13\x64\Scripts;C:\hostedtoolcache\windows\Python\3.9.13\x64;C:\hostedtoolcache\windows\Ruby\3.0.6\x64\bin;C:\Program Files\OpenSSL\bin;C:\tools\kotlinc\bin;C:\hostedtoolcache\windows\Java_Temurin-Hotspot_jdk\8.0.402-6\x64\bin;C:\Program Files\ImageMagick-7.1.1-Q16-HDRI;C:\Program Files\Microsoft SDKs\Azure\CLI2\wbin;C:\ProgramData\kind;C:\ProgramData\Chocolatey\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\dotnet\;C:\Program Files\PowerShell\7\;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\130\DTS\Binn\;C:\Program Files\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files\Microsoft SQL Server\150\DTS\Binn\;C:\Program Files\Microsoft SQL Server\160\DTS\Binn\;C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\ProgramData\chocolatey\lib\pulumi\tools\Pulumi\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files\CMake\bin;C:\ProgramData\chocolatey\lib\maven\apache-maven-3.8.7\bin;C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code;C:\Program Files\Microsoft SDKs\Service Fabric\Tools\ServiceFabricLocalClusterManager;C:\Program Files\nodejs\;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Program Files\GitHub CLI\;c:\tools\php;C:\Program Files (x86)\sbt\bin;C:\Program Files\Amazon\AWSCLIV2\;C:\Program Files\Amazon\SessionManagerPlugin\bin\;C:\Program Files\Amazon\AWSSAMCLI\bin\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\LLVM\bin;C:\Users\VssAdministrator\.dotnet\tools;C:\Users\VssAdministrator\.cargo\bin;C:\Users\VssAdministrator\AppData\Local\Microsoft\WindowsApps'
Run Test binlog: D:/a/1/a/logs/Controls.AppiumTests-Release-windows.binlog
Executing: "D:/a/1/s/bin/dotnet/dotnet.exe" test "D:/a/1/s/src/Controls/tests/UITests/Controls.AppiumTests.csproj" --logger "trx;LogFileName=Controls.AppiumTests-Release-windows.trx" --logger "console;verbosity=normal" --configuration Release --no-build --results-directory "D:/a/1/a/test-results" -bl:D:/a/1/a/logs/Controls.AppiumTests-Release-windows.binlog
Testhost process for source(s) 'D : \a\1\s\src\Controls\tests\UITests\bin\Release\net9.0\Controls.AppiumTests.dll' exited with error : You must install or update .NET to run this application. [D:\a\1\s\src\Controls\tests\UITests\Controls.AppiumTests.csproj::TargetFramework=net9.0]

Workload updates are available. Run `dotnet workload list` for more information.
Test Run complete: Controls.AppiumTests-Release-windows.trx
An error occurred when executing task 'uitest'.

https://dev.azure.com/xamarin/public/_build/results?buildId=109128&view=logs&j=9fa242d3-a923-57a4-4d22-9bf225806fe4&t=76e60da1-b0e7-56cc-597c-c32417d92f2c&l=528

ghost commented 4 months ago

We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.