Skip to content

follow documentation for patrol #16

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

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

follow documentation for patrol #16

wants to merge 9 commits into from

Conversation

prolificcoder
Copy link
Owner

@prolificcoder prolificcoder commented May 13, 2023

Currently running into

➜  house_stats git:(try_patrol) ✗ patrol test --target integration_test/ --dart-define=isTestApp=true

No device specified, using the first one (emulator-5554)
Every test target will be run 1 time(s)
• Building apk with entrypoint house_integration_test.dart...
	/bin/sh: ./gradlew: No such file or directory
✗ Failed to build apk with entrypoint house_integration_test.dart (Gradle build failed with code 127) (15ms)
Exception: Gradle build failed with code 127
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.
• Building apk with entrypoint house_mocked_integration_test.dart...
	/bin/sh: ./gradlew: No such file or directory
✗ Failed to build apk with entrypoint house_mocked_integration_test.dart (Gradle build failed with code 127) (5ms)
Exception: Gradle build failed with code 127
See the logs above to learn what happened. Also consider running with --verbose. If the logs still aren't useful, th
en it's a bug - please report it.
 FAIL  house_integration_test.dart on emulator-5554
 FAIL  house_mocked_integration_test.dart on emulator-5554

Now able to invoke the test locally with
patrol test --target integration_test/house_mocked_integration_test.dart --dart-define=isTestApp=true --verbose and runs on my device

@prolificcoder
Copy link
Owner Author

Command used

patrol build android --target integration_test/house_mocked_integration_test.dart,integration_test/house_mocked_integration2_test.dart
Log error

patrol build android --target integration_test/house_mocked_integration_test.dart,integration_test/house_mocked_integration2_test.dart --dart-define=isTestApp=true
• Building apk with entrypoint test_bundle.dart...
e: file:///Users/smalugu/.pub-cache/git/patrol-168113aeb798d3528e296d3bc9785df3778c51ba/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/AutomatorServer.kt:12:37 Unresolved reference: empty
e: file:///Users/smalugu/.pub-cache/git/patrol-168113aeb798d3528e296d3bc9785df3778c51ba/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/AutomatorServer.kt:13:37 Unresolved reference: getNativeViewsResponse
e: file:///Users/smalugu/.pub-cache/git/patrol-168113aeb798d3528e296d3bc9785df3778c51ba/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/AutomatorServer.kt:14:37 Unresolved reference: getNotificationsResponse
e: file:///Users/smalugu/.pub-cache/git/patrol-168113aeb798d3528e296d3bc9785df3778c51ba/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/AutomatorServer.kt:15:37 Unresolved reference: permissionDialogVisibleResponse
e: file:///Users/smalugu/.pub-cache/git/patrol-168113aeb798d3528e296d3bc9785df3778c51ba/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/AutomatorServer.kt:19:47 Unresolved reference: Automator
e: file:///Users/smalugu/.pub-cache/git/patrol-168113aeb798d3528e296d3bc9785df3778c51ba/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/AutomatorServer.kt:22:16 Unresolved reference: empty
e: file:///Users/smalugu/.pub-cache/git/patrol-168113aeb798d3528e296d3bc9785df3778c51ba/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/AutomatorServer.kt:27:16 Unresolved reference: empty
e: file:///Users/smalugu/.pub-cache/git/patrol-168113aeb798d3528e296d3bc9785df3778c51ba/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/AutomatorServer.kt:32:16 Unresolved reference: empty
e: file:///Users/smalugu/.pub-cache/git/patrol-168113aeb798d3528e296d3bc9785df3778c51ba/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/AutomatorServer.kt:37:16 Unresolved reference: empty
e: file:///Users/smalugu/.pub-cache/git/patrol-168113aeb798d3528e296d3bc9785df3778c51ba/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/AutomatorServer.kt:42:16 Unresolved reference: empty
e: file:///Users/smalugu/.pub-cache/git/patrol-168113aeb798d3528e296d3bc9785df3778c51ba/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/AutomatorServer.kt:47:16 Unresolved reference: empty
e: file:///Users/smalugu/.pub-cache/git/patrol-168113aeb798d3528e296d3bc9785df3778c51ba/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/AutomatorServer.kt:52:16 Unresolved reference: empty
e: file:///Users/smalugu/.pub-cache/git/patrol-168113aeb798d3528e296d3bc9785df3778c51ba/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/AutomatorServer.kt:57:16 Unresolved reference: empty
e: file:///Users/smalugu/.pub-cache/git/patrol-168113aeb798d3528e296d3bc9785df3778c51ba/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/AutomatorServer.kt:62:16 Unresolved reference: empty
e: file:///Users/smalugu/.pub-cache/git/patrol-168113aeb798d3528e296d3bc9785df3778c51ba/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/AutomatorServer.kt:67:16 Unresolved reference: empty
e: file:///Users/smalugu/.pub-cache/git/patrol-168113aeb798d3528e296d3bc9785df3778c51ba/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/AutomatorServer.kt:72:16 Unresolved reference: empty
e: file:///Users/smalugu/.pub-cache/git/patrol-168113aeb798d3528e296d3bc9785df3778c51ba/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/AutomatorServer.kt:77:16 Unresolved reference: empty
e: file:///Users/smalugu/.pub-cache/git/patrol-168113aeb798d3528e296d3bc9785df3778c51ba/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/AutomatorServer.kt:82:16 Unresolved reference: empty
e: file:///Users/smalugu/.pub-cache/git/patrol-168113aeb798d3528e296d3bc9785df3778c51ba/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/AutomatorServer.kt:87:16 Unresolved reference: empty
e: file:///Users/smalugu/.pub-cache/git/patrol-168113aeb798d3528e296d3bc9785df3778c51ba/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/AutomatorServer.kt:92:16 Unresolved reference: empty
e: file:///Users/smalugu/.pub-cache/git/patrol-168113aeb798d3528e296d3bc9785df3778c51ba/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/AutomatorServer.kt:97:16 Unresolved reference: empty
e: file:///Users/smalugu/.pub-cache/git/patrol-168113aeb798d3528e296d3bc9785df3778c51ba/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/AutomatorServer.kt:102:16 Unresolved reference: empty
e: file:///Users/smalugu/.pub-cache/git/patrol-168113aeb798d3528e296d3bc9785df3778c51ba/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/AutomatorServer.kt:107:16 Unresolved reference: empty
e: file:///Users/smalugu/.pub-cache/git/patrol-168113aeb798d3528e296d3bc9785df3778c51ba/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/AutomatorServer.kt:112:16 Unresolved reference: empty
e: file:///Users/smalugu/.pub-cache/git/patrol-168113aeb798d3528e296d3bc9785df3778c51ba/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/AutomatorServer.kt:117:16 Unresolved reference: getNativeViewsResponse
e: file:///Users/smalugu/.pub-cache/git/patrol-168113aeb798d3528e296d3bc9785df3778c51ba/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/AutomatorServer.kt:117:41 Unresolved reference: nativeViews
e: file:///Users/smalugu/.pub-cache/git/patrol-168113aeb798d3528e296d3bc9785df3778c51ba/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/AutomatorServer.kt:122:16 Unresolved reference: getNotificationsResponse
e: file:///Users/smalugu/.pub-cache/git/patrol-168113aeb798d3528e296d3bc9785df3778c51ba/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/AutomatorServer.kt:122:43 Unresolved reference: notifications
e: file:///Users/smalugu/.pub-cache/git/patrol-168113aeb798d3528e296d3bc9785df3778c51ba/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/AutomatorServer.kt:132:16 Unresolved reference: empty
e: file:///Users/smalugu/.pub-cache/git/patrol-168113aeb798d3528e296d3bc9785df3778c51ba/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/AutomatorServer.kt:142:16 Unresolved reference: empty
e: file:///Users/smalugu/.pub-cache/git/patrol-168113aeb798d3528e296d3bc9785df3778c51ba/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/AutomatorServer.kt:158:16 Unresolved reference: empty
e: file:///Users/smalugu/.pub-cache/git/patrol-168113aeb798d3528e296d3bc9785df3778c51ba/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/AutomatorServer.kt:169:16 Unresolved reference: empty
e: file:///Users/smalugu/.pub-cache/git/patrol-168113aeb798d3528e296d3bc9785df3778c51ba/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/AutomatorServer.kt:174:16 Unresolved reference: permissionDialogVisibleResponse
e: file:///Users/smalugu/.pub-cache/git/patrol-168113aeb798d3528e296d3bc9785df3778c51ba/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/AutomatorServer.kt:174:55 Unresolved reference: visible
e: file:///Users/smalugu/.pub-cache/git/patrol-168113aeb798d3528e296d3bc9785df3778c51ba/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/AutomatorServer.kt:184:16 Unresolved reference: empty
e: file:///Users/smalugu/.pub-cache/git/patrol-168113aeb798d3528e296d3bc9785df3778c51ba/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/AutomatorServer.kt:193:16 Unresolved reference: empty
e: file:///Users/smalugu/.pub-cache/git/patrol-168113aeb798d3528e296d3bc9785df3778c51ba/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/AutomatorServer.kt:202:16 Unresolved reference: empty
e: file:///Users/smalugu/.pub-cache/git/patrol-168113aeb798d3528e296d3bc9785df3778c51ba/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/AutomatorServer.kt:207:16 Unresolved reference: empty
e: file:///Users/smalugu/.pub-cache/git/patrol-168113aeb798d3528e296d3bc9785df3778c51ba/packages/patrol/android/src/main/kotlin/pl/leancode/patrol/PatrolServer.kt:20:54 Unresolved reference: Automator

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':patrol:compileDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
   > Compilation error. See log for more details

* 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 8s

✗ Failed to build apk with entrypoint test_bundle.dart (Gradle build failed with code 1) (9.2s)
Exception: Gradle build failed with code 1
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.
Exception: Gradle build failed with code 1
#0 AndroidTestBackend.build. (package:patrol_cli/src/android/android_test_backend.dart:67:9)

#1 DisposeScope.run (package:dispose_scope/src/dispose_scope.dart:44:7)

#2 AndroidTestBackend.build (package:patrol_cli/src/android/android_test_backend.dart:42:5)

#3 BuildAndroidCommand.run (package:patrol_cli/src/commands/build_android.dart:123:7)

#4 CommandRunner.runCommand (package:args/command_runner.dart:212:13)

#5 PatrolCommandRunner.runCommand (package:patrol_cli/src/runner/patrol_command_runner.dart:314:18)

#6 PatrolCommandRunner.run (package:patrol_cli/src/runner/patrol_command_runner.dart:258:18)

#7 patrolCommandRunner (package:patrol_cli/src/runner/patrol_command_runner.dart:66:20)

#8 main (file:///Users/smalugu/.pub-cache/git/patrol-168113aeb798d3528e296d3bc9785df3778c51ba/packages/patrol_cli/bin/main.dart:6:20)

@@ -43,11 +43,12 @@ android {

defaultConfig {
applicationId "com.malugu.housestats"
minSdkVersion flutter.minSdkVersion
minSdkVersion 19
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

had to change this for multidex

@@ -65,8 +66,9 @@ flutter {

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "androidx.multidex:multidex:2.0.1"
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

had to add it for multidex

expect($('House details'), findsOneWidget);
expect($('1house'), findsOneWidget);
},
nativeAutomation: true,
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the order has to be this way, otherwise it won't compile. Perhaps you are using a different version of dart for your example projects?

image

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's because you're using Dart older than 2.17.

https://dart.dev/guides/language/evolution#dart-217

Dart 2.17 removed some restrictions on named arguments. Named arguments can now be freely interleaved with positional arguments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants