Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: macos integration test #1645

Merged
merged 1 commit into from
Sep 18, 2023
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/flutter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
access_token: ${{ github.token }}

build:
name: ${{ matrix.target }} | ${{ matrix.os }} | ${{ matrix.sdk }}
name: "${{ matrix.target }} | ${{ matrix.os }} | ${{ matrix.sdk }}"
runs-on: ${{ matrix.os }}
timeout-minutes: 30
defaults:
Expand Down
57 changes: 33 additions & 24 deletions .github/workflows/flutter_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- release/**
pull_request:
paths-ignore:
- 'file/**'
- "file/**"

env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
Expand Down Expand Up @@ -103,9 +103,10 @@ 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/integration_test.dart --verbose
script: flutter test integration_test --verbose

test-ios:
cocoa:
name: "${{ matrix.target }} | ${{ matrix.sdk }}"
runs-on: macos-13
timeout-minutes: 30
defaults:
Expand All @@ -114,8 +115,8 @@ jobs:
strategy:
fail-fast: false
matrix:
# 'beta' is flaky because of https://github.com/flutter/flutter/issues/124340
sdk: ["stable"]
sdk: ["stable", "beta"]
target: ["ios", "macos"]
steps:
- name: checkout
uses: actions/checkout@v3
Expand All @@ -131,25 +132,33 @@ jobs:
run: flutter pub get

- name: pod install
working-directory: ./flutter/example/ios
working-directory: ./flutter/example/${{ matrix.target }}
run: pod install

- name: launch ios simulator
id: sim
- name: prepare test device
id: device
run: |
simulator_id=$(xcrun simctl create sentryPhone com.apple.CoreSimulator.SimDeviceType.iPhone-14 com.apple.CoreSimulator.SimRuntime.iOS-16-4)
echo "SIMULATOR_ID=${simulator_id}" >> "$GITHUB_OUTPUT"
xcrun simctl boot ${simulator_id}
# Disable flutter integration tests because of flaky execution
# - name: run ios integration test
# env:
# SIMULATOR_ID: ${{ steps.sim.outputs.SIMULATOR_ID }}
# run: flutter test -d "$SIMULATOR_ID" integration_test/integration_test.dart --verbose

- name: run ios native test
working-directory: ./flutter/example/ios
env:
SIMULATOR_ID: ${{ steps.sim.outputs.SIMULATOR_ID }}
run: xcodebuild test -workspace Runner.xcworkspace -scheme Runner -configuration Debug -destination "platform=iOS Simulator,id=$SIMULATOR_ID" -allowProvisioningUpdates CODE_SIGNING_ALLOWED=NO


case "${{ matrix.target }}" in
ios)
device=$(xcrun simctl create sentryPhone com.apple.CoreSimulator.SimDeviceType.iPhone-14 com.apple.CoreSimulator.SimRuntime.iOS-16-4)
xcrun simctl boot ${device}
echo "platform=iOS Simulator,id=${device}" >> "$GITHUB_OUTPUT"
;;
macos)
device="macos"
echo "platform=OS X" >> "$GITHUB_OUTPUT"
;;
esac
echo "name=${device}" >> "$GITHUB_OUTPUT"

- 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

- name: run native test
# We only have the native unit test package in the iOS xcodeproj at the moment.
# Should be OK because it will likely be removed after switching to FFI (see https://github.com/getsentry/sentry-dart/issues/1444).
if: ${{ matrix.target != 'macos' }}
working-directory: ./flutter/example/${{ matrix.target }}
run: xcodebuild test -workspace Runner.xcworkspace -scheme Runner -configuration Debug -destination "platform=${{ steps.device.outputs.platform }}" -allowProvisioningUpdates CODE_SIGNING_ALLOWED=NO