Skip to content

Commit

Permalink
Revert "Revert "[net9.0] [testing] Enable Windows UITests back (#20727)…
Browse files Browse the repository at this point in the history
…" (#21…"

This reverts commit 7aa9bf0.
  • Loading branch information
jfversluis committed Apr 4, 2024
1 parent 7aa9bf0 commit 93beb13
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 38 deletions.
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

0 comments on commit 93beb13

Please sign in to comment.