-
Notifications
You must be signed in to change notification settings - Fork 184
Description
Steps to reproduce
- Create a new Flutter project "Application"
- Follow Patrol Installation steps on https://patrol.leancode.co/documentation for Android
However, set thetest_directoryin "pubspec.yaml" totest/systemand place the example test in that folder. - Start Emulator (Pixel 9 Pro, Android 16.0)
- Run
patrol test -t system/example_test.dart -vor the develop command (has the same result).
I am doing this on Windows 11. Seeing as the issue is path related this might be relevant. I don't have the possibility to test on a different OS.
Actual results
The test setup can't be built and fails at step "Task :app:compileFlutterBuildDebug" because there is an error in the test_bundle.dart file.
// START: GENERATED TEST IMPORTS
import 'C:/git/flutter/patrol_test/test/system/example_test.dart' as C:__git__flutter__patrol_test__test__system__example_test;
// END: GENERATED TEST IMPORTSThis is marked with "Target of URI doesn't exist: 'C:/git/flutter/patrol_test/test/system/example_test.dart'" however that file certainly exists, but dart doesn't allow this import inside the test folder AFAIK.
The test group definition looks like this:
// START: GENERATED TEST GROUPS
group('C:.git.flutter.patrol_test.test.system.example_test', C:__git__flutter__patrol_test__test__system__example_test.main);
// END: GENERATED TEST GROUPSand causes the other errors in the log output.
Running the patrol test command works without any issues with the same setup.
On a side note: I first tried running patrol test -t test/system/example_test.dart but that just gives me: "Error: target file test/system/example_test.dart does not exist"
Logs
Logs
PS C:\git\flutter\patrol_test> patrol test -t system/example_test.dart -v
Verbose mode enabled. More logs will be printed.
Received 1 test target(s)
Received test target: C:\git\flutter\patrol_test\test\system/example_test.dart
Generated entrypoint C:\git\flutter\patrol_test\test/system\test_bundle.dart with 1 bundled test(s)
$ flutter --no-version-check --suppress-analytics devices --machine
Failed to post analytics
ClientException with SocketException: Failed host lookup: 'www.google-analytics.com' (OS Error: Der angegebene Host ist unbekannt.
, errno = 11001), uri=https://www.google-analytics.com/mp/collect?measurement_id=G-W8XN8GS5BC&api_secret=CUIwI1nCQWGJQAK8E0AIfg
Multiple devices found. Please choose one:
[1] sdk gphone64 x86 64 (emulator-5554)
[2] Chrome (chrome)
[3] Edge (edge)
[q] Cancel and exit
Please select an option (1-3, q to quit): 1
Selected device: sdk gphone64 x86 64 (emulator-5554)
Received 1 device(s) to run on
Received device: sdk gphone64 x86 64 (emulator-5554)
$ 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_APP_PACKAGE_NAME=com.example.patrol_test
Received internal --dart-define: PATROL_ANDROID_APP_NAME=Patrol Test
Received internal --dart-define: PATROL_IOS_APP_NAME=Patrol Test
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_DIRECTORY=test/system
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 C:\git\flutter\patrol_test\test/system\test_bundle.dart
$ flutter doctor --verbose
$ .\gradlew.bat :app:dependencies
• Building apk with entrypoint test_bundle.dart...
$ .\gradlew.bat :app:assembleDebug -Ptarget=C:\git\flutter\patrol_test\test/system\test_bundle.dart -Pdart-defines=UEFUUk9MX0FQUF9QQUNLQUdFX05BTUU9Y29tLmV4YW1wbGUucGF0cm9sX3Rlc3Q=,UEFUUk9MX0FORFJPSURfQVBQX05BTUU9UGF0cm9sIFRlc3Q=,UEFUUk9MX0lPU19BUFBfTkFNRT1QYXRyb2wgVGVzdA==,SU5URUdSQVRJT05fVEVTVF9TSE9VTERfUkVQT1JUX1JFU1VMVFNfVE9fTkFUSVZFPWZhbHNl,UEFUUk9MX1RFU1RfTEFCRUxfRU5BQkxFRD10cnVl,UEFUUk9MX1RFU1RfRElSRUNUT1JZPXRlc3Qvc3lzdGVt,UEFUUk9MX1RFU1RfU0VSVkVSX1BPUlQ9ODA4MQ==,UEFUUk9MX0FQUF9TRVJWRVJfUE9SVD04MDgy,Q09WRVJBR0VfRU5BQkxFRD1mYWxzZQ== -Papp-server-port=8082 -Ptest-server-port=8081
: > Task :gradle:checkKotlinGradlePluginConfigurationErrors SKIPPED
: > Task :gradle:compileKotlin UP-TO-DATE
: > Task :gradle:compileJava NO-SOURCE
: > Task :gradle:compileGroovy NO-SOURCE
: > 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:DebugMinSdkCheck
: > Task :app:preBuild UP-TO-DATE
: > Task :app:preDebugBuild UP-TO-DATE
: > Task :app:mergeDebugNativeDebugMetadata NO-SOURCE
: > Task :app:checkKotlinGradlePluginConfigurationErrors SKIPPED
:
: > Task :app:compileFlutterBuildDebug
test/system/test_bundle.dart:13:70: Error: Expected ';' after this.
import 'C:/git/flutter/patrol_test/test/system/example_test.dart' as C:__git__flutter__patrol_test__test__system__example_test;
^
test/system/test_bundle.dart:13:71: Error: Expected a declaration, but got ':'.
import 'C:/git/flutter/patrol_test/test/system/example_test.dart' as C:__git__flutter__patrol_test__test__system__example_test;
^
test/system/test_bundle.dart:13:72: Error: Variables must be declared using the keywords 'const', 'final', 'var' or a type name.
Try adding the name of the type of the variable or the keyword 'var'.
import 'C:/git/flutter/patrol_test/test/system/example_test.dart' as C:__git__flutter__patrol_test__test__system__example_test;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
test/system/test_bundle.dart:13:8: Error: Error when reading 'c:/git/flutter/patrol_test/test/system/example_test.dart': File c:/git/flutter/patrol_test/test/system/example_test.dart does not exist.
import 'C:/git/flutter/patrol_test/test/system/example_test.dart' as C:__git__flutter__patrol_test__test__system__example_test;
^
test/system/test_bundle.dart:73:8: Error: Too few positional arguments: 2 required, 1 given.
group('C:.git.flutter.patrol_test.test.system.example_test', C:__git__flutter__patrol_test__test__system__example_test.main);
^
/C:/dev/flutter/packages/flutter_test/lib/src/test_compat.dart:208:6: Context: Found this candidate, but the arguments don't match.
void group(Object description, void Function() body, {dynamic skip, int? retry}) {
^^^^^
Unhandled exception:
FileSystemException(uri=c:/git/flutter/patrol_test/test/system/example_test.dart; message=StandardFileSystem only supports file:* and data:* URIs)
#0 StandardFileSystem.entityForUri (package:front_end/src/api_prototype/standard_file_system.dart:45)
#1 asFileUri (package:vm/kernel_front_end.dart:984)
#2 writeDepfile (package:vm/kernel_front_end.dart:1147)
<asynchronous suspension>
#3 FrontendCompiler.compile (package:frontend_server/frontend_server.dart:713)
<asynchronous suspension>
#4 starter (package:frontend_server/starter.dart:109)
<asynchronous suspension>
#5 main (file:///C:/b/s/w/ir/x/w/sdk/pkg/frontend_server/bin/frontend_server_starter.dart:13)
<asynchronous suspension>
Target kernel_snapshot_program failed: Exception
:
: > Task :app:compileFlutterBuildDebug FAILED
:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\dev\flutter\bin\flutter.bat'' finished with non-zero exit value 1
: [Incubating] Problems report is available at: file:///C:/git/flutter/patrol_test/build/reports/problems/problems-report.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 36s
:
: 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.12/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
: 6 actionable tasks: 2 executed, 4 up-to-date
✗ Failed to build apk with entrypoint test_bundle.dart (Gradle build failed with code 1) (37.1s)
Exception: Gradle build failed with code 1
Patrol version
patrol: ^4.0.1
Patrol Doctor output
Patrol Doctor output
PS C:\git\flutter\patrol_test> patrol doctor
Patrol doctor:
Patrol CLI version: 4.0.1
Flutter command: flutter
Flutter 3.32.8 • channel stable
Android:
• Program adb found in C:\dev\android\platform-tools\adb.exe
• Env var $ANDROID_HOME set to C:\dev\android
Web:
• Program node found in C:\nvm4w\nodejs\node.exe
• Program npm found in C:\nvm4w\nodejs\npm
C:\nvm4w\nodejs\npm.cmd
Flutter Doctor output
Flutter Doctor output
PS C:\git\flutter\patrol_test> flutter doctor --verbose
[✓] Flutter (Channel stable, 3.32.8, on Microsoft Windows [Version 10.0.26100.7171], locale de-DE) [1.058ms]
• Flutter version 3.32.8 on channel stable at C:\dev\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision edada7c56e (5 months ago), 2025-07-25 14:08:03 +0000
• Engine revision ef0cd00091
• Dart version 3.8.1
• DevTools version 2.45.1
[✓] Windows Version (11 Enterprise 64-bit, 24H2, 2009) [4,5s]
[✓] Android toolchain - develop for Android devices (Android SDK version 36.0.0) [6,4s]
• Android SDK at C:\dev\android
• Platform android-36, build-tools 36.0.0
• ANDROID_HOME = C:\dev\android
• Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
This is the JDK bundled with the latest Android Studio installation on this machine.
To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
• Java version OpenJDK Runtime Environment (build 21.0.8+-14196175-b1038.72)
• All Android licenses accepted.
[✓] Chrome - develop for the web [68ms]
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[✗] Visual Studio - develop Windows apps [64ms]
✗ Visual Studio not installed; this is necessary to develop Windows apps.
Download at https://visualstudio.microsoft.com/downloads/.
Please install the "Desktop development with C++" workload, including all of its default components
[✓] Android Studio (version 2025.2.2) [58ms]
• Android Studio at C:\Program Files\Android\Android Studio
• 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 21.0.8+-14196175-b1038.72)
[✓] VS Code (version 1.107.0) [53ms]
• VS Code at C:\Users\nils\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.120.0
[✓] Connected device (4 available) [910ms]
• sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64 • Android 16 (API 36) (emulator)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.26100.7171]
• Chrome (web) • chrome • web-javascript • Google Chrome 143.0.7499.41
• Edge (web) • edge • web-javascript • Microsoft Edge 142.0.3595.76
[✓] Network resources [848ms]
• All expected network resources are available.
! Doctor found issues in 1 category.