Skip to content

Commit

Permalink
Fix flaky iOS integration test (#1524)
Browse files Browse the repository at this point in the history
Co-authored-by: Manoel Aranda Neto <5731772+marandaneto@users.noreply.github.com>
  • Loading branch information
denrase and marandaneto authored Jul 17, 2023
1 parent cf67555 commit 6a40d32
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 50 deletions.
94 changes: 46 additions & 48 deletions .github/workflows/flutter_integration_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,56 @@ jobs:
test-android:
runs-on: macos-latest
timeout-minutes: 30
defaults:
run:
working-directory: ./flutter/example
strategy:
fail-fast: false
matrix:
sdk: ['stable', 'beta']
steps:
- name: checkout
uses: actions/checkout@v3

- uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '11'

- uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa # pin@v2.10.0
with:
channel: ${{ matrix.sdk }}

- name: flutter upgrade
run: flutter upgrade

- name: flutter pub get
run: flutter pub get

- name: launch android emulator & run android integration test
uses: reactivecircus/android-emulator-runner@50986b1464923454c95e261820bc626f38490ec0 #pin@v2.27.0
with:
working-directory: ./flutter/example
api-level: 21
arch: x86_64
profile: Nexus 6
script: flutter test integration_test/integration_test.dart --verbose

test-ios:
runs-on: macos-13
timeout-minutes: 30
defaults:
run:
working-directory: ./flutter/example
strategy:
fail-fast: false
matrix:
sdk: ['stable', 'beta']
# 'beta' is flaky because of https://github.com/flutter/flutter/issues/124340
sdk: ['stable']
steps:
- name: checkout
uses: actions/checkout@v3

- uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '11'

- uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa # pin@v2.10.0
with:
channel: ${{ matrix.sdk }}
Expand All @@ -46,46 +80,10 @@ jobs:
- name: flutter pub get
run: flutter pub get

- name: launch android emulator & run android integration test
uses: reactivecircus/android-emulator-runner@50986b1464923454c95e261820bc626f38490ec0 #pin@v2.27.0
with:
working-directory: ./flutter/example
api-level: 21
arch: x86_64
profile: Nexus 6
script: flutter test integration_test/integration_test.dart --verbose

# Enable after fixing https://github.com/getsentry/sentry-dart/issues/1448
# test-ios:
# runs-on: macos-latest
# timeout-minutes: 30
# defaults:
# run:
# working-directory: ./flutter/example
# strategy:
# fail-fast: false
# matrix:
# # 'beta' is flaky because of https://github.com/flutter/flutter/issues/124340
# sdk: ['stable']
# steps:
# - name: checkout
# uses: actions/checkout@v3

# - uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa # pin@v2.10.0
# with:
# channel: ${{ matrix.sdk }}

# - name: flutter upgrade
# run: flutter upgrade

# - name: flutter pub get
# run: flutter pub get

# - name: launch ios emulator
# uses: futureware-tech/simulator-action@ee05c113b79f056b47f354d7b313555f5491e158 #pin@v2
# with:
# model: 'iPhone 14'
# os_version: '16.2'
- name: launch ios simulator
run: |
simulator_id=$(xcrun simctl create sentryPhone com.apple.CoreSimulator.SimDeviceType.iPhone-14 com.apple.CoreSimulator.SimRuntime.iOS-16-2)
xcrun simctl boot ${simulator_id}
# - name: run ios integration test
# run: flutter test integration_test/integration_test.dart --verbose
- name: run ios integration test
run: flutter test integration_test/integration_test.dart --verbose
3 changes: 1 addition & 2 deletions flutter/example/integration_test/integration_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import 'package:sentry_flutter_example/main.dart';
void main() {
TestWidgetsFlutterBinding.ensureInitialized();

setUp(() async {
tearDown(() async {
await Sentry.close();
});

Expand All @@ -18,7 +18,6 @@ void main() {
bundle: SentryAssetBundle(enableStructuredDataTracing: true),
child: const MyApp(),
)));
await tester.pumpAndSettle();
}, 'https://abc@def.ingest.sentry.io/1234567');
}

Expand Down

0 comments on commit 6a40d32

Please sign in to comment.