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

Updating Maui templates to build unpackaged Windows apps by default #23787

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
split the tests into categories
  • Loading branch information
mattleibow committed Aug 7, 2024
commit 812c4eef5f96be753e4a08e8d789b4721df0f0d0
1 change: 1 addition & 0 deletions eng/devices/android.cake
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ Information("Android SDK Root: {0}", androidSdkRoot);
Information("Project File: {0}", projectPath);
Information("Build Binary Log (binlog): {0}", binlogDirectory);
Information("Build Configuration: {0}", configuration);
Information("Build Target Framework: {0}", targetFramework);

var avdSettings = new AndroidAvdManagerToolSettings { SdkRoot = androidSdkRoot };
var adbSettings = new AdbToolSettings { SdkRoot = androidSdkRoot };
Expand Down
2 changes: 1 addition & 1 deletion eng/devices/devices-shared.cake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//This assumes that this is always running from a mac with global workloads
const string DotnetToolPathDefault = "/usr/local/share/dotnet/dotnet";
const string DotnetVersion = "net9.0";
string DotnetVersion = Argument("targetFrameworkVersion", EnvironmentVariable("TARGET_FRAMEWORK_VERSION") ?? "net9.0");
const string TestFramework = "net472";

// Map project types to specific subdirectories under artifacts
Expand Down
6 changes: 3 additions & 3 deletions eng/devices/windows.cake
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;

const string defaultVersion = "10.0.19041";
const string dotnetVersion = "net9.0";

// required
string DEFAULT_WINDOWS_PROJECT = "../../src/Controls/tests/TestCases.WinUI.Tests/Controls.TestCases.WinUI.Tests.csproj";
Expand All @@ -19,7 +18,7 @@ var PACKAGEID = Argument("packageid", EnvironmentVariable("WINDOWS_TEST_PACKAGE_
// optional
var DOTNET_PATH = Argument("dotnet-path", EnvironmentVariable("DOTNET_PATH"));
var DOTNET_ROOT = Argument("dotnet-root", EnvironmentVariable("DOTNET_ROOT"));
var TARGET_FRAMEWORK = Argument("tfm", EnvironmentVariable("TARGET_FRAMEWORK") ?? $"{dotnetVersion}-windows{defaultVersion}");
var TARGET_FRAMEWORK = Argument("tfm", EnvironmentVariable("TARGET_FRAMEWORK") ?? $"{DotnetVersion}-windows{defaultVersion}");
var BINLOG_ARG = Argument("binlog", EnvironmentVariable("WINDOWS_TEST_BINLOG") ?? "");
DirectoryPath BINLOG_DIR = string.IsNullOrEmpty(BINLOG_ARG) && !string.IsNullOrEmpty(PROJECT.FullPath) ? PROJECT.GetDirectory() : BINLOG_ARG;
var TEST_APP = Argument("app", EnvironmentVariable("WINDOWS_TEST_APP") ?? "");
Expand Down Expand Up @@ -57,6 +56,7 @@ Information("Build Binary Log (binlog): {0}", BINLOG_DIR);
Information("Build Platform: {0}", PLATFORM);
Information("Build Configuration: {0}", CONFIGURATION);

Information("Target Framework: {0}", TARGET_FRAMEWORK);
Information("Windows version: {0}", windowsVersion);

Setup(context =>
Expand Down Expand Up @@ -439,7 +439,7 @@ Task("SetupTestPaths")
throw new Exception("If no app was specified, an app must be provided.");
}

var winVersion = $"{dotnetVersion}-windows{windowsVersion}";
var winVersion = $"{DotnetVersion}-windows{windowsVersion}";
var binDir = TEST_APP_PROJECT.GetDirectory().Combine("Controls.TestCases.HostApp").Combine(CONFIGURATION + "/" + winVersion).Combine(DOTNET_PLATFORM);
Information("BinDir: {0}", binDir);
var apps = GetFiles(binDir + "/*.exe").Where(c => !c.FullPath.EndsWith("createdump.exe"));
Expand Down
63 changes: 43 additions & 20 deletions eng/pipelines/common/device-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ parameters:
artifactItemPattern: '**/*.nupkg'
checkoutDirectory: $(System.DefaultWorkingDirectory)
useArtifacts: false
targetFrameworkVersion:
- tfm: ''
dependsOn: ''
projects:
- name: name
desc: Human Description
Expand All @@ -21,14 +24,18 @@ parameters:
catalyst: /optional/path/to/catalyst.csproj

stages:
- stage: android_device_tests
displayName: Android Device Tests
dependsOn: []
- stage: android_device_tests_${{ replace(parameters.targetFrameworkVersion.tfm, '.', '') }}
displayName: ${{ parameters.targetFrameworkVersion.tfm }} Android Device Tests
${{ if ne(parameters.targetFrameworkVersion.dependsOn, '') }}:
dependsOn:
- android_device_tests_${{ replace(parameters.targetFrameworkVersion.dependsOn, '.', '') }}
${{ else }}:
dependsOn: []
jobs:
- job: android_device_tests
- job: android_device_tests_${{ replace(parameters.targetFrameworkVersion.tfm, '.', '') }}
workspace:
clean: all
displayName: "Android emulator tests"
displayName: "Android"
pool: ${{ parameters.androidPool }}
timeoutInMinutes: 60
strategy:
Expand All @@ -41,6 +48,7 @@ stages:
${{ replace(coalesce(project.desc, project.name), ' ', '_') }}_API_${{ api }}:
REQUIRED_XCODE: $(DEVICETESTS_REQUIRED_XCODE)
PROJECT_PATH: ${{ project.android }}
TARGET_FRAMEWORK_VERSION: ${{ parameters.targetFrameworkVersion.tfm }}
${{ if eq(api, 27) }}:
DEVICE: android-emulator-32_${{ api }}
APIVERSION: ${{ api }}
Expand All @@ -63,14 +71,18 @@ stages:
useArtifacts: ${{ parameters.useArtifacts }}
poolName: ${{ parameters.androidPool.name }}

- stage: ios_device_tests
displayName: iOS Device Tests
dependsOn: []
- stage: ios_device_tests_${{ replace(parameters.targetFrameworkVersion.tfm, '.', '') }}
displayName: ${{ parameters.targetFrameworkVersion.tfm }} iOS Device Tests
${{ if ne(parameters.targetFrameworkVersion.dependsOn, '') }}:
dependsOn:
- ios_device_tests_${{ replace(parameters.targetFrameworkVersion.dependsOn, '.', '') }}
${{ else }}:
dependsOn: []
jobs:
- job: ios_device_tests
- job: ios_device_tests_${{ replace(parameters.targetFrameworkVersion.tfm, '.', '') }}
workspace:
clean: all
displayName: "iOS tests"
displayName: "iOS"
pool: ${{ parameters.iosPool }}
timeoutInMinutes: 120
strategy:
Expand All @@ -83,6 +95,7 @@ stages:
${{ replace(coalesce(project.desc, project.name), ' ', '_') }}_V_${{ version }}:
REQUIRED_XCODE: $(DEVICETESTS_REQUIRED_XCODE)
PROJECT_PATH: ${{ project.ios }}
TARGET_FRAMEWORK_VERSION: ${{ parameters.targetFrameworkVersion.tfm }}
${{ if contains(version, 'device') }}:
DEVICE: ios-device
APIVERSION: ${{ replace(version, 'device-', '') }}
Expand All @@ -105,14 +118,18 @@ stages:
useArtifacts: ${{ parameters.useArtifacts }}
poolName: 'Azure Pipelines'

- stage: catalyst_device_tests
displayName: macOS Device Tests
dependsOn: []
- stage: catalyst_device_tests_${{ replace(parameters.targetFrameworkVersion.tfm, '.', '') }}
displayName: ${{ parameters.targetFrameworkVersion.tfm }} macOS Device Tests
${{ if ne(parameters.targetFrameworkVersion.dependsOn, '') }}:
dependsOn:
- catalyst_device_tests_${{ replace(parameters.targetFrameworkVersion.dependsOn, '.', '') }}
${{ else }}:
dependsOn: []
jobs:
- job: catalyst_device_tests
- job: catalyst_device_tests_${{ replace(parameters.targetFrameworkVersion.tfm, '.', '') }}
workspace:
clean: all
displayName: "macOS tests"
displayName: "macOS"
pool: ${{ parameters.catalystPool }}
timeoutInMinutes: 240
strategy:
Expand All @@ -125,6 +142,7 @@ stages:
${{ replace(coalesce(project.desc, project.name), ' ', '_') }}_V_${{ version }}:
REQUIRED_XCODE: $(DEVICETESTS_REQUIRED_XCODE)
PROJECT_PATH: ${{ project.catalyst }}
TARGET_FRAMEWORK_VERSION: ${{ parameters.targetFrameworkVersion.tfm }}
${{ if eq(version, 'latest') }}:
DEVICE: maccatalyst
${{ else }}:
Expand All @@ -146,14 +164,18 @@ stages:
poolName: 'Azure Pipelines'


- stage: windows_device_tests
displayName: Windows Device Tests
dependsOn: []
- stage: windows_device_tests_${{ replace(parameters.targetFrameworkVersion.tfm, '.', '') }}
displayName: ${{ parameters.targetFrameworkVersion.tfm }} Windows Device Tests
${{ if ne(parameters.targetFrameworkVersion.dependsOn, '') }}:
dependsOn:
- windows_device_tests_${{ replace(parameters.targetFrameworkVersion.dependsOn, '.', '') }}
${{ else }}:
dependsOn: []
jobs:
- job: windows_device_tests
- job: windows_device_tests_${{ replace(parameters.targetFrameworkVersion.tfm, '.', '') }}
workspace:
clean: all
displayName: "Windows device tests"
displayName: "Windows"
pool: ${{ parameters.windowsPool }}
timeoutInMinutes: 240 # how long to run the job before automatically cancelling
strategy:
Expand All @@ -166,6 +188,7 @@ stages:
PROJECT_PATH: ${{ project.windows }}
PACKAGE_ID: ${{ project.windowsPackageId }}
DEVICE: ${{ version }}
TARGET_FRAMEWORK_VERSION: ${{ parameters.targetFrameworkVersion.tfm }}
steps:
- template: device-tests-steps.yml
parameters:
Expand Down
Loading