diff --git a/.github/workflows/flutter_test.yml b/.github/workflows/flutter_test.yml index 3bfda0de36..d17f591452 100644 --- a/.github/workflows/flutter_test.yml +++ b/.github/workflows/flutter_test.yml @@ -103,7 +103,7 @@ jobs: avd-name: macOS-avd-x86_64-31 emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none disable-animations: true - script: flutter test integration_test --verbose + script: flutter test integration_test/all.dart --verbose cocoa: name: "${{ matrix.target }} | ${{ matrix.sdk }}" @@ -154,7 +154,7 @@ jobs: - name: run integration test # Disable flutter integration tests for iOS for now (https://github.com/getsentry/sentry-dart/issues/1605#issuecomment-1695809346) if: ${{ matrix.target != 'ios' }} - run: flutter test -d "${{ steps.device.outputs.name }}" integration_test --verbose + run: flutter test -d "${{ steps.device.outputs.name }}" integration_test/all.dart --verbose - name: run native test # We only have the native unit test package in the iOS xcodeproj at the moment. diff --git a/flutter/example/integration_test/all.dart b/flutter/example/integration_test/all.dart new file mode 100644 index 0000000000..69cc5a6641 --- /dev/null +++ b/flutter/example/integration_test/all.dart @@ -0,0 +1,8 @@ +// Workaround for https://github.com/flutter/flutter/issues/101031 +import 'integration_test.dart' as a; +import 'profiling_test.dart' as b; + +void main() { + a.main(); + b.main(); +} diff --git a/flutter/example/integration_test/profiling_test.dart b/flutter/example/integration_test/profiling_test.dart index daa15861dc..fd0eac12f9 100644 --- a/flutter/example/integration_test/profiling_test.dart +++ b/flutter/example/integration_test/profiling_test.dart @@ -1,12 +1,11 @@ import 'dart:convert'; +import 'dart:io'; import 'package:flutter_test/flutter_test.dart'; import 'package:sentry_flutter/sentry_flutter.dart'; import '../../../dart/test/mocks/mock_transport.dart'; void main() { - TestWidgetsFlutterBinding.ensureInitialized(); - final transport = MockTransport(); setUp(() async { @@ -60,5 +59,8 @@ void main() { expect(profileData["profile"]["samples"], isNotEmpty); expect(profileData["profile"]["stacks"], isNotEmpty); expect(profileData["profile"]["frames"], isNotEmpty); - }); + }, + skip: (Platform.isMacOS || Platform.isIOS) + ? false + : "Profiling is not supported on this platform"); }