Skip to content

Commit

Permalink
wip: iOS build
Browse files Browse the repository at this point in the history
  • Loading branch information
minikin committed Nov 7, 2023
1 parent a288ede commit d94b439
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 28 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/flitter-mobile-integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ jobs:
- name: ⬇️ Checkout repository
uses: actions/checkout@v3

- name: ⤵️ Authenticate with Google Cloud Platform
uses: "google-github-actions/auth@v1"
with:
credentials_json: "${{ secrets.GOOGLE_CREDENTIALS_INTEGRATION_TESTS }}"
# - name: ⤵️ Authenticate with Google Cloud Platform
# uses: "google-github-actions/auth@v1"
# with:
# credentials_json: "${{ secrets.GOOGLE_CREDENTIALS_INTEGRATION_TESTS }}"

- name: ⚙️ Setup Google Cloud SDK
uses: google-github-actions/setup-gcloud@v1
# - name: ⚙️ Setup Google Cloud SDK
# uses: google-github-actions/setup-gcloud@v1

- name: ⚙️ Setup Java
uses: actions/setup-java@v1
Expand All @@ -55,8 +55,8 @@ jobs:
- name: ⚙️ Install dependencies for all packages
run: melos build:pub_get:all

- name: 🤖 Run Android Integration Tests
run: ./scripts/flutter_android_integration_test.sh
# - name: 🤖 Run Android Integration Tests
# run: ./scripts/flutter_android_integration_test.sh

# - name: 📱 Run iOS Integration Tests
# run: ./scripts/flutter_ios_integration_test.sh
29 changes: 25 additions & 4 deletions docs/FLUTTER_INTEGRATION_TEST.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@
* [Run integration test in Android Studio](#run-integration-test-in-android-studio)
* [Run integration test from command line](#run-integration-test-from-command-line-1)
* [Run integration test in Firebase Test Lab](#run-integration-test-in-firebase-test-lab)
* [Gcloud CLI](#gcloud-cli)
* [Links](#links)

## Requirements

* macOS 14.0 + (if you want to run iOS tests locally)
* Xcode: 14.2+
* Xcode: 14.2+ (required for iOS tests)
* Android Studio: Android Studio Electric Eel | 2022.1.1 +
* [gcloud CLI](https://cloud.google.com/sdk/gcloud)

Expand Down Expand Up @@ -101,10 +102,30 @@ flutter test integration_test/main.dart --flavor development

### Run integration test in Firebase Test Lab

Android:

```sh
flutter drive --driver=test_driver/integration_test.dart \
--target=integration_test/main.dart \
--flavor development
./scripts/flutter_android_integration_test.sh
```

iOS:

```sh
./scripts/flutter_ios_integration_test.sh
```

## Gcloud CLI

List available android devices:

```sh
gcloud firebase test android models list
```

List available iOS devices:

```sh
gcloud firebase test ios models list
```

## Links
Expand Down
2 changes: 1 addition & 1 deletion scripts/flutter_android_integration_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ gcloud firebase test android run --type instrumentation \
--use-orchestrator \
--timeout 15m \
--results-bucket=gs://dev-catalyst-voice.appspot.com \
--results-dir=integration_test_results
--results-dir=integration_test_results/android/
34 changes: 19 additions & 15 deletions scripts/flutter_ios_integration_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,35 @@ set -e

output="../build/ios_integ"
product="build/ios_integ/Build/Products"
dev_target="15.0"

pushd catalyst_voices
flutter build ios integration_test/main.dart --release --flavor development
flutter build ios integration_test/main.dart --debug --flavor development

pushd ios
xcodebuild build-for-testing \
xcodebuild clean build build-for-testing \
-workspace Runner.xcworkspace \
-scheme development \
-xcconfig Flutter/Release.xcconfig \
-configuration Release \
-xcconfig Flutter/Debug.xcconfig \
-sdk iphoneos \
-derivedDataPath \
$output
popd

pushd $product
zip -r "ios_tests.zip" "Release-iphoneos" "Runner_iphoneos$dev_target-arm64.xctestrun"
popd
# pushd $product
# zip -r "ios_tests.zip" "Release-iphoneos" "development_iphoneos17.0-arm64.xctestrun"
# popd

# gcloud firebase test ios run --test "build/integration_test/Build/Products/ios_tests.zip" \
# --device-ids=iphone14pro, iphone8 \
# --os-version-ids=16.6, 15.7 \
# --locales=en_GB \
# --orientations=portrait \
# gcloud firebase test ios run \
# --test "../catalyst_voices/build/ios_integ/Build/Products/ios_tests.zip" \
# --device model=iphone14pro \
# --device version=16.6 \
# --device locale=en_GB \
# --device orientation=portrait \
# --timeout 15m \
# --results-bucket=gs://catalyst_voices_integration_test_results \
# --results-dir=tests/firebase
# --results-bucket=gs://dev-catalyst-voice.appspot.com \
# --results-dir=integration_test_results/ios/


# xcodebuild test-without-building \
# -xctestrun "../catalyst_voices/build/ios_integ/Build/Products/development_iphoneos17.0-arm64.xctestrun" \
# -destination id=C666C6C3-26F2-4E26-A0D1-8A3147DDB4A8

0 comments on commit d94b439

Please sign in to comment.