Skip to content

Commit

Permalink
Merge pull request #17092 from unoplatform/dev/jela/adjust-ios-build
Browse files Browse the repository at this point in the history
Adjust support for 17.2 UI tests
  • Loading branch information
jeromelaban authored Jun 12, 2024
2 parents af693a4 + 620926c commit 857cff6
Show file tree
Hide file tree
Showing 23 changed files with 410 additions and 35 deletions.
24 changes: 12 additions & 12 deletions build/nuget/Uno.WinUI.MSAL.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,58 +13,58 @@
<dependencies>
<group targetFramework="net9.0">
<dependency id="Uno.WinUI" version="to-be-set-by-ci" />
<dependency id="Microsoft.Identity.Client" version="4.47.0" />
<dependency id="Microsoft.Identity.Client" version="4.61.3" />
</group>
<group targetFramework="net8.0">
<dependency id="Uno.WinUI" version="to-be-set-by-ci" />
<dependency id="Microsoft.Identity.Client" version="4.47.0" />
<dependency id="Microsoft.Identity.Client" version="4.61.3" />
</group>

<!-- BEGIN UWP-specific
<group targetFramework="UAP10.0.19041">
<dependency id="Microsoft.Identity.Client" version="4.47.0" />
<dependency id="Microsoft.Identity.Client" version="4.61.3" />
</group>
END UWP-specific -->


<!-- BEGIN WinUI-specific -->
<group targetFramework="net8.0-windows10.0.19041.0">
<dependency id="Microsoft.Identity.Client" version="4.47.0" />
<dependency id="Microsoft.Identity.Client" version="4.61.3" />
</group>
<!-- END WinUI-specific -->


<group targetFramework="net8.0-android30.0">
<dependency id="Uno.WinUI" version="to-be-set-by-ci" />
<dependency id="Microsoft.Identity.Client" version="4.47.0" />
<dependency id="Microsoft.Identity.Client" version="4.61.3" />
</group>
<group targetFramework="net8.0-ios">
<dependency id="Uno.WinUI" version="to-be-set-by-ci" />
<dependency id="Microsoft.Identity.Client" version="4.47.0" />
<dependency id="Microsoft.Identity.Client" version="4.61.3" />
</group>
<group targetFramework="net8.0-maccatalyst">
<dependency id="Uno.WinUI" version="to-be-set-by-ci" />
<dependency id="Microsoft.Identity.Client" version="4.47.0" />
<dependency id="Microsoft.Identity.Client" version="4.61.3" />
</group>
<group targetFramework="net8.0-macos">
<dependency id="Uno.WinUI" version="to-be-set-by-ci" />
<dependency id="Microsoft.Identity.Client" version="4.47.0" />
<dependency id="Microsoft.Identity.Client" version="4.61.3" />
</group>
<group targetFramework="net9.0-android30.0">
<dependency id="Uno.WinUI" version="to-be-set-by-ci" />
<dependency id="Microsoft.Identity.Client" version="4.47.0" />
<dependency id="Microsoft.Identity.Client" version="4.61.3" />
</group>
<group targetFramework="net9.0-ios">
<dependency id="Uno.WinUI" version="to-be-set-by-ci" />
<dependency id="Microsoft.Identity.Client" version="4.47.0" />
<dependency id="Microsoft.Identity.Client" version="4.61.3" />
</group>
<group targetFramework="net9.0-maccatalyst">
<dependency id="Uno.WinUI" version="to-be-set-by-ci" />
<dependency id="Microsoft.Identity.Client" version="4.47.0" />
<dependency id="Microsoft.Identity.Client" version="4.61.3" />
</group>
<group targetFramework="net9.0-macos">
<dependency id="Uno.WinUI" version="to-be-set-by-ci" />
<dependency id="Microsoft.Identity.Client" version="4.47.0" />
<dependency id="Microsoft.Identity.Client" version="4.61.3" />
</group>
</dependencies>
</metadata>
Expand Down
18 changes: 12 additions & 6 deletions build/test-scripts/ios-uitest-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export UNO_TESTS_LOCAL_TESTS_FILE=$BUILD_SOURCESDIRECTORY/src/SamplesApp/Samples
export UNO_UITEST_BENCHMARKS_PATH=$BUILD_ARTIFACTSTAGINGDIRECTORY/benchmarks/ios-automated
export UNO_UITEST_RUNTIMETESTS_RESULTS_FILE_PATH=$BUILD_SOURCESDIRECTORY/build/RuntimeTestResults-ios-automated.xml

export UNO_UITEST_SIMULATOR_VERSION="com.apple.CoreSimulator.SimRuntime.iOS-16-1"
export UNO_UITEST_SIMULATOR_VERSION="com.apple.CoreSimulator.SimRuntime.iOS-17-2"
export UNO_UITEST_SIMULATOR_NAME="iPad Pro (12.9-inch) (6th generation)"

export UnoTargetFrameworkOverride="net8.0-ios17.0"
Expand All @@ -109,9 +109,6 @@ fi
echo "Current system date"
date

## Install iOS 16.4 simulators
xcodes runtimes install --keep-archive 'iOS 16.1' || true

# Wait while ios runtime 16.1 is not having simulators. The install process may
# take a few seconds and "simctl list devices" may not return devices.
while true; do
Expand Down Expand Up @@ -240,7 +237,6 @@ else
-c Release \
-l:"console;verbosity=normal" \
--logger "nunit;LogFileName=$UNO_ORIGINAL_TEST_RESULTS" \
--logger "console;verbosity=detailed" \
--filter "$UNO_TESTS_FILTER" \
--blame-hang-timeout $UITEST_TEST_TIMEOUT \
-v m \
Expand All @@ -249,7 +245,10 @@ fi

# export the simulator logs
export TMP_LOG_FILEPATH=/tmp/DeviceLog-$LOG_PREFIX.logarchive
export LOG_FILEPATH_FULL=$LOG_FILEPATH/DeviceLog-$UITEST_AUTOMATED_GROUP-${UITEST_RUNTIME_TEST_GROUP=automated}-`date +"%Y%m%d%H%M%S"`.txt
export LOG_FILE_DIRECTORY=$LOG_FILEPATH/$UITEST_AUTOMATED_GROUP-${UITEST_RUNTIME_TEST_GROUP=automated}-`date +"%Y%m%d%H%M%S"`
export LOG_FILEPATH_FULL=$LOG_FILE_DIRECTORY/DeviceLog-`date +"%Y%m%d%H%M%S"`.txt

mkdir -p $LOG_FILE_DIRECTORY

cp -fv "$UNO_ORIGINAL_TEST_RESULTS" $LOG_FILEPATH/Test-Results-$LOG_PREFIX.xml || true

Expand All @@ -263,6 +262,10 @@ xcrun simctl io "$UITEST_IOSDEVICE_ID" screenshot $LOG_FILEPATH/capture-$LOG_PRE
## Capture the device logs
xcrun simctl spawn booted log collect --output $TMP_LOG_FILEPATH

## Shutting down simulator to reclaim memory
echo "Shutting down simulator"
xcrun simctl shutdown "$UITEST_IOSDEVICE_ID" || true

echo "Dumping device logs to $LOG_FILEPATH_FULL"
log show --style syslog $TMP_LOG_FILEPATH > $LOG_FILEPATH_FULL

Expand All @@ -283,6 +286,9 @@ if [ ! -f "$UNO_ORIGINAL_TEST_RESULTS" ]; then
echo "##vso[task.logissue type=error]UNOBLD003: ERROR: The test results file $UNO_ORIGINAL_TEST_RESULTS does not exist (did nunit crash ?)"
fi

echo "Copying crash reports"
cp -R ~/Library/Logs/DiagnosticReports/* $LOG_FILE_DIRECTORY

pushd $BUILD_SOURCESDIRECTORY/src/Uno.NUnitTransformTool
mkdir -p $(dirname ${UNO_TESTS_FAILED_LIST})

Expand Down
9 changes: 9 additions & 0 deletions doc/articles/uno-build-error-codes.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,15 @@ Invocations to `Dispose` can cause the application to crash in `__NSObject_Dispo

The method `InitializeComponent` should always be called in class constructor. A missing call will lead to hard-to-diagnose bugs. This analyzer reports when it's missing to make issues more apparent.

### UNO0007

**An assembly required for a component is missing**

Some components like `ProgressRing` and `MediaPlayerElement` requires you to reference a specific NuGet package for them to work correctly.

- For `ProgressRing`, it requires Lottie dependency. For more information about adding Lottie to your project, see [Lottie for Uno](xref:Uno.Features.Lottie).
- For `MediaPlayerElement` on WebAssembly or Gtk, it requires `Uno.WinUI.MediaPlayer.WebAssembly` or `Uno.WinUI.MediaPlayer.Skia.Gtk` NuGet package. For more information, see [MediaPlayerElement](xref:Uno.Controls.MediaPlayerElement).

## XAML Errors

### UNOX0001
Expand Down
2 changes: 1 addition & 1 deletion src/AddIns/Uno.UI.MSAL/Uno.UI.MSAL.Reference.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Identity.Client" Version="4.47.0" />
<PackageReference Include="Microsoft.Identity.Client" Version="4.61.3" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/AddIns/Uno.UI.MSAL/Uno.UI.MSAL.Skia.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Identity.Client" Version="4.47.0" />
<PackageReference Include="Microsoft.Identity.Client" Version="4.61.3" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/AddIns/Uno.UI.MSAL/Uno.UI.MSAL.Wasm.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Identity.Client" Version="4.47.0" />
<PackageReference Include="Microsoft.Identity.Client" Version="4.61.3" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/AddIns/Uno.UI.MSAL/Uno.UI.MSAL.Windows.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Identity.Client" Version="4.47.0" />
<PackageReference Include="Microsoft.Identity.Client" Version="4.61.3" />
</ItemGroup>

<Import Project="..\..\..\build\nuget\uno.winui.cross-runtime.targets"/>
Expand Down
2 changes: 1 addition & 1 deletion src/AddIns/Uno.UI.MSAL/Uno.UI.MSAL.netcoremobile.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Identity.Client" Version="4.47.0" />
<PackageReference Include="Microsoft.Identity.Client" Version="4.61.3" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/SamplesApp/SamplesApp.Skia/SamplesApp.Skia.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<PackageReference Include="Uno.Fonts.Fluent" />
<PackageReference Include="IdentityModel.OidcClient" Version="3.1.2" />
<PackageReference Include="Microsoft.Graph" Version="3.12.0" />
<PackageReference Include="Microsoft.Identity.Client" Version="4.47.0" />
<PackageReference Include="Microsoft.Identity.Client" Version="4.61.3" />
<PackageReference Include="MSTest.TestFramework" />
<PackageReference Include="MSTest.Analyzers" />
<!-- TODO: Use version 8 when compiling against .NET 8? -->
Expand Down
2 changes: 1 addition & 1 deletion src/SamplesApp/SamplesApp.Wasm/SamplesApp.Wasm.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
<ItemGroup>
<PackageReference Include="IdentityModel.OidcClient" Version="3.1.2" />
<PackageReference Include="Microsoft.Graph" Version="3.12.0" />
<PackageReference Include="Microsoft.Identity.Client" Version="4.47.0" />
<PackageReference Include="Microsoft.Identity.Client" Version="4.61.3" />
<PackageReference Include="MSTest.TestFramework" />
<PackageReference Include="MSTest.Analyzers" />
<PackageReference Include="Uno.Extensions.Logging.WebAssembly.Console" Version="1.7.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<Version>3.12.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.Identity.Client">
<Version>4.47.0</Version>
<Version>4.61.3</Version>
</PackageReference>

<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.5.240227000" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
<Version>3.12.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.Identity.Client">
<Version>4.47.0</Version>
<Version>4.61.3</Version>
</PackageReference>

<PackageReference Include="MSTest.TestFramework" />
Expand Down
2 changes: 1 addition & 1 deletion src/SamplesApp/UnoIslands.Skia/UnoIslands.Skia.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<PackageReference Include="Uno.Fonts.Fluent" />
<PackageReference Include="IdentityModel.OidcClient" Version="3.1.2" />
<PackageReference Include="Microsoft.Graph" Version="3.12.0" />
<PackageReference Include="Microsoft.Identity.Client" Version="4.47.0" />
<PackageReference Include="Microsoft.Identity.Client" Version="4.61.3" />
<PackageReference Include="MSTest.TestFramework" />
<PackageReference Include="MSTest.Analyzers" />
<!-- TODO: Use version 8 when compiling against .NET 8? -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<PackageReference Include="Uno.Fonts.Fluent" />
<PackageReference Include="IdentityModel.OidcClient" Version="3.1.2" />
<PackageReference Include="Microsoft.Graph" Version="3.12.0" />
<PackageReference Include="Microsoft.Identity.Client" Version="4.47.0" />
<PackageReference Include="Microsoft.Identity.Client" Version="4.61.3" />
<PackageReference Include="MSTest.TestFramework" />
<PackageReference Include="MSTest.Analyzers" />
<!-- TODO: Use version 8 when compiling against .NET 8? -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ from type in module.GlobalNamespace.GetNamespaceTypes()
writer.AppendLineIndented("#pragma warning disable 1591 // Ignore missing XML comment warnings");
writer.AppendLineIndented("#pragma warning disable XAOBS001 // Ignore obsolete Android members");
writer.AppendLineIndented("#pragma warning disable Uno0001 // Ignore not implemented members");
writer.AppendLineIndented("#pragma warning disable Uno0007 // An assembly required for a component is missing");
AnalyzerSuppressionsGenerator.GenerateCSharpPragmaSupressions(writer, AnalyzerSuppressions);
writer.AppendLineIndented("using System;");
writer.AppendLineIndented("using System.Linq;");
Expand Down
Loading

0 comments on commit 857cff6

Please sign in to comment.