leancodepl / patrol

Flutter-first UI testing framework. Ready for action!
https://patrol.leancode.co
Apache License 2.0
826 stars 118 forks source link

Patrol Build for Parallel Testing in Bitrise #2192

Open agungigloohome opened 2 months ago

agungigloohome commented 2 months ago

Use case

So, I want to create parallel testing on Bitrise using Bitrise's Pipelines. In my workflow, I use patrol build which will generate app-debug.apk build/app/outputs/apk/debug/app-debug.apk and also app-debug-androidTest.apk build/app/outputs/apk/androidTest/debug/app-debug-androidTest.apk (which functions like a finger that will click whatever is selected from my_app) to build the app before testing it using the emulator.

For example, if I have 2 flows, each flow will build app-debug.apk, which I think is wasteful. Is there a way for me to build app-debug.apk only once but build app-debug-androidTest.apk only every time I want to run a test? Because this will really save time in doing parallel testing on Bitrise.

Proposal

Maybe need a property for patrol build like this

patrol build android --test-only and patrol build android --app-only or something like that.

ewann commented 2 months ago

I believe you're asking for a similar thing as https://github.com/leancodepl/patrol/discussions/2169

FWIW I stopped looking into this because the issue isn't yet impactful enough for me to commit more time at the moment. I will note though that if you run patrol with verbose logging, you can see the individual actions being driven, eg:

xcodebuild test-without-building -xctestrun /Users/<redact>/build/macos_integ/Build/Products/Runner_macosx14.5-arm64.xctestrun -only-testing RunnerUITests/RunnerUITests -destination platform=macOS -resultBundlePath /Users/<redact>/build/macos_results_1715811127003.xcresult -verbose

and can maybe assemble what you want that way. Out of the box I don't think it's possible, but if you learn otherwise I'd be interested.