diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index ce650dda091..e01e9a8c605 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -39,9 +39,9 @@ https://github.com/dotnet/arcade-services cac955fe259cb611f6a29d09209bd717deb69037 - + https://github.com/dotnet/xharness - 98970876f4d21e6da5198a5c41de51ab1101089f + debdb2b11d810cea0435f5d086c0bf17b3ee6402 https://github.com/dotnet/roslyn diff --git a/eng/Versions.props b/eng/Versions.props index 52274c92638..6cce36ce8f0 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -80,7 +80,7 @@ 6.0.0-beta.21277.1 1.0.0-beta.21277.1 1.1.0-beta.21228.1 - 1.0.0-prerelease.21271.1 + 1.0.0-prerelease.21303.1 1.1.156402 1.1.152002 6.0.100-preview.5.21254.11 diff --git a/src/Microsoft.DotNet.Helix/Sdk.Tests/Microsoft.DotNet.Helix.Sdk.Tests/CreateXHarnessAppleWorkItemsTests.cs b/src/Microsoft.DotNet.Helix/Sdk.Tests/Microsoft.DotNet.Helix.Sdk.Tests/CreateXHarnessAppleWorkItemsTests.cs index c8da05191ec..b1c76a859a2 100644 --- a/src/Microsoft.DotNet.Helix/Sdk.Tests/Microsoft.DotNet.Helix.Sdk.Tests/CreateXHarnessAppleWorkItemsTests.cs +++ b/src/Microsoft.DotNet.Helix/Sdk.Tests/Microsoft.DotNet.Helix.Sdk.Tests/CreateXHarnessAppleWorkItemsTests.cs @@ -87,7 +87,7 @@ public void AppleXHarnessWorkItemIsCreated() var command = workItem.GetMetadata("Command"); command.Should().Contain("System.Foo.app"); - command.Should().Contain("--targets \"ios-device_13.5\""); + command.Should().Contain("--target \"ios-device_13.5\""); command.Should().Contain("--timeout \"00:08:55\""); command.Should().Contain("--launch-timeout \"00:02:33\""); @@ -181,7 +181,7 @@ public void AreDependenciesRegistered() private ITaskItem CreateAppBundle( string path, - string targets, + string target, string? workItemTimeout = null, string? testTimeout = null, string? launchTimeout = null, @@ -191,7 +191,7 @@ private ITaskItem CreateAppBundle( { var mockBundle = new Mock(); mockBundle.SetupGet(x => x.ItemSpec).Returns(path); - mockBundle.Setup(x => x.GetMetadata(CreateXHarnessAppleWorkItems.MetadataNames.Targets)).Returns(targets); + mockBundle.Setup(x => x.GetMetadata(CreateXHarnessAppleWorkItems.MetadataNames.Target)).Returns(target); mockBundle.Setup(x => x.GetMetadata(CreateXHarnessAppleWorkItems.MetadataNames.IncludesTestRunner)).Returns(includesTestRunner.ToString()); if (workItemTimeout != null) diff --git a/src/Microsoft.DotNet.Helix/Sdk.Tests/Microsoft.DotNet.Helix.Sdk.Tests/ProvisioningProfileProviderTests.cs b/src/Microsoft.DotNet.Helix/Sdk.Tests/Microsoft.DotNet.Helix.Sdk.Tests/ProvisioningProfileProviderTests.cs index 0c079af5ced..f84e7a6f117 100644 --- a/src/Microsoft.DotNet.Helix/Sdk.Tests/Microsoft.DotNet.Helix.Sdk.Tests/ProvisioningProfileProviderTests.cs +++ b/src/Microsoft.DotNet.Helix/Sdk.Tests/Microsoft.DotNet.Helix.Sdk.Tests/ProvisioningProfileProviderTests.cs @@ -133,7 +133,7 @@ private static ITaskItem CreateAppBundle(string path, string targets) { var mockBundle = new Mock(); mockBundle.SetupGet(x => x.ItemSpec).Returns(path); - mockBundle.Setup(x => x.GetMetadata(CreateXHarnessAppleWorkItems.MetadataNames.Targets)).Returns(targets); + mockBundle.Setup(x => x.GetMetadata(CreateXHarnessAppleWorkItems.MetadataNames.Target)).Returns(targets); return mockBundle.Object; } } diff --git a/src/Microsoft.DotNet.Helix/Sdk/CreateXHarnessAppleWorkItems.cs b/src/Microsoft.DotNet.Helix/Sdk/CreateXHarnessAppleWorkItems.cs index 1145d896658..d61f7db5660 100644 --- a/src/Microsoft.DotNet.Helix/Sdk/CreateXHarnessAppleWorkItems.cs +++ b/src/Microsoft.DotNet.Helix/Sdk/CreateXHarnessAppleWorkItems.cs @@ -20,7 +20,7 @@ public class CreateXHarnessAppleWorkItems : XHarnessTaskBase public static class MetadataNames { - public const string Targets = "Targets"; + public const string Target = "TestTarget"; public const string LaunchTimeout = "LaunchTimeout"; public const string IncludesTestRunner = "IncludesTestRunner"; public const string ResetSimulator = "ResetSimulator"; @@ -102,14 +102,14 @@ private async Task PrepareWorkItem( var (testTimeout, workItemTimeout, expectedExitCode, customCommands) = ParseMetadata(appBundleItem); // Validation of any metadata specific to iOS stuff goes here - if (!appBundleItem.TryGetMetadata(MetadataNames.Targets, out string targets)) + if (!appBundleItem.TryGetMetadata(MetadataNames.Target, out string target)) { - Log.LogError($"'{MetadataNames.Targets}' metadata must be specified - " + + Log.LogError($"'{MetadataNames.Target}' metadata must be specified - " + "expecting list of target device/simulator platforms to execute tests on (e.g. ios-simulator-64)"); return null; } - targets = targets.ToLowerInvariant(); + target = target.ToLowerInvariant(); // Optional timeout for the how long it takes for the app to be installed, booted and tests start executing TimeSpan launchTimeout = s_defaultLaunchTimeout; @@ -151,7 +151,7 @@ private async Task PrepareWorkItem( customCommands = $"xharness apple {(includesTestRunner ? "test" : "run")} " + "--app \"$app\" " + "--output-directory \"$output_directory\" " + - "--targets \"$targets\" " + + "--target \"$target\" " + "--timeout \"$timeout\" " + (includesTestRunner ? $"--launch-timeout \"$launch_timeout\" " @@ -163,7 +163,7 @@ private async Task PrepareWorkItem( } string appName = fileSystem.GetFileName(appBundleItem.ItemSpec); - string helixCommand = GetHelixCommand(appName, targets, testTimeout, launchTimeout, includesTestRunner, expectedExitCode, resetSimulator); + string helixCommand = GetHelixCommand(appName, target, testTimeout, launchTimeout, includesTestRunner, expectedExitCode, resetSimulator); string payloadArchivePath = await CreateZipArchiveOfFolder(zipArchiveManager, fileSystem, appFolderPath, customCommands); Log.LogMessage($"Creating work item with properties Identity: {workItemName}, Payload: {appFolderPath}, Command: {helixCommand}"); @@ -179,7 +179,7 @@ private async Task PrepareWorkItem( private string GetHelixCommand( string appName, - string targets, + string target, TimeSpan testTimeout, TimeSpan launchTimeout, bool includesTestRunner, @@ -188,7 +188,7 @@ private string GetHelixCommand( => $"chmod +x {EntryPointScript} && ./{EntryPointScript} " + $"--app \"{appName}\" " + - $"--targets \"{targets}\" " + + $"--target \"{target}\" " + $"--timeout \"{testTimeout}\" " + $"--launch-timeout \"{launchTimeout}\" " + (includesTestRunner ? "--includes-test-runner " : string.Empty) + diff --git a/src/Microsoft.DotNet.Helix/Sdk/ProvisioningProfileProvider.cs b/src/Microsoft.DotNet.Helix/Sdk/ProvisioningProfileProvider.cs index 1adb6080b39..b1c88bc5ace 100644 --- a/src/Microsoft.DotNet.Helix/Sdk/ProvisioningProfileProvider.cs +++ b/src/Microsoft.DotNet.Helix/Sdk/ProvisioningProfileProvider.cs @@ -62,7 +62,7 @@ public void AddProfilesToBundles(ITaskItem[] appBundles) foreach (var appBundle in appBundles) { - if (!appBundle.TryGetMetadata(CreateXHarnessAppleWorkItems.MetadataNames.Targets, out string bundleTargets)) + if (!appBundle.TryGetMetadata(CreateXHarnessAppleWorkItems.MetadataNames.Target, out string bundleTargets)) { _log.LogError("'Targets' metadata must be specified - " + "expecting list of target device/simulator platforms to execute tests on (e.g. ios-simulator-64)"); diff --git a/src/Microsoft.DotNet.Helix/Sdk/tools/xharness-runner/Readme.md b/src/Microsoft.DotNet.Helix/Sdk/tools/xharness-runner/Readme.md index 38f94eab3d7..c953bbbb06c 100644 --- a/src/Microsoft.DotNet.Helix/Sdk/tools/xharness-runner/Readme.md +++ b/src/Microsoft.DotNet.Helix/Sdk/tools/xharness-runner/Readme.md @@ -59,13 +59,13 @@ To execute .app bundles, declare one or more `XHarnessAppBundleToTest` items: - ios-simulator-64_13.5 + ios-simulator-64_13.5 ``` -The `` metadata is a required configuration that tells XHarness which kind of device/Simulator to target. -Use the XHarness CLI help command to find more (see the `--targets` option). +The `` metadata is a required configuration that tells XHarness which kind of device/Simulator to target. +Use the XHarness CLI help command to find more (see the `--target` option). You can also specify some additional metadata that will help you configure the run better: @@ -163,17 +163,17 @@ Example: ```xml - ios-simulator-64 + ios-simulator-64 00:12:00 set -e - deviceId=`xharness apple device $targets` - xharness apple install -t $targets --device "$deviceId" -o "$output_directory" --app=$app + deviceId=`xharness apple device $target` + xharness apple install -t $target --device "$deviceId" -o "$output_directory" --app=$app set +e result=0 - xharness apple just-test -t $targets --device "$deviceId" -o "$output_directory" --app net.dot.Some.iOS --timeout 00:08:00 + xharness apple just-test -t $target --device "$deviceId" -o "$output_directory" --app net.dot.Some.iOS --timeout 00:08:00 ((result|=$?)) - xharness apple uninstall -t $targets --device "$deviceId" -o "$output_directory" --app net.dot.Some.iOS + xharness apple uninstall -t $target --device "$deviceId" -o "$output_directory" --app net.dot.Some.iOS ((result|=$?)) exit $result @@ -187,7 +187,7 @@ When using `CustomCommands`, several variables will be defined for you for easie - `$app` - path to the application - `$output_directory` - path under which all files will be uploaded to Helix at the end of the job - If a file named `testResults.xml` is found containing xUnit results, it will be uploaded back to Azure DevOps -- `$targets`, `$timeout`, `$launch_timeout`, `$expected_exit_code`, `$includes_test_runner` - parsed metadata defined on the original `XHarnessAppBundleToTest` MSBuild item +- `$target`, `$timeout`, `$launch_timeout`, `$expected_exit_code`, `$includes_test_runner` - parsed metadata defined on the original `XHarnessAppBundleToTest` MSBuild item #### Variables defined for Android scenarios Android is currently not supported - coming soon! diff --git a/src/Microsoft.DotNet.Helix/Sdk/tools/xharness-runner/xharness-runner.apple.sh b/src/Microsoft.DotNet.Helix/Sdk/tools/xharness-runner/xharness-runner.apple.sh index a4f3f119607..09e2d117e7d 100644 --- a/src/Microsoft.DotNet.Helix/Sdk/tools/xharness-runner/xharness-runner.apple.sh +++ b/src/Microsoft.DotNet.Helix/Sdk/tools/xharness-runner/xharness-runner.apple.sh @@ -8,7 +8,7 @@ app='' output_directory='' -targets='' +target='' timeout='' launch_timeout='' xharness_cli_path='' @@ -29,8 +29,8 @@ while [[ $# -gt 0 ]]; do output_directory="$2" shift ;; - --targets) - targets="$2" + --target) + target="$2" shift ;; --timeout) @@ -77,8 +77,8 @@ if [ -z "$app" ]; then die "App bundle path wasn't provided"; fi -if [ -z "$targets" ]; then - die "No targets were provided"; +if [ -z "$target" ]; then + die "No target were provided"; fi if [ -z "$output_directory" ]; then @@ -96,7 +96,7 @@ else fi # Signing -if [ "$targets" == 'ios-device' ] || [ "$targets" == 'tvos-device' ]; then +if [ "$target" == 'ios-device' ] || [ "$target" == 'tvos-device' ]; then echo "Real device target detected, application will be signed" provisioning_profile="$app/embedded.mobileprovision" diff --git a/tests/XHarness/XHarness.Device.AppleRun.proj b/tests/XHarness/XHarness.Device.AppleRun.proj index 783e474c297..db3041c52c1 100644 --- a/tests/XHarness/XHarness.Device.AppleRun.proj +++ b/tests/XHarness/XHarness.Device.AppleRun.proj @@ -20,7 +20,7 @@ - ios-device + ios-device 00:05:00 00:04:00 00:03:00 diff --git a/tests/XHarness/XHarness.Simulator.AppleRun.proj b/tests/XHarness/XHarness.Simulator.AppleRun.proj index ae243e11185..c67a80201e5 100644 --- a/tests/XHarness/XHarness.Simulator.AppleRun.proj +++ b/tests/XHarness/XHarness.Simulator.AppleRun.proj @@ -20,7 +20,7 @@ - ios-simulator-64 + ios-simulator-64 00:12:00 00:08:00 00:05:00 diff --git a/tests/XHarness/XHarness.Simulator.AppleTest.proj b/tests/XHarness/XHarness.Simulator.AppleTest.proj index 63e90f432f0..49c9f339a8d 100644 --- a/tests/XHarness/XHarness.Simulator.AppleTest.proj +++ b/tests/XHarness/XHarness.Simulator.AppleTest.proj @@ -20,7 +20,7 @@ - ios-simulator-64 + ios-simulator-64 00:05:00 00:15:00 00:06:00 diff --git a/tests/XHarness/XHarness.Simulator.CustomCommands.proj b/tests/XHarness/XHarness.Simulator.CustomCommands.proj index acf82c3e966..7addd4e661e 100644 --- a/tests/XHarness/XHarness.Simulator.CustomCommands.proj +++ b/tests/XHarness/XHarness.Simulator.CustomCommands.proj @@ -20,19 +20,19 @@ - ios-simulator-64 + ios-simulator-64 00:15:00 00:05:00 00:05:00 set -ex - deviceId=`xharness apple device $targets` - xharness apple install -t=$targets --device="$deviceId" -o="$output_directory" --app="$app" -v + deviceId=`xharness apple device $target` + xharness apple install -t=$target --device="$deviceId" -o="$output_directory" --app="$app" -v set +e result=0 - xharness apple just-test -t=$targets --device="$deviceId" -o="$output_directory" --app="net.dot.$(XHarnessAppBundleName)" --launch-timeout=$launch_timeout --timeout=$timeout -v + xharness apple just-test -t=$target --device="$deviceId" -o="$output_directory" --app="net.dot.$(XHarnessAppBundleName)" --launch-timeout=$launch_timeout --timeout=$timeout -v ((result|=$?)) - xharness apple uninstall -t=$targets --device="$deviceId" -o="$output_directory" --app="net.dot.$(XHarnessAppBundleName)" -v + xharness apple uninstall -t=$target --device="$deviceId" -o="$output_directory" --app="net.dot.$(XHarnessAppBundleName)" -v ((result|=$?)) exit $result