leancodepl / patrol

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

Test Project does not execute patrol/packages/patrol/example #2369

Open lucasdidur opened 1 month ago

lucasdidur commented 1 month ago

Steps to reproduce

Clone the project and run patrol test

Actual results

Verbose Log

example git:(master) ✗ patrol test --verbose Verbose mode enabled. More logs will be printed. Received 2 test target(s) Received test target: /Users/lucasdidur/Documents/GitHub/patrol/packages/patrol/example/integration_test/example_test.dart Received test target: /Users/lucasdidur/Documents/GitHub/patrol/packages/patrol/example/integration_test/main_test.dart Generated entrypoint /Users/lucasdidur/Documents/GitHub/patrol/packages/patrol/example/integration_test/test_bundle.dart with 2 bundled test(s) Received Android flavor: dev Received iOS flavor: dev $ flutter --no-version-check --suppress-analytics devices --machine No device specified, using the first one (ZD54AS54DAS) Received 1 device(s) to run on Received device: ZD54AS54DAS $ flutter doctor --verbose $ flutter --suppress-analytics --no-version-check pub deps --style=list Received 9 --dart-define(s) (0 custom, 9 internal) Received internal --dart-define: PATROL_WAIT=0 Received internal --dart-define: PATROL_APP_PACKAGE_NAME=pl.leancode.patrol.example Received internal --dart-define: PATROL_APP_BUNDLE_ID=pl.leancode.patrol.Example Received internal --dart-define: PATROL_MACOS_APP_BUNDLE_ID=pl.leancode.patrol.macos.example Received internal --dart-define: INTEGRATION_TEST_SHOULD_REPORT_RESULTS_TO_NATIVE=false Received internal --dart-define: PATROL_TEST_LABEL_ENABLED=true Received internal --dart-define: PATROL_TEST_SERVER_PORT=8081 Received internal --dart-define: PATROL_APP_SERVER_PORT=8082 Received internal --dart-define: COVERAGE_ENABLED=false $ flutter build apk --config-only -t integration_test/test_bundle.dart $ flutter doctor --verbose • Building apk with entrypoint test_bundle.dart... $ ./gradlew :app:assembleDevDebug -Ptarget=/Users/lucasdidur/Documents/GitHub/patrol/packages/patrol/example/integration_test/test_bundle.dart -Pdart-defines=UEFUUk9MX1dBSVQ9MA==,UEFUUk9MX0FQUF9QQUNLQUdFX05BTUU9cGwubGVhbmNvZGUucGF0cm9sLmV4YW1wbGU=,UEFUUk9MX0FQUF9CVU5ETEVfSUQ9cGwubGVhbmNvZGUucGF0cm9sLkV4YW1wbGU=,UEFUUk9MX01BQ09TX0FQUF9CVU5ETEVfSUQ9cGwubGVhbmNvZGUucGF0cm9sLm1hY29zLmV4YW1wbGU=,SU5URUdSQVRJT05fVEVTVF9TSE9VTERfUkVQT1JUX1JFU1VMVFNfVE9fTkFUSVZFPWZhbHNl,UEFUUk9MX1RFU1RfTEFCRUxfRU5BQkxFRD10cnVl,UEFUUk9MX1RFU1RfU0VSVkVSX1BPUlQ9ODA4MQ==,UEFUUk9MX0FQUF9TRVJWRVJfUE9SVD04MDgy,Q09WRVJBR0VfRU5BQkxFRD1mYWxzZQ== -Papp-server-port=8082 -Ptest-server-port=8081 : > Task :gradle:compileJava NO-SOURCE : > Task :gradle:compileGroovy UP-TO-DATE : > Task :gradle:pluginDescriptors UP-TO-DATE : > Task :gradle:processResources UP-TO-DATE : > Task :gradle:classes UP-TO-DATE : > Task :gradle:jar UP-TO-DATE : > Task :app:preBuild UP-TO-DATE : > Task :app:preDevDebugBuild UP-TO-DATE : > Task :app:mergeDevDebugNativeDebugMetadata NO-SOURCE : > Task :app:checkKotlinGradlePluginConfigurationErrors : > Task :app:compileFlutterBuildDevDebug : > Task :app:packJniLibsflutterBuildDevDebug UP-TO-DATE : > Task :firebase_auth:preBuild UP-TO-DATE : > Task :firebase_auth:preDebugBuild UP-TO-DATE ... : > Task :google_sign_in_android:processDebugJavaRes NO-SOURCE : > Task :patrol:processDebugJavaRes UP-TO-DATE : > Task :permission_handler_android:processDebugJavaRes NO-SOURCE : > Task :app:checkDevDebugDuplicateClasses UP-TO-DATE : > Task :app:desugarDevDebugFileDependencies UP-TO-DATE : > Task :app:mergeExtDexDevDebug UP-TO-DATE : > Task :firebase_auth:bundleLibRuntimeToJarDebug UP-TO-DATE : > Task :firebase_core:bundleLibRuntimeToJarDebug UP-TO-DATE : > Task :firebase_messaging:bundleLibRuntimeToJarDebug UP-TO-DATE : > Task :flutter_local_notifications:bundleLibRuntimeToJarDebug UP-TO-DATE : > Task :flutter_native_splash:bundleLibRuntimeToJarDebug UP-TO-DATE : > Task :geocoding_android:bundleLibRuntimeToJarDebug UP-TO-DATE : > Task :geolocator_android:bundleLibRuntimeToJarDebug UP-TO-DATE : > Task :google_sign_in_android:bundleLibRuntimeToJarDebug UP-TO-DATE : > Task :patrol:bundleLibRuntimeToJarDebug UP-TO-DATE : > Task :permission_handler_android:bundleLibRuntimeToJarDebug UP-TO-DATE : > Task :app:mergeDevDebugJniLibFolders UP-TO-DATE : > Task :app:mergeLibDexDevDebug UP-TO-DATE : > Task :app:compileDevDebugKotlin : > Task :firebase_auth:mergeDebugJniLibFolders UP-TO-DATE : > Task :app:compileDevDebugJavaWithJavac UP-TO-DATE : > Task :app:bundleDevDebugClassesToCompileJar UP-TO-DATE : > Task :app:compileDevDebugAndroidTestKotlin NO-SOURCE : > Task :app:compileDevDebugAndroidTestJavaWithJavac UP-TO-DATE : > Task :app:processDevDebugJavaRes UP-TO-DATE : > Task :app:mergeDevDebugJavaResource UP-TO-DATE : > Task :app:dexBuilderDevDebug UP-TO-DATE : > Task :app:mergeProjectDexDevDebug UP-TO-DATE : > Task :firebase_auth:mergeDebugNativeLibs NO-SOURCE : > Task :firebase_auth:copyDebugJniLibsProjectOnly UP-TO-DATE : > Task :firebase_core:mergeDebugJniLibFolders UP-TO-DATE : > Task :firebase_core:mergeDebugNativeLibs NO-SOURCE : > Task :firebase_core:copyDebugJniLibsProjectOnly UP-TO-DATE : > Task :firebase_messaging:mergeDebugJniLibFolders UP-TO-DATE : > Task :firebase_messaging:mergeDebugNativeLibs NO-SOURCE : > Task :firebase_messaging:copyDebugJniLibsProjectOnly UP-TO-DATE : > Task :flutter_local_notifications:mergeDebugJniLibFolders UP-TO-DATE : > Task :flutter_local_notifications:mergeDebugNativeLibs NO-SOURCE : > Task :flutter_local_notifications:copyDebugJniLibsProjectOnly UP-TO-DATE : > Task :flutter_native_splash:mergeDebugJniLibFolders UP-TO-DATE : > Task :flutter_native_splash:mergeDebugNativeLibs NO-SOURCE : > Task :flutter_native_splash:copyDebugJniLibsProjectOnly UP-TO-DATE : > Task :geocoding_android:mergeDebugJniLibFolders UP-TO-DATE : > Task :geocoding_android:mergeDebugNativeLibs NO-SOURCE : > Task :geocoding_android:copyDebugJniLibsProjectOnly UP-TO-DATE : > Task :geolocator_android:mergeDebugJniLibFolders UP-TO-DATE : > Task :geolocator_android:mergeDebugNativeLibs NO-SOURCE : > Task :geolocator_android:copyDebugJniLibsProjectOnly UP-TO-DATE : > Task :google_sign_in_android:mergeDebugJniLibFolders UP-TO-DATE : > Task :google_sign_in_android:mergeDebugNativeLibs NO-SOURCE : > Task :google_sign_in_android:copyDebugJniLibsProjectOnly UP-TO-DATE : > Task :patrol:mergeDebugJniLibFolders UP-TO-DATE : > Task :patrol:mergeDebugNativeLibs NO-SOURCE : > Task :patrol:copyDebugJniLibsProjectOnly UP-TO-DATE : > Task :permission_handler_android:mergeDebugJniLibFolders UP-TO-DATE : > Task :permission_handler_android:mergeDebugNativeLibs NO-SOURCE : > Task :permission_handler_android:copyDebugJniLibsProjectOnly UP-TO-DATE : > Task :app:mergeDevDebugNativeLibs UP-TO-DATE : > Task :app:stripDevDebugDebugSymbols UP-TO-DATE : > Task :app:validateSigningDevDebug UP-TO-DATE : > Task :app:writeDevDebugAppMetadata UP-TO-DATE : > Task :app:writeDevDebugSigningConfigVersions UP-TO-DATE : > Task :app:packageDevDebug UP-TO-DATE : > Task :app:createDevDebugApkListingFileRedirect UP-TO-DATE : > Task :app:mergeDevDebugAndroidTestShaders UP-TO-DATE : > Task :app:compileDevDebugAndroidTestShaders NO-SOURCE : > Task :app:generateDevDebugAndroidTestAssets UP-TO-DATE : > Task :app:mergeDevDebugAndroidTestAssets UP-TO-DATE : > Task :app:compressDevDebugAndroidTestAssets UP-TO-DATE : > Task :app:processDevDebugAndroidTestJavaRes NO-SOURCE : > Task :app:mergeDevDebugAndroidTestJavaResource UP-TO-DATE : > Task :app:mergeDevDebugAndroidTestJniLibFolders UP-TO-DATE : > Task :app:mergeDevDebugAndroidTestNativeLibs NO-SOURCE : > Task :app:checkDevDebugAndroidTestDuplicateClasses UP-TO-DATE : > Task :app:desugarDevDebugAndroidTestFileDependencies UP-TO-DATE : > Task :app:mergeExtDexDevDebugAndroidTest UP-TO-DATE : > Task :app:mergeLibDexDevDebugAndroidTest UP-TO-DATE : > Task :app:dexBuilderDevDebugAndroidTest : > Task :app:mergeProjectDexDevDebugAndroidTest UP-TO-DATE : > Task :app:validateSigningDevDebugAndroidTest UP-TO-DATE : > Task :app:writeDevDebugAndroidTestSigningConfigVersions UP-TO-DATE : > Task :app:packageDevDebugAndroidTest UP-TO-DATE : > Task :app:createDevDebugAndroidTestApkListingFileRedirect UP-TO-DATE : > Task :app:connectedDevDebugAndroidTest FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:connectedDevDebugAndroidTest'. See the report at: file:///Users/lucasdidur/Documents/GitHub/patrol/packages/patrol/example/build/app/reports/androidTests/connected/debug/flavors/dev/index.html * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. > Get more help at https://help.gradle.org. BUILD FAILED in 12s : : Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0. : : You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins. : : For more on this, please refer to https://docs.gradle.org/8.4/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation. : 236 actionable tasks: 9 executed, 227 up-to-date ✗ Failed to execute tests of apk with entrypoint test_bundle.dart on device ZD54AS54DAS (Gradle test execution failed with code 1) (13.3s) Exception: Gradle test execution failed with code 1 #0 AndroidTestBackend.execute. (package:patrol_cli/src/android/android_test_backend.dart:232:9) #1 DisposeScope.run (package:dispose_scope/src/dispose_scope.dart:46:7) #2 AndroidTestBackend.execute (package:patrol_cli/src/android/android_test_backend.dart:191:5) #3 TestCommand._execute (package:patrol_cli/src/commands/test.dart:369:7) #4 TestCommand.run (package:patrol_cli/src/commands/test.dart:261:23) #5 CommandRunner.runCommand (package:args/command_runner.dart:212:13) #6 PatrolCommandRunner.runCommand (package:patrol_cli/src/runner/patrol_command_runner.dart:358:18) #7 PatrolCommandRunner.run (package:patrol_cli/src/runner/patrol_command_runner.dart:302:18) #8 patrolCommandRunner (package:patrol_cli/src/runner/patrol_command_runner.dart:71:20) #9 main (file:///Users/lucasdidur/.pub-cache/hosted/pub.dev/patrol_cli-3.2.0/bin/main.dart:6:20) See the logs above to learn what happened. Also consider running with --verbose. If the logs still aren't useful, then it's a bug - please report it. Uninstalling pl.leancode.patrol.example from moto g54 5G Uninstalling pl.leancode.patrol.example.test from moto g54 5G

Logs

Logs ``` ```

Patrol version

HEAD VERSION

Patrol Doctor output

Patrol Doctor output ``` ➜ example git:(master) ✗ patrol doctor Patrol doctor: Patrol CLI version: 3.2.0 Flutter command: flutter Flutter 3.24.3 • channel stable Android: • Program adb found in /Users/lucasdidur/Library/Android/sdk/platform-tools/adb • Env var $ANDROID_HOME set to /Users/lucasdidur/Library/Android/sdk iOS / macOS: • Program xcodebuild found in /usr/bin/xcodebuild • Program ideviceinstaller found in /opt/homebrew/bin/ideviceinstaller ```

Flutter Doctor output

Flutter Doctor output ``` ➜ example git:(master) ✗ flutter doctor -v [✓] Flutter (Channel stable, 3.24.3, on macOS 14.6.1 23G93 darwin-arm64, locale pt-BR) • Flutter version 3.24.3 on channel stable at /Users/lucasdidur/fvm/versions/stable • Upstream repository https://github.com/flutter/flutter.git • Framework revision 2663184aa7 (5 weeks ago), 2024-09-11 16:27:48 -0500 • Engine revision 36335019a8 • Dart version 3.5.3 • DevTools version 2.37.3 [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) • Android SDK at /Users/lucasdidur/Library/Android/sdk • Platform android-34, build-tools 34.0.0 • ANDROID_HOME = /Users/lucasdidur/Library/Android/sdk • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 15.4) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 15F31d • CocoaPods version 1.15.2 [✓] Android Studio (version 2024.1) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314) [✓] IntelliJ IDEA Ultimate Edition (version 2024.2.0.2) • IntelliJ at /Applications/IntelliJ IDEA.app • Flutter plugin version 81.1.3 • Dart plugin version 242.20629 [✓] VS Code (version 1.94.2) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.98.0 [✓] Connected device (3 available) • moto g54 5G (mobile) • • android-arm64 • Android 14 (API 34) • Lucas Didur (mobile) • ios • iOS 18.0.1 22A3370 • Mac Designed for iPad (desktop) • mac-designed-for-ipad • darwin • macOS 14.6.1 23G93 darwin-arm64 [✓] Network resources • All expected network resources are available. • No issues found! ```
Kendru98 commented 1 month ago

Hi @lucasdidur did you try to run this on physical device? I checked it now on emulator API 33 and all works fine, can you try other device? For me, it's working fine

lucasdidur commented 1 month ago

@Kendru98, I have tested and confirmed that on physical Android 14 devices the tests does not run. I have a Android 10 phone and worked.

lucasdidur commented 1 month ago

Api 34

Kendru98 commented 1 month ago

Thanks for your effort. We will investigate this, It only works for some people, for some it doesn't. You can try ./gradlew clean, I will back to you if we find something. Cheers

zhukeev commented 1 week ago

same here, any updates ?