Skip to content

Commit 8f8eb7b

Browse files
committed
feat: split maestro e2e tests into separate iOS and Android workflows
Split the single maestro-e2e-tests workflow into two independent workflows (maestro-e2e-tests-ios and maestro-e2e-tests-android) so they run in parallel on their respective platforms. Made-with: Cursor
1 parent 95c821f commit 8f8eb7b

2 files changed

Lines changed: 58 additions & 7 deletions

File tree

.circleci/config.yml

Lines changed: 45 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ jobs:
472472
name: Dry Run Release for purchases_ui_flutter
473473
command: cd purchases_ui_flutter && flutter pub publish --dry-run
474474

475-
run-maestro-e2e-tests:
475+
run-maestro-e2e-tests-ios:
476476
executor:
477477
name: macos-executor
478478
steps:
@@ -488,8 +488,38 @@ jobs:
488488
xcrun simctl boot "iPhone 16 Pro" || true
489489
xcrun simctl bootstatus "iPhone 16 Pro" -b
490490
- run:
491-
name: Run Maestro E2E Tests
492-
command: bundle exec fastlane run_maestro_e2e_tests
491+
name: Run Maestro E2E Tests (iOS)
492+
command: bundle exec fastlane run_maestro_e2e_tests_ios
493+
no_output_timeout: 15m
494+
- store_test_results:
495+
path: fastlane/test_output
496+
- store_artifacts:
497+
path: fastlane/test_output
498+
499+
run-maestro-e2e-tests-android:
500+
machine:
501+
image: android:2024.11.1
502+
resource_class: xlarge
503+
steps:
504+
- checkout
505+
- run:
506+
name: Install Ruby and Bundler
507+
command: |
508+
gem install bundler
509+
bundle install
510+
- setup-flutter
511+
- revenuecat/install-maestro
512+
- run:
513+
name: Create and start Android emulator
514+
command: |
515+
sdkmanager "system-images;android-34;google_apis;x86_64"
516+
echo "no" | avdmanager create avd -n test-e2e -k "system-images;android-34;google_apis;x86_64" --force
517+
nohup emulator -avd test-e2e -no-audio -no-boot-anim -no-window -gpu swiftshader_indirect &
518+
adb wait-for-device
519+
adb shell input keyevent 82
520+
- run:
521+
name: Run Maestro E2E Tests (Android)
522+
command: bundle exec fastlane run_maestro_e2e_tests_android
493523
no_output_timeout: 15m
494524
- store_test_results:
495525
path: fastlane/test_output
@@ -630,12 +660,22 @@ workflows:
630660
equal: [ bump, << pipeline.parameters.action >> ]
631661
jobs:
632662
- revenuecat/automatic-bump
633-
maestro-e2e-tests:
663+
maestro-e2e-tests-ios:
664+
when:
665+
or:
666+
- equal: ["maestro_e2e_tests", << pipeline.schedule.name >>]
667+
jobs:
668+
- run-maestro-e2e-tests-ios:
669+
context:
670+
- maestro-e2e-tests
671+
- e2e-tests
672+
673+
maestro-e2e-tests-android:
634674
when:
635675
or:
636676
- equal: ["maestro_e2e_tests", << pipeline.schedule.name >>]
637677
jobs:
638-
- run-maestro-e2e-tests:
678+
- run-maestro-e2e-tests-android:
639679
context:
640680
- maestro-e2e-tests
641681
- e2e-tests

fastlane/Fastfile

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,8 @@ lane :update_hybrid_common do |options|
197197
)
198198
end
199199

200-
desc "Run maestro E2E tests"
201-
lane :run_maestro_e2e_tests do
200+
desc "Run maestro E2E tests on iOS"
201+
lane :run_maestro_e2e_tests_ios do
202202
Dir.chdir("e2e-tests/MaestroTestApp") do
203203
sh("sed -i '' 's/MAESTRO_TESTS_REVENUECAT_API_KEY/'\"$RC_E2E_TEST_API_KEY_PRODUCTION_APP_STORE\"'/g' lib/main.dart")
204204
sh("flutter pub get")
@@ -209,6 +209,17 @@ lane :run_maestro_e2e_tests do
209209
sh("maestro test --format junit --output test_output/report.xml e2e-tests/maestro/")
210210
end
211211

212+
desc "Run maestro E2E tests on Android"
213+
lane :run_maestro_e2e_tests_android do
214+
Dir.chdir("e2e-tests/MaestroTestApp") do
215+
sh("sed -i 's/MAESTRO_TESTS_REVENUECAT_API_KEY/'\"$RC_E2E_TEST_API_KEY_PRODUCTION_PLAY_STORE\"'/g' lib/main.dart")
216+
sh("flutter pub get")
217+
sh("flutter build apk --debug")
218+
sh("adb install build/app/outputs/flutter-apk/app-debug.apk")
219+
end
220+
sh("maestro test --format junit --output test_output/report.xml e2e-tests/maestro/")
221+
end
222+
212223
desc "Trigger bump"
213224
lane :trigger_bump do
214225
trigger_action_in_circle_ci(action: 'bump', repo_name: repo_name)

0 commit comments

Comments
 (0)