Skip to content

Commit

Permalink
workaround for the integration test issue
Browse files Browse the repository at this point in the history
  • Loading branch information
vaind committed Sep 18, 2023
1 parent 4c8f2bf commit e0bb3ab
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/flutter_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand Down Expand Up @@ -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.
Expand Down
8 changes: 8 additions & 0 deletions flutter/example/integration_test/all.dart
Original file line number Diff line number Diff line change
@@ -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();
}
8 changes: 5 additions & 3 deletions flutter/example/integration_test/profiling_test.dart
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down Expand Up @@ -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");
}

0 comments on commit e0bb3ab

Please sign in to comment.