mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-26 19:52:38 +00:00
Merge branch 'carzh/browserstack-android-fix' into carzh/nuget-test-android-no-build
This commit is contained in:
commit
9f9f23dd81
3 changed files with 113 additions and 124 deletions
|
|
@ -29,20 +29,6 @@ namespace Microsoft.ML.OnnxRuntime.Tests.BrowserStack.Android
|
|||
driver = new AndroidDriver(new Uri("http://127.0.0.1:4723/wd/hub"), androidOptions);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sends a log to BrowserStack that is visible in the text logs and labeled as ANNOTATION.
|
||||
/// </summary>
|
||||
/// <param name="text">Log text to send.</param>
|
||||
/// <param name="logLevel">Log level -- choose between info, debug, warning, and error</param>
|
||||
public void browserStackLog(String text, String logLevel = "info")
|
||||
{
|
||||
String jsonToSend = String.Format(
|
||||
"browserstack_executor: {\"action\": \"annotate\", \"arguments\": {\"data\": {0}, \"level\": {1}}}",
|
||||
JsonConvert.ToString(text), JsonConvert.ToString(logLevel));
|
||||
|
||||
((IJavaScriptExecutor)driver).ExecuteScript(jsonToSend);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Passes the correct test status to BrowserStack and ensures the driver quits.
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ namespace Microsoft.ML.OnnxRuntime.Tests.BrowserStack.Android
|
|||
public async Task ClickRunAllTest()
|
||||
{
|
||||
// XAML for the main page:
|
||||
// https://github.com/mattleibow/DeviceRunners/blob/main/src/DeviceRunners.VisualRunners.Maui/App/Pages/HomePage.xaml
|
||||
// https://github.com/mattleibow/DeviceRunners/blob/cba7644e07b305ba64dc930b01c3eee55ef2b93d/src/DeviceRunners.VisualRunners.Maui/App/Pages/HomePage.xaml
|
||||
AppiumElement runAllButton = FindAppiumElementThenClick("//android.widget.Button", "Run All");
|
||||
|
||||
while (!runAllButton.Enabled)
|
||||
|
|
@ -93,7 +93,6 @@ namespace Microsoft.ML.OnnxRuntime.Tests.BrowserStack.Android
|
|||
|
||||
if (numFailed == 0)
|
||||
{
|
||||
Assert.Pass();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,132 +1,136 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<OnnxRuntimeRoot>$(ProjectDir)..\..\..</OnnxRuntimeRoot>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OnnxRuntimeRoot>$(ProjectDir)..\..\..</OnnxRuntimeRoot>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="../Microsoft.ML.OnnxRuntime.Tests.Common/NativeLibraryInclude.props" />
|
||||
<Import Project="../Microsoft.ML.OnnxRuntime.Tests.Common/NativeLibraryInclude.props" />
|
||||
|
||||
<!-- General app properties -->
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net8.0-android;net8.0-ios;net8.0-maccatalyst</TargetFrameworks>
|
||||
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
|
||||
<!-- General app properties -->
|
||||
<PropertyGroup>
|
||||
<!-- Currently running into issues with net8.0-ios and net8.0-maccatalyst that is blocking
|
||||
packaging pipelines. Disabling those targets until the issues are resolved. -->
|
||||
<!-- <TargetFrameworks>net8.0-android;net8.0-ios;net8.0-maccatalyst</TargetFrameworks> -->
|
||||
|
||||
<!-- Note for MacCatalyst:
|
||||
The default runtime is maccatalyst-x64, except in Release config, in which case the default is maccatalyst-x64;maccatalyst-arm64.
|
||||
When specifying both architectures, use the plural <RuntimeIdentifiers> instead of the singular <RuntimeIdentifier>.
|
||||
The Mac App Store will NOT accept apps with ONLY maccatalyst-arm64 indicated;
|
||||
either BOTH runtimes must be indicated or ONLY macatalyst-x64. -->
|
||||
<!-- For example: <RuntimeIdentifiers>maccatalyst-x64;maccatalyst-arm64</RuntimeIdentifiers> -->
|
||||
<TargetFrameworks>net8.0-android</TargetFrameworks>
|
||||
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
|
||||
|
||||
<RootNamespace>Microsoft.ML.OnnxRuntime.Tests.MAUI</RootNamespace>
|
||||
<UseMaui>true</UseMaui>
|
||||
<SingleProject>true</SingleProject>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<!-- some of the helper packages don't have strong named assemblies. -->
|
||||
<NoWarn>8002</NoWarn>
|
||||
<!-- Note for MacCatalyst:
|
||||
The default runtime is maccatalyst-x64, except in Release config, in which case the default is maccatalyst-x64;maccatalyst-arm64.
|
||||
When specifying both architectures, use the plural <RuntimeIdentifiers> instead of the singular <RuntimeIdentifier>.
|
||||
The Mac App Store will NOT accept apps with ONLY maccatalyst-arm64 indicated;
|
||||
either BOTH runtimes must be indicated or ONLY macatalyst-x64. -->
|
||||
<!-- For example: <RuntimeIdentifiers>maccatalyst-x64;maccatalyst-arm64</RuntimeIdentifiers> -->
|
||||
|
||||
<!-- These are copied from the sample. TBD what we really need. -->
|
||||
<DefineConstants Condition="'$(CI)' != 'true'">$(DefineConstants);INCLUDE_FAILING_TESTS</DefineConstants>
|
||||
<DefineConstants Condition="'$(TestingMode)' == 'NonInteractiveVisual'">$(DefineConstants);MODE_NON_INTERACTIVE_VISUAL</DefineConstants>
|
||||
<DefineConstants Condition="'$(TestingMode)' == 'XHarness'">$(DefineConstants);MODE_XHARNESS</DefineConstants>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>Microsoft.ML.OnnxRuntime.Tests.MAUI</RootNamespace>
|
||||
<UseMaui>true</UseMaui>
|
||||
<SingleProject>true</SingleProject>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<!-- some of the helper packages don't have strong named assemblies. -->
|
||||
<NoWarn>8002</NoWarn>
|
||||
|
||||
<!-- Display name -->
|
||||
<ApplicationTitle>Microsoft.ML.OnnxRuntime.Tests.MAUI</ApplicationTitle>
|
||||
<!-- These are copied from the sample. TBD what we really need. -->
|
||||
<DefineConstants Condition="'$(CI)' != 'true'">$(DefineConstants);INCLUDE_FAILING_TESTS</DefineConstants>
|
||||
<DefineConstants Condition="'$(TestingMode)' == 'NonInteractiveVisual'">$(DefineConstants);MODE_NON_INTERACTIVE_VISUAL</DefineConstants>
|
||||
<DefineConstants Condition="'$(TestingMode)' == 'XHarness'">$(DefineConstants);MODE_XHARNESS</DefineConstants>
|
||||
|
||||
<!-- App Identifier. MUST be short or you get a misleading error about not being able to deploy the app -->
|
||||
<ApplicationId>ORT.CSharp.Tests.MAUI</ApplicationId>
|
||||
<!-- Display name -->
|
||||
<ApplicationTitle>Microsoft.ML.OnnxRuntime.Tests.MAUI</ApplicationTitle>
|
||||
|
||||
<!-- Versions -->
|
||||
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
|
||||
<ApplicationVersion>1</ApplicationVersion>
|
||||
<!-- App Identifier. MUST be short or you get a misleading error about not being able to deploy the app -->
|
||||
<ApplicationId>ORT.CSharp.Tests.MAUI</ApplicationId>
|
||||
|
||||
<SupportedOSPlatformVersion Condition="'$(IsIOSTarget)' == 'true'">15.0</SupportedOSPlatformVersion>
|
||||
<SupportedOSPlatformVersion Condition="'$(IsMacCatalystTarget)' == 'true'">13.1</SupportedOSPlatformVersion>
|
||||
<SupportedOSPlatformVersion Condition="'$(IsAndroidTarget)' == 'true'">30.0</SupportedOSPlatformVersion>
|
||||
<SupportedOSPlatformVersion Condition="'$(IsWindowsTarget)' == 'true'">10.0.17763.0</SupportedOSPlatformVersion>
|
||||
<TargetPlatformMinVersion Condition="'$(IsWindowsTarget)' == 'true'">10.0.17763.0</TargetPlatformMinVersion>
|
||||
<!-- Versions -->
|
||||
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
|
||||
<ApplicationVersion>1</ApplicationVersion>
|
||||
|
||||
<SignAssembly>true</SignAssembly>
|
||||
<AssemblyOriginatorKeyFile>..\..\OnnxRuntime.snk</AssemblyOriginatorKeyFile>
|
||||
<PublishRelease>true</PublishRelease>
|
||||
</PropertyGroup>
|
||||
<SupportedOSPlatformVersion Condition="'$(IsIOSTarget)' == 'true'">15.0</SupportedOSPlatformVersion>
|
||||
<SupportedOSPlatformVersion Condition="'$(IsMacCatalystTarget)' == 'true'">13.1</SupportedOSPlatformVersion>
|
||||
<SupportedOSPlatformVersion Condition="'$(IsAndroidTarget)' == 'true'">30.0</SupportedOSPlatformVersion>
|
||||
<SupportedOSPlatformVersion Condition="'$(IsWindowsTarget)' == 'true'">10.0.17763.0</SupportedOSPlatformVersion>
|
||||
<TargetPlatformMinVersion Condition="'$(IsWindowsTarget)' == 'true'">10.0.17763.0</TargetPlatformMinVersion>
|
||||
|
||||
<ItemGroup>
|
||||
<!-- App Icon -->
|
||||
<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" />
|
||||
<SignAssembly>true</SignAssembly>
|
||||
<AssemblyOriginatorKeyFile>..\..\OnnxRuntime.snk</AssemblyOriginatorKeyFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Splash Screen -->
|
||||
<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#512BD4" BaseSize="128,128" />
|
||||
<ItemGroup>
|
||||
<!-- App Icon -->
|
||||
<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" />
|
||||
|
||||
<!-- Images -->
|
||||
<MauiImage Include="Resources\Images\*" />
|
||||
<MauiImage Update="Resources\Images\dotnet_bot.png" Resize="True" BaseSize="300,185" />
|
||||
<!-- Splash Screen -->
|
||||
<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#512BD4" BaseSize="128,128" />
|
||||
|
||||
<!-- Custom Fonts -->
|
||||
<MauiFont Include="Resources\Fonts\*" />
|
||||
<!-- Images -->
|
||||
<MauiImage Include="Resources\Images\*" />
|
||||
<MauiImage Update="Resources\Images\dotnet_bot.png" Resize="True" BaseSize="300,185" />
|
||||
|
||||
<!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
|
||||
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
|
||||
</ItemGroup>
|
||||
<!-- Custom Fonts -->
|
||||
<MauiFont Include="Resources\Fonts\*" />
|
||||
|
||||
<!-- NOTE: The xUnit framework doesn't pickup the tests defined within the referenced
|
||||
Microsoft.ML.OnnxRuntime.Tests.Common project -->
|
||||
<ItemGroup>
|
||||
<Compile Include="..\Microsoft.ML.OnnxRuntime.Tests.Common\InferenceTest.cs">
|
||||
<Link>InferenceTest.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Microsoft.ML.OnnxRuntime.Tests.Common\OrtIoBindingAllocationTest.cs">
|
||||
<Link>OrtIoBindingAllocationTest.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Microsoft.ML.OnnxRuntime.Tests.Common\Tensors\TensorTests.cs">
|
||||
<Link>TensorTests.cs</Link>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
|
||||
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference
|
||||
Include="..\..\src\Microsoft.ML.OnnxRuntime\Microsoft.ML.OnnxRuntime.csproj"
|
||||
name="Microsoft.ML.OnnxRuntime" />
|
||||
<ProjectReference
|
||||
Include="..\Microsoft.ML.OnnxRuntime.Tests.Common\Microsoft.ML.OnnxRuntime.Tests.Common.csproj"
|
||||
name="Microsoft.ML.OnnxRuntime.Tests.Common" />
|
||||
<ProjectReference
|
||||
Include="..\Microsoft.ML.OnnxRuntime.Tests.Devices\Microsoft.ML.OnnxRuntime.Tests.Devices.csproj"
|
||||
name="Microsoft.ML.OnnxRuntime.Tests.Devices" />
|
||||
</ItemGroup>
|
||||
<!-- NOTE: The xUnit framework doesn't pickup the tests defined within the referenced
|
||||
Microsoft.ML.OnnxRuntime.Tests.Common project -->
|
||||
<ItemGroup>
|
||||
<Compile Include="..\Microsoft.ML.OnnxRuntime.Tests.Common\InferenceTest.cs">
|
||||
<Link>InferenceTest.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Microsoft.ML.OnnxRuntime.Tests.Common\OrtIoBindingAllocationTest.cs">
|
||||
<Link>OrtIoBindingAllocationTest.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Microsoft.ML.OnnxRuntime.Tests.Common\Tensors\TensorTests.cs">
|
||||
<Link>TensorTests.cs</Link>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="DeviceRunners.VisualRunners.Maui" Version="0.1.0-preview.2" />
|
||||
<PackageReference Include="DeviceRunners.VisualRunners.Xunit" Version="0.1.0-preview.2" />
|
||||
<PackageReference Include="DeviceRunners.XHarness.Maui" Version="0.1.0-preview.2" />
|
||||
<PackageReference Include="DeviceRunners.XHarness.Xunit" Version="0.1.0-preview.2" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
|
||||
<PackageReference Include="Microsoft.DotNet.XHarness.TestRunners.Xunit" Version="9.0.0-prerelease.24374.1" />
|
||||
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.70" />
|
||||
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.70" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
|
||||
<PackageReference Include="xunit" Version="2.9.0" />
|
||||
<PackageReference Include="xunit.runner.utility" Version="2.9.0" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\src\Microsoft.ML.OnnxRuntime\Microsoft.ML.OnnxRuntime.csproj" name="Microsoft.ML.OnnxRuntime" />
|
||||
<ProjectReference Include="..\Microsoft.ML.OnnxRuntime.Tests.Common\Microsoft.ML.OnnxRuntime.Tests.Common.csproj" name="Microsoft.ML.OnnxRuntime.Tests.Common" />
|
||||
<ProjectReference Include="..\Microsoft.ML.OnnxRuntime.Tests.Devices\Microsoft.ML.OnnxRuntime.Tests.Devices.csproj" name="Microsoft.ML.OnnxRuntime.Tests.Devices" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="$(IsIOSTarget)=='true' OR $(IsMacCatalystTarget)=='true'">
|
||||
<!-- need the dummy ORT Extensions package to resolve the RegisterCustomOps symbol. -->
|
||||
<PackageReference Include="Microsoft.ML.OnnxRuntime.Extensions.Dummy" Version="0.12.0" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="DeviceRunners.VisualRunners.Maui" Version="0.1.0-preview.2" />
|
||||
<PackageReference Include="DeviceRunners.VisualRunners.Xunit" Version="0.1.0-preview.2" />
|
||||
<PackageReference Include="DeviceRunners.XHarness.Maui" Version="0.1.0-preview.2" />
|
||||
<PackageReference Include="DeviceRunners.XHarness.Xunit" Version="0.1.0-preview.2" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
|
||||
<PackageReference Include="Microsoft.DotNet.XHarness.TestRunners.Xunit" Version="9.0.0-prerelease.24374.1" />
|
||||
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.70" />
|
||||
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.70" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
|
||||
<PackageReference Include="xunit" Version="2.9.0" />
|
||||
<PackageReference Include="xunit.runner.utility" Version="2.9.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="RemoveVisualStudioTestRunner" BeforeTargets="_ComputeAppxPackagePayload">
|
||||
<ItemGroup>
|
||||
<_VisualStudioTestRunnerFiles
|
||||
Include="@(PackagingOutputs)"
|
||||
Condition="$([System.String]::Copy('%(PackagingOutputs.FullPath)').Contains('xunit.runner.visualstudio'))" />
|
||||
<PackagingOutputs Remove="@(_VisualStudioTestRunnerFiles)" />
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
<ItemGroup Condition="$(IsIOSTarget)=='true' OR $(IsMacCatalystTarget)=='true'">
|
||||
<!-- need the dummy ORT Extensions package to resolve the RegisterCustomOps symbol. -->
|
||||
<PackageReference Include="Microsoft.ML.OnnxRuntime.Extensions.Dummy" Version="0.12.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(IsAndroidTarget)' !='true'">
|
||||
<GenerateProgramFile>false</GenerateProgramFile>
|
||||
<DefaultLanguage>en</DefaultLanguage>
|
||||
</PropertyGroup>
|
||||
<Target Name="RemoveVisualStudioTestRunner" BeforeTargets="_ComputeAppxPackagePayload">
|
||||
<ItemGroup>
|
||||
<_VisualStudioTestRunnerFiles Include="@(PackagingOutputs)" Condition="$([System.String]::Copy('%(PackagingOutputs.FullPath)').Contains('xunit.runner.visualstudio'))" />
|
||||
<PackagingOutputs Remove="@(_VisualStudioTestRunnerFiles)" />
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
<Target Name="CleanPublishFolder" AfterTargets="Clean">
|
||||
<RemoveDir Directories="$(PublishDir)" />
|
||||
</Target>
|
||||
|
||||
<PropertyGroup Condition="'$(IsAndroidTarget)' !='true'">
|
||||
<GenerateProgramFile>false</GenerateProgramFile>
|
||||
<DefaultLanguage>en</DefaultLanguage>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(IsAndroidTarget)' == 'true'">
|
||||
<AndroidPackageFormat>apk</AndroidPackageFormat>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
|||
Loading…
Reference in a new issue