Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[net9.0] [testing] Enable Windows UITests back #20727

Merged
merged 7 commits into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 8 additions & 2 deletions eng/cake/dotnet.cake
Original file line number Diff line number Diff line change
Expand Up @@ -753,8 +753,14 @@ void RunTestWithLocalDotNet(string csproj, string config, string pathDotnet = nu
var name = System.IO.Path.GetFileNameWithoutExtension(csproj);
var logDirectory = GetLogDirectory();

if(localDotnet)
SetDotNetEnvironmentVariables();
if (localDotnet)
{
// Make sure the path doesn't refer to the dotnet executable and make path absolute
var localDotnetRoot = MakeAbsolute(Directory(System.IO.Path.GetDirectoryName(pathDotnet)));
Information("new dotnet root: {0}", localDotnetRoot);

SetDotNetEnvironmentVariables(localDotnetRoot.FullPath);
}

if (string.IsNullOrWhiteSpace(resultsFileNameWithoutExtension))
{
Expand Down
36 changes: 22 additions & 14 deletions eng/devices/windows.cake
Original file line number Diff line number Diff line change
Expand Up @@ -443,26 +443,34 @@ Task("uitest")
Information("old dotnet root: {0}", DOTNET_ROOT);
Information("old dotnet path: {0}", DOTNET_PATH);

var localDotnetRoot = MakeAbsolute(Directory("../../bin/dotnet/"));
Information("new dotnet root: {0}", localDotnetRoot);

DOTNET_ROOT = localDotnetRoot.ToString();

var localToolPath = $"{localDotnetRoot}/dotnet.exe";

Information("new dotnet toolPath: {0}", localToolPath);

SetDotNetEnvironmentVariables(DOTNET_ROOT);

DotNetBuild(PROJECT.FullPath, new DotNetBuildSettings {
var buildSettings = new DotNetBuildSettings {
Configuration = CONFIGURATION,
ToolPath = localToolPath,
ArgumentCustomization = args => args
.Append("/p:ExtraDefineConstants=WINTEST")
.Append("/bl:" + binlog)
.Append("/maxcpucount:1")
//.Append("/tl")
});
};

string? localToolPath = null;

if (localDotnet)
{
var localDotnetRoot = MakeAbsolute(Directory("../../bin/dotnet/"));
Information("new dotnet root: {0}", localDotnetRoot);

DOTNET_ROOT = localDotnetRoot.ToString();

localToolPath = $"{localDotnetRoot}/dotnet.exe";

Information("new dotnet toolPath: {0}", localToolPath);

SetDotNetEnvironmentVariables(DOTNET_ROOT);

buildSettings.ToolPath = localToolPath;
}

DotNetBuild(PROJECT.FullPath, buildSettings);

SetEnvironmentVariable("WINDOWS_APP_PATH", TEST_APP);
SetEnvironmentVariable("APPIUM_LOG_FILE", $"{BINLOG_DIR}/appium_windows.log");
Expand Down
44 changes: 22 additions & 22 deletions eng/pipelines/common/ui-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,28 +123,28 @@ stages:
agentPoolAccessToken: ${{ parameters.agentPoolAccessToken }}
runtimeVariant : "NativeAOT"

# - stage: winui_ui_tests
# displayName: WinUI UITests
# dependsOn: []
# jobs:
# - ${{ each project in parameters.projects }}:
# - ${{ if ne(project.winui, '') }}:
# - job: winui_ui_tests_${{ project.name }}
# timeoutInMinutes: 240 # how long to run the job before automatically cancelling
# workspace:
# clean: all
# displayName: ${{ coalesce(project.desc, project.name) }}
# pool: ${{ parameters.windowsPool }}
# steps:
# - template: ui-tests-steps.yml
# parameters:
# platform: windows
# version: "10.0.19041"
# device: windows10
# path: ${{ project.winui }}
# app: ${{ project.app }}
# provisionatorChannel: ${{ parameters.provisionatorChannel }}
# agentPoolAccessToken: ${{ parameters.agentPoolAccessToken }}
- stage: winui_ui_tests
displayName: WinUI UITests
dependsOn: []
jobs:
- ${{ each project in parameters.projects }}:
- ${{ if ne(project.winui, '') }}:
- job: winui_ui_tests_${{ project.name }}
timeoutInMinutes: 240 # how long to run the job before automatically cancelling
workspace:
clean: all
displayName: ${{ coalesce(project.desc, project.name) }}
pool: ${{ parameters.windowsPool }}
steps:
- template: ui-tests-steps.yml
parameters:
platform: windows
version: "10.0.19041"
device: windows10
path: ${{ project.winui }}
app: ${{ project.app }}
provisionatorChannel: ${{ parameters.provisionatorChannel }}
agentPoolAccessToken: ${{ parameters.agentPoolAccessToken }}

- stage: mac_ui_tests
displayName: macOS UITests
Expand Down