-
Notifications
You must be signed in to change notification settings - Fork 383
ci(repo): add e2e testing infrastructure (iOS + Android) #2777
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
Draft
testableapple
wants to merge
32
commits into
master
Choose a base branch
from
ci/e2e-testing-infra
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
6bb1ce4
test: add e2e testing infrastructure (iOS + Android)
testableapple f6943f1
Remove useless comments
testableapple a5e6342
Move things around a little bit
testableapple f108d0f
Bump actions versions
testableapple 3783d7c
Fix iOS
testableapple 9949033
Bump cache version
testableapple ef1e0ca
Trying to speed up ios build
testableapple a670439
Merge branch 'master' into ci/e2e-testing-infra
testableapple ab3f3ff
Fix nohup
testableapple fd68c10
Fix patrol
testableapple 66f5573
FIx fastlane
testableapple f98950b
Revert "FIx fastlane"
testableapple 1f3f787
Revert "Fix patrol"
testableapple 3185515
Revert "Fix nohup"
testableapple 164faf0
Logs
testableapple 76ecd11
Some iOS updates
testableapple 5f0ad9a
Comment android
testableapple be0ffc5
Add allure id
testableapple b28272b
fix(e2e): await mock server response body before closing client
testableapple 2af32e5
Fix
testableapple 09f0fcb
Test
testableapple 1d6f406
Test macos 15
testableapple 284044c
Revert "Test"
testableapple d49978b
Revert "Fix"
testableapple 0d09fe4
Revert "fix(e2e): await mock server response body before closing client"
testableapple 160efd5
Check if this makes build slower
testableapple 7807ee1
Test without caching build
testableapple 040545b
Revert "Test without caching build"
testableapple 896af67
test(e2e): retry failed tests
testableapple a7357ef
test(e2e): boot ios simulator via prepare_simulator in run_e2e_test
testableapple 6627532
fix(e2e): await /start response body and give it a 60s budget
testableapple 8ceed4b
Do not wait for ios sim
testableapple File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| name: Setup iOS Runtime | ||
| description: Download and install a requested iOS simulator runtime | ||
| inputs: | ||
| version: | ||
| description: iOS runtime version (e.g. 17.5) | ||
| required: true | ||
| device: | ||
| description: Simulator device type (e.g. iPhone 15 Pro) | ||
| required: true | ||
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: Install ipsw | ||
| shell: bash | ||
| run: | | ||
| IPSW_VERSION=3.1.592 | ||
| FILE="ipsw_${IPSW_VERSION}_macOS_universal.tar.gz" | ||
| if ! command -v ipsw >/dev/null; then | ||
| wget -q "https://github.com/blacktop/ipsw/releases/download/v${IPSW_VERSION}/${FILE}" | ||
| tar -xzf "$FILE" | ||
| chmod +x ipsw | ||
| sudo mv ipsw /usr/local/bin/ | ||
| rm -f "$FILE" | ||
| fi | ||
|
|
||
| - name: Setup iOS simulator runtime | ||
| shell: bash | ||
| run: | | ||
| sudo rm -rfv ~/Library/Developer/CoreSimulator/* || true | ||
| cd sample_app/ios && bundle exec fastlane install_runtime ios:${{ inputs.version }} | ||
| sudo rm -rfv sample_app/*.dmg || true | ||
| xcrun simctl list runtimes | ||
|
|
||
| - name: Create custom iOS simulator | ||
| shell: bash | ||
| run: | | ||
| ios_version_dash=$(echo "${{ inputs.version }}" | tr '.' '-') | ||
| xcrun simctl create custom-test-device "${{ inputs.device }}" "com.apple.CoreSimulator.SimRuntime.iOS-${ios_version_dash}" | ||
| xcrun simctl list devices "${{ inputs.version }}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,136 @@ | ||
| name: e2e | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| pull_request: | ||
| paths-ignore: | ||
| - 'README.md' | ||
| - '**/*.png' | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: e2e-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| env: | ||
| flutter_version: "3.x" | ||
| ios_simulator_version: "26.2" | ||
| ios_simulator_device: "iPhone 17" | ||
|
|
||
| jobs: | ||
| # android: | ||
| # runs-on: ubuntu-latest | ||
| # steps: | ||
| # - uses: actions/checkout@v6 | ||
|
|
||
| # - uses: actions/setup-java@v5 | ||
| # with: | ||
| # distribution: temurin | ||
| # java-version: "17" | ||
|
|
||
| # - uses: subosito/flutter-action@v2 | ||
| # with: | ||
| # flutter-version: ${{ env.flutter_version }} | ||
| # channel: stable | ||
| # cache-key: flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }} | ||
|
|
||
| # - uses: ruby/setup-ruby@v1 | ||
| # with: | ||
| # ruby-version: "3.3" | ||
| # bundler-cache: true | ||
| # working-directory: sample_app | ||
|
|
||
| # - name: Bootstrap | ||
| # run: | | ||
| # flutter pub global activate melos | ||
| # melos bootstrap | ||
| # dart pub global activate patrol_cli | ||
|
|
||
| # - name: Enable KVM | ||
| # run: | | ||
| # echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules | ||
| # sudo udevadm control --reload-rules | ||
| # sudo udevadm trigger --name-match=kvm | ||
|
|
||
| # - name: Run e2e (Android emulator) | ||
| # uses: reactivecircus/android-emulator-runner@v2 | ||
| # with: | ||
| # api-level: 34 | ||
| # arch: x86_64 | ||
| # profile: pixel_6 | ||
| # script: cd sample_app/android && bundle exec fastlane run_e2e_test device:emulator-5554 | ||
|
|
||
| # - name: Upload Allure results | ||
| # if: always() | ||
| # env: | ||
| # ALLURE_TOKEN: ${{ secrets.ALLURE_TOKEN }} | ||
| # run: cd sample_app/android && bundle exec fastlane allure_upload | ||
|
|
||
| # - uses: actions/upload-artifact@v7 | ||
| # if: always() | ||
| # with: | ||
| # name: e2e-android-logs | ||
| # path: | | ||
| # sample_app/stream-chat-test-mock-server/logs | ||
| # sample_app/build/app/reports | ||
|
|
||
| ios: | ||
| runs-on: macos-15 | ||
| env: | ||
| COMPILER_INDEX_STORE_ENABLE: NO | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
|
|
||
| - uses: subosito/flutter-action@v2 | ||
| with: | ||
| flutter-version: ${{ env.flutter_version }} | ||
| channel: stable | ||
| cache-key: flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }} | ||
|
|
||
| - uses: ruby/setup-ruby@v1 | ||
| with: | ||
| ruby-version: "3.3" | ||
| bundler-cache: true | ||
| working-directory: sample_app | ||
|
|
||
| - name: Bootstrap | ||
| run: | | ||
| flutter precache --ios | ||
| flutter pub global activate melos | ||
| melos bootstrap | ||
| dart pub global activate patrol_cli | ||
|
|
||
| - name: Cache CocoaPods | ||
| uses: actions/cache@v6 | ||
| with: | ||
| path: | | ||
| sample_app/ios/Pods | ||
| ~/Library/Caches/CocoaPods | ||
| key: pods-${{ runner.os }}-${{ hashFiles('pubspec.lock', 'sample_app/ios/Podfile') }} | ||
| restore-keys: pods-${{ runner.os }}- | ||
|
|
||
| - name: Cache Patrol iOS build | ||
| uses: actions/cache@v6 | ||
| with: | ||
| path: sample_app/build/ios_integ | ||
| key: patrol-ios-integ-${{ runner.os }}-xcode-${{ env.ios_simulator_version }}-${{ hashFiles('**/pubspec.lock', 'sample_app/ios/Podfile', 'sample_app/pubspec.yaml') }} | ||
| restore-keys: | | ||
| patrol-ios-integ-${{ runner.os }}-xcode-${{ env.ios_simulator_version }}- | ||
| patrol-ios-integ-${{ runner.os }}- | ||
|
|
||
| - name: Run e2e (iOS simulator) | ||
| run: cd sample_app/ios && bundle exec fastlane run_e2e_test platform:ios ios:"${{ env.ios_simulator_version }}" device:"${{ env.ios_simulator_device }}" | ||
|
|
||
| - name: Upload Allure results | ||
| if: always() | ||
| env: | ||
| ALLURE_TOKEN: ${{ secrets.ALLURE_TOKEN }} | ||
| run: cd sample_app/ios && bundle exec fastlane allure_upload | ||
|
|
||
| - uses: actions/upload-artifact@v7 | ||
| if: always() | ||
| with: | ||
| name: e2e-ios-logs | ||
| path: sample_app/stream-chat-test-mock-server/logs | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.