From e4d0c173b030e64adc0471b489e0861db9ee83fb Mon Sep 17 00:00:00 2001 From: Denis Andrasec Date: Mon, 19 Jun 2023 16:04:35 +0200 Subject: [PATCH 1/5] use xcrun directly instead of subosito/flutter-action --- .../workflows/flutter_integration_test.yml | 95 +++++++++---------- 1 file changed, 47 insertions(+), 48 deletions(-) diff --git a/.github/workflows/flutter_integration_test.yml b/.github/workflows/flutter_integration_test.yml index c527265e39..e3f9bd1376 100644 --- a/.github/workflows/flutter_integration_test.yml +++ b/.github/workflows/flutter_integration_test.yml @@ -17,46 +17,7 @@ jobs: with: access_token: ${{ github.token }} - 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 - - # Enable after fixing https://github.com/getsentry/sentry-dart/issues/1448 - # test-ios: + # test-android: # runs-on: macos-latest # timeout-minutes: 30 # defaults: @@ -65,12 +26,16 @@ jobs: # strategy: # fail-fast: false # matrix: - # # 'beta' is flaky because of https://github.com/flutter/flutter/issues/124340 - # sdk: ['stable'] + # 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 }} @@ -81,11 +46,45 @@ jobs: # - name: flutter pub get # run: flutter pub get - # - name: launch ios emulator - # uses: futureware-tech/simulator-action@ee05c113b79f056b47f354d7b313555f5491e158 #pin@v2 + # - name: launch android emulator & run android integration test + # uses: reactivecircus/android-emulator-runner@50986b1464923454c95e261820bc626f38490ec0 #pin@v2.27.0 # with: - # model: 'iPhone 14' - # os_version: '16.2' + # 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: run ios integration test - # run: flutter test integration_test/integration_test.dart --verbose + - 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 From 7ba3cd110c7199ca5b8858fd191ba36a25fabc86 Mon Sep 17 00:00:00 2001 From: Denis Andrasec Date: Mon, 19 Jun 2023 16:46:02 +0200 Subject: [PATCH 2/5] =?UTF-8?q?close=20sentry=20in=20tearDown,=20don?= =?UTF-8?q?=E2=80=99t=20call=20pumpandsettle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- flutter/example/integration_test/integration_test.dart | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/flutter/example/integration_test/integration_test.dart b/flutter/example/integration_test/integration_test.dart index 66d098f00f..3b8462ad44 100644 --- a/flutter/example/integration_test/integration_test.dart +++ b/flutter/example/integration_test/integration_test.dart @@ -6,7 +6,7 @@ import 'package:sentry_flutter_example/main.dart'; void main() { TestWidgetsFlutterBinding.ensureInitialized(); - setUp(() async { + tearDown(() async { await Sentry.close(); }); @@ -18,7 +18,6 @@ void main() { bundle: SentryAssetBundle(enableStructuredDataTracing: true), child: const MyApp(), ))); - await tester.pumpAndSettle(); }, 'https://abc@def.ingest.sentry.io/1234567'); } From a3e1895745d1cf3c9052edb80a1692200978558a Mon Sep 17 00:00:00 2001 From: Denis Andrasec Date: Mon, 26 Jun 2023 16:16:35 +0200 Subject: [PATCH 3/5] bump macos version and simulator --- .github/workflows/flutter_integration_test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/flutter_integration_test.yml b/.github/workflows/flutter_integration_test.yml index e3f9bd1376..a4a5689b50 100644 --- a/.github/workflows/flutter_integration_test.yml +++ b/.github/workflows/flutter_integration_test.yml @@ -57,7 +57,7 @@ jobs: # Enable after fixing https://github.com/getsentry/sentry-dart/issues/1448 test-ios: - runs-on: macos-latest + runs-on: macos-13 timeout-minutes: 30 defaults: run: @@ -83,7 +83,7 @@ jobs: - name: launch ios simulator run: | - simulator_id=$(xcrun simctl create sentryPhone com.apple.CoreSimulator.SimDeviceType.iPhone-14 com.apple.CoreSimulator.SimRuntime.iOS-16-2) + simulator_id=$(xcrun simctl create sentryPhone com.apple.CoreSimulator.SimDeviceType.iPhone-14 com.apple.CoreSimulator.SimRuntime.iOS-16-4) xcrun simctl boot ${simulator_id} - name: run ios integration test From a4e3c5b9ce860b8c52ad2dfff4b42f98b4b3075c Mon Sep 17 00:00:00 2001 From: Denis Andrasec Date: Mon, 26 Jun 2023 16:22:20 +0200 Subject: [PATCH 4/5] downgrade runtime --- .github/workflows/flutter_integration_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/flutter_integration_test.yml b/.github/workflows/flutter_integration_test.yml index a4a5689b50..f9e899bb41 100644 --- a/.github/workflows/flutter_integration_test.yml +++ b/.github/workflows/flutter_integration_test.yml @@ -83,7 +83,7 @@ jobs: - name: launch ios simulator run: | - simulator_id=$(xcrun simctl create sentryPhone com.apple.CoreSimulator.SimDeviceType.iPhone-14 com.apple.CoreSimulator.SimRuntime.iOS-16-4) + 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 From c0ae3c57d7250b32bbb94a8d0f7120246ceebf84 Mon Sep 17 00:00:00 2001 From: Denis Andrasec Date: Tue, 27 Jun 2023 09:56:16 +0200 Subject: [PATCH 5/5] enable android test --- .../workflows/flutter_integration_test.yml | 67 +++++++++---------- 1 file changed, 33 insertions(+), 34 deletions(-) diff --git a/.github/workflows/flutter_integration_test.yml b/.github/workflows/flutter_integration_test.yml index f9e899bb41..3493c384ad 100644 --- a/.github/workflows/flutter_integration_test.yml +++ b/.github/workflows/flutter_integration_test.yml @@ -17,45 +17,44 @@ jobs: with: access_token: ${{ github.token }} - # 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 + 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: actions/setup-java@v3 + with: + distribution: 'adopt' + java-version: '11' - # - uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa # pin@v2.10.0 - # with: - # channel: ${{ matrix.sdk }} + - uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa # pin@v2.10.0 + with: + channel: ${{ matrix.sdk }} - # - name: flutter upgrade - # run: flutter upgrade + - name: flutter upgrade + run: flutter upgrade - # - name: flutter pub get - # run: flutter pub get + - 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 + - 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-13 timeout-minutes: 30 @@ -85,6 +84,6 @@ jobs: 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