diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 83416bf20f4b6..5c986e6464b5e 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -183,6 +183,47 @@ stages: SYSTEM_ACCESSTOKEN: $(System.AccessToken) HelixAccessToken: '' + - stage: Test_CLI_Manual_Commands_In_Helix_Android + displayName: 'CLI Android Manual Commands Integration tests (Helix SDK)' + dependsOn: Build_OSX + jobs: + - template: /eng/common/templates/jobs/jobs.yml + parameters: + workspace: + clean: all + jobs: + - job: Linux + pool: + vmimage: ubuntu-latest + strategy: + matrix: + Build_Debug: + _BuildConfig: Debug + preSteps: + - checkout: self + clean: true + displayName: Submit Helix Job + steps: + - task: DownloadPipelineArtifact@2 + inputs: + source: current + artifact: Microsoft.DotNet.XHarness.CLI.Debug + path: $(Build.SourcesDirectory)/artifacts/packages/$(_BuildConfig)/Shipping/ + + - script: eng/common/build.sh + --configuration $(_BuildConfig) + --prepareMachine + --ci + --restore + --test + --projects $(Build.SourcesDirectory)/tests/integration-tests/Android/Android.CLI.Commands.Tests.proj + /bl:$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/Android.CLI.Commands.Tests.binlog + /p:RestoreUsingNuGetTargets=false + displayName: Run Helix Tests + env: + SYSTEM_ACCESSTOKEN: $(System.AccessToken) + HelixAccessToken: '' + - stage: Test_CLI_Package_In_Helix_Apple displayName: 'CLI Apple Integration tests (Helix SDK)' dependsOn: Build_OSX diff --git a/src/Microsoft.DotNet.XHarness.CLI/Commands/Android/AndroidGetDeviceCommand.cs b/src/Microsoft.DotNet.XHarness.CLI/Commands/Android/AndroidGetDeviceCommand.cs index 751e75bceef8f..81a611f6a20e1 100644 --- a/src/Microsoft.DotNet.XHarness.CLI/Commands/Android/AndroidGetDeviceCommand.cs +++ b/src/Microsoft.DotNet.XHarness.CLI/Commands/Android/AndroidGetDeviceCommand.cs @@ -17,7 +17,10 @@ namespace Microsoft.DotNet.XHarness.CLI.Commands.Android { internal class AndroidGetDeviceCommand : XHarnessCommand { - private readonly AndroidGetDeviceCommandArguments _arguments = new(); + private readonly AndroidGetDeviceCommandArguments _arguments = new() + { + Verbosity = LogLevel.Error + }; protected override XHarnessCommandArguments Arguments => _arguments; diff --git a/tests/integration-tests/Android/Android.CLI.Commands.Tests.proj b/tests/integration-tests/Android/Android.CLI.Commands.Tests.proj new file mode 100644 index 0000000000000..783a4a688d593 --- /dev/null +++ b/tests/integration-tests/Android/Android.CLI.Commands.Tests.proj @@ -0,0 +1,68 @@ + + + + + netcoreapp3.1 + + 3.1 + .NETCoreApp + test/product/ + true + $(AGENT_JOBNAME) + true + https://helix.dot.net + + 1.0.0-ci + $(ArtifactsShippingPackagesDir)/Microsoft.DotNet.XHarness.CLI.$(MicrosoftDotNetXHarnessCLIVersion).nupkg + + + + + false + 1.0.0-dev + + + + + + + + + true + $(BUILD_SOURCEVERSIONAUTHOR) + anon + + + + https://netcorenativeassets.blob.core.windows.net/resource-packages/external/android/test-apk/x86/System.Numerics.Vectors.Tests-x86.zip + + + + + msbuild + + + + + + + + + + + + + + set -ex; + deviceId=`dotnet exec "$XHARNESS_CLI_PATH" android device --app="$HELIX_WORKITEM_PAYLOAD/System.Numerics.Vectors.Tests-x86.apk"`; + dotnet exec $XHARNESS_CLI_PATH android install --device-id="$deviceId" --output-directory="$HELIX_WORKITEM_UPLOAD_ROOT" --package-name="net.dot.System.Numerics.Vectors.Tests" --app="$HELIX_WORKITEM_PAYLOAD/System.Numerics.Vectors.Tests-x86.apk"; + dotnet exec "$XHARNESS_CLI_PATH" android run --device-id="$deviceId" --output-directory="$HELIX_WORKITEM_UPLOAD_ROOT" --package-name="net.dot.System.Numerics.Vectors.Tests"; + dotnet exec "$XHARNESS_CLI_PATH" android uninstall --device-id="$deviceId" --package-name="net.dot.System.Numerics.Vectors.Tests" + + @(DownloadedApkFile) + + + + + +