Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
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
13 changes: 6 additions & 7 deletions .github/workflows/device-tests-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
fail-fast: false
matrix:
tfm: [net9.0]
tfm: [net9.0, net10.0]
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_NOLOGO: 1
Expand All @@ -40,13 +40,12 @@ jobs:
- name: Build Android Test App
run: pwsh ./scripts/device-test.ps1 android -Build -Tfm ${{ matrix.tfm }}

- name: Upload Android Test App (net9.0)
if: matrix.tfm == 'net9.0'
- name: Upload Android Test App (${{ matrix.tfm }})
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: device-test-android-net9.0
name: device-test-android-${{ matrix.tfm }}
if-no-files-found: error
path: test/Sentry.Maui.Device.TestApp/bin/Release/net9.0-android/android-x64/io.sentry.dotnet.maui.device.testapp-Signed.apk
path: test/Sentry.Maui.Device.TestApp/bin/Release/${{ matrix.tfm }}-android/android-x64/io.sentry.dotnet.maui.device.testapp-Signed.apk

android:
needs: [build]
Expand All @@ -58,7 +57,7 @@ jobs:
strategy:
fail-fast: false
matrix:
tfm: [net9.0]
tfm: [net9.0, net10.0]
# Must be 34+ for new apps and app updates as of August 31, 2024.
# See https://apilevels.com/
api-level: [34, 36]
Expand Down Expand Up @@ -147,7 +146,7 @@ jobs:
disk-size: ${{ env.ANDROID_EMULATOR_DISK_SIZE }}
emulator-options: ${{ env.ANDROID_EMULATOR_OPTIONS }}
disable-animations: false
script: pwsh integration-test/android.Tests.ps1
script: pwsh integration-test/android.Tests.ps1 -dotnet_version ${{ matrix.tfm }}

- name: Retry Integration Tests (if previous failed to run)
if: steps.first-integration-test-run.outcome == 'failure'
Expand Down
1 change: 1 addition & 0 deletions Sentry.sln
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "integration-test", "integra
integration-test\pester.ps1 = integration-test\pester.ps1
integration-test\ios.Tests.ps1 = integration-test\ios.Tests.ps1
integration-test\msbuild.Tests.ps1 = integration-test\msbuild.Tests.ps1
integration-test\android.Tests.ps1 = integration-test\android.Tests.ps1
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "net4-console", "net4-console", "{33793113-C7B5-434D-B5C1-6CA1A9587842}"
Expand Down
19 changes: 15 additions & 4 deletions integration-test/android.Tests.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
param(
[string] $dotnet_version = "net10.0"
)

# This file contains test cases for https://pester.dev/
Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'
Expand All @@ -12,11 +16,18 @@ BeforeDiscovery {
$script:emulator = Get-AndroidEmulatorId
}

Describe 'MAUI app (<tfm>, <configuration>)' -ForEach @(
@{ tfm = "net9.0-android35.0"; configuration = "Release" }
@{ tfm = "net9.0-android35.0"; configuration = "Debug" }
) -Skip:(-not $script:emulator) {
$cases = @(
@{ Configuration = 'Release' }
@{ Configuration = 'Debug' }
)
Describe 'MAUI app (<dotnet_version>, <configuration>)' -ForEach $cases -Skip:(-not $script:emulator) {
BeforeAll {
if ($dotnet_version -eq 'net9.0') {
$tfm = 'net9.0-android35.0'
} else {
$tfm = 'net10.0-android36.0'
}

Remove-Item -Path "$PSScriptRoot/mobile-app" -Recurse -Force -ErrorAction SilentlyContinue
Copy-Item -Path "$PSScriptRoot/net9-maui" -Destination "$PSScriptRoot/mobile-app" -Recurse -Force
Push-Location $PSScriptRoot/mobile-app
Expand Down
13 changes: 9 additions & 4 deletions integration-test/net9-maui/MauiProgram.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,16 @@ public static MauiApp CreateMauiApp()
options.SendClientReports = false;
options.AutoSessionTracking = false;

options.SetBeforeBreadcrumb((breadcrumb, hint) =>
// Only check breadcrumbs for non-crash tests...
var testArg = System.Environment.GetEnvironmentVariable("SENTRY_TEST_ARG");
if (!Enum.TryParse<CrashType>(testArg, ignoreCase: true, out var crashType))
{
App.ReceiveSystemBreadcrumb(breadcrumb);
return breadcrumb;
});
options.SetBeforeBreadcrumb((breadcrumb, hint) =>
{
App.ReceiveSystemBreadcrumb(breadcrumb);
return breadcrumb;
});
}
})
.ConfigureFonts(fonts =>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>$(TargetFrameworks);net9.0-android35.0</TargetFrameworks>
<TargetFrameworks>$(TargetFrameworks);net9.0-android35.0;net10.0-android36.0</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('OSX'))">$(TargetFrameworks);net9.0-ios18.0</TargetFrameworks>

<OutputType>Exe</OutputType>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>$(TargetFrameworks);net9.0-android</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('OSX'))">$(TargetFrameworks);net9.0-ios</TargetFrameworks>
<TargetFrameworks>$(TargetFrameworks);net9.0-android;net10.0-android</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('OSX'))">$(TargetFrameworks);net9.0-ios;net10.0-ios</TargetFrameworks>
<DefineConstants Condition="'$(EnableMauiDeviceTestVisualRunner)' == 'true'">$(DefineConstants);VISUAL_RUNNER</DefineConstants>
</PropertyGroup>

Expand Down Expand Up @@ -73,7 +73,9 @@
<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)"/>
<PackageReference Include="Microsoft.Maui.Core" Version="$(MauiVersion)"/>
<PackageReference Include="Microsoft.Maui.Essentials" Version="$(MauiVersion)"/>
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
<!-- https://github.com/advisories/GHSA-5f2m-466j-3848 -->
<PackageReference Include="System.Private.Uri" Version="4.3.2"/>
</ItemGroup>
Expand Down
Loading