Skip to content
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

setUpAll is being invoked twice during the patrol test #1895

Closed
haomun0731 opened this issue Nov 14, 2023 · 3 comments
Closed

setUpAll is being invoked twice during the patrol test #1895

haomun0731 opened this issue Nov 14, 2023 · 3 comments

Comments

@haomun0731
Copy link

Steps to reproduce

The patrol test code is as follows:

import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:patrol/patrol.dart';

void main() {
  setUpAll(() async {
    debugPrint('setUpAll - calling API');
  });

  patrolTest(
    'counter state is the same after going to home and switching apps',
    nativeAutomation: true,
    ($) async {
      await $.pumpWidgetAndSettle(
        MaterialApp(
          home: Scaffold(
            appBar: AppBar(title: const Text('app')),
          ),
        ),
      );

      expect($('app'), findsOneWidget);
      await $.native.pressHome();
    },
  );
}

Actual results

IS: 'setUpAll' being invoked twice
SHOULD: 'setUpAll' being invoked only once as per the doc: https://api.flutter.dev/flutter/flutter_test/setUpAll.html

See the flutter logs:

Showing AOSP on IA Emulator logs:
I/flutter (14063): The Dart VM service is listening on http://127.0.0.1:36961/xFrDspOIlCo=/
I/flutter (14063): Patrol (native): initialize() started
I/flutter (14063): Patrol (native): initialize() succeeded
I/flutter (14063): 00:00 +0: patrol_test_explorer
I/flutter (14063): patrol_test_explorer: obtained Dart-side test hierarchy:
I/flutter (14063): -- group: ''
I/flutter (14063):      -- group: 'counter state is the same after going to home and switching apps'
I/flutter (14063): PatrolAppService started, address: 0.0.0.0, host: 0.0.0.0, port: 8082
I/flutter (14063): Patrol (native): markPatrolAppServiceReady() started
I/flutter (14063): 00:00 +1: example_test (setUpAll)
I/flutter (14063): setUpAll - calling API
I/flutter (14063): 00:00 +2: example_test counter state is the same after going to home and switching apps
I/flutter (14063): Patrol (native): markPatrolAppServiceReady() succeeded
I/flutter (14063): PatrolAppService: registered "example_test counter state is the same after going to home and switching apps"
I/flutter (14063): PatrolAppService.listDartTests() called
I/flutter (14063): 2023-11-14T11:52:21.522605  0:00:00.012473 GET     [200] /listDartTests
I/flutter (14169): The Dart VM service is listening on http://127.0.0.1:34604/8gRA3FjS6a0=/
I/flutter (14169): Patrol (native): initialize() started
I/flutter (14169): Patrol (native): initialize() succeeded
I/flutter (14169): 00:00 +0: patrol_test_explorer
I/flutter (14169): patrol_test_explorer: obtained Dart-side test hierarchy:
I/flutter (14169): -- group: ''
I/flutter (14169):      -- group: 'counter state is the same after going to home and switching apps'
I/flutter (14169): PatrolAppService started, address: 0.0.0.0, host: 0.0.0.0, port: 8082
I/flutter (14169): Patrol (native): markPatrolAppServiceReady() started
I/flutter (14169): 00:00 +1: example_test (setUpAll)
I/flutter (14169): setUpAll - calling API
I/flutter (14169): 00:00 +2: example_test counter state is the same after going to home and switching apps
I/flutter (14169): Patrol (native): markPatrolAppServiceReady() succeeded
I/flutter (14169): PatrolAppService: registered "example_test counter state is the same after going to home and switching apps"
I/flutter (14169): PatrolAppService.listDartTests() called
I/flutter (14169): 2023-11-14T11:52:25.378652  0:00:00.006766 GET     [200] /listDartTests
I/flutter (14169): PatrolAppService.runDartTest(example_test counter state is the same after going to home and switching apps) called
I/flutter (14169): PatrolAppService: requested execution of test "example_test counter state is the same after going to home and switching apps"
I/flutter (14169): Patrol (native): configure() started
I/flutter (14169): Patrol (native): configure() succeeded
I/flutter (14169): Patrol (native): pressHome() started
I/flutter (14169): Patrol (native): pressHome() succeeded
I/flutter (14169): PatrolBinding: tearDown(): count: 1, results: {counter state is the same after going to home and switching apps: success}
I/flutter (14169): PatrolBinding: finished test example_test counter state is the same after going to home and switching apps. Will report its status back to the native side
I/flutter (14169): PatrolBinding: tearDown(): test "counter state is the same after going to home and switching apps" in group "example_test counter state is the same after going to home and switching apps", passed: true
I/flutter (14169): PatrolAppService.markDartTestAsCompleted(): example_test counter state is the same after going to home and switching apps
I/flutter (14169): 2023-11-14T11:52:25.474498  0:00:02.399937 POST    [200] /runDartTest
I/flutter (14169): 00:02 +3: example_test (tearDownAll)
I/flutter (14169): 00:02 +4: (tearDownAll)
I/flutter (14169): 00:02 +5: All tests passed!

Logs

Logs
Received 1 test target(s)
Received test target: /Users/haomun/Desktop/Flutter_project/integration_demo/integration_test/example_test.dart
Generated entrypoint /Users/haomun/Desktop/Flutter_project/integration_demo/integration_test/test_bundle.dart with 1 bundled test(s)
$ flutter --no-version-check devices --machine
No device specified, using the first one (emulator-5554)
Received 1 device(s) to run on
Received device: emulator-5554
Received 7 --dart-define(s) (0 custom, 7 internal)
Received internal --dart-define: PATROL_WAIT=0
Received internal --dart-define: PATROL_APP_PACKAGE_NAME=com.example.integration_demo
Received internal --dart-define: PATROL_APP_BUNDLE_ID=com.example.integrationDemo
Received internal --dart-define: PATROL_ANDROID_APP_NAME=demo
Received internal --dart-define: PATROL_IOS_APP_NAME=demo
Received internal --dart-define: INTEGRATION_TEST_SHOULD_REPORT_RESULTS_TO_NATIVE=false
Received internal --dart-define: PATROL_TEST_LABEL_ENABLED=true
• Building apk with entrypoint test_bundle.dart...
$ ./gradlew :app:assembleDebug -Ptarget=/Users/haomun/Desktop/Flutter_project/integration_demo/integration_test/test_bundle.dart -Pdart-defines=UEFUUk9MX1dBSVQ9MA==,UEFUUk9MX0FQUF9QQUNLQUdFX05BTUU9Y29tLmV4YW1wbGUuaW50ZWdyYXRpb25fZGVtbw==,UEFUUk9MX0FQUF9CVU5ETEVfSUQ9Y29tLmV4YW1wbGUuaW50ZWdyYXRpb25EZW1v,UEFUUk9MX0FORFJPSURfQVBQX05BTUU9ZGVtbw==,UEFUUk9MX0lPU19BUFBfTkFNRT1kZW1v,SU5URUdSQVRJT05fVEVTVF9TSE9VTERfUkVQT1JUX1JFU1VMVFNfVE9fTkFUSVZFPWZhbHNl,UEFUUk9MX1RFU1RfTEFCRUxfRU5BQkxFRD10cnVl
        : > Task :gradle:extractPluginRequests NO-SOURCE
        : > Task :gradle:generatePluginAdapters UP-TO-DATE
        : > Task :gradle:compileJava NO-SOURCE
        : > Task :gradle:compileGroovy UP-TO-DATE
        : > Task :gradle:compileGroovyPlugins 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:preBuild UP-TO-DATE
        : > Task :app:preDebugBuild UP-TO-DATE
        : > Task :app:mergeDebugNativeDebugMetadata NO-SOURCE
        : > Task :app:compileFlutterBuildDebug UP-TO-DATE
        : > Task :app:packLibsflutterBuildDebug UP-TO-DATE
        : > Task :integration_test:preBuild UP-TO-DATE
        : > Task :integration_test:preDebugBuild UP-TO-DATE
        : > Task :integration_test:compileDebugAidl NO-SOURCE
        : > Task :patrol:preBuild UP-TO-DATE
        : > Task :patrol:preDebugBuild UP-TO-DATE
        : > Task :patrol:compileDebugAidl NO-SOURCE
        : > Task :app:compileDebugAidl NO-SOURCE
        : > Task :integration_test:packageDebugRenderscript NO-SOURCE
        : > Task :patrol:packageDebugRenderscript NO-SOURCE
        : > Task :app:compileDebugRenderscript NO-SOURCE
        : > Task :app:generateDebugBuildConfig UP-TO-DATE
        : > Task :integration_test:writeDebugAarMetadata UP-TO-DATE
        : > Task :patrol:writeDebugAarMetadata UP-TO-DATE
        : > Task :app:checkDebugAarMetadata UP-TO-DATE
        : > Task :app:cleanMergeDebugAssets
        : > Task :app:mergeDebugShaders UP-TO-DATE
        : > Task :app:compileDebugShaders NO-SOURCE
        : > Task :app:generateDebugAssets UP-TO-DATE
        : > Task :integration_test:mergeDebugShaders UP-TO-DATE
        : > Task :integration_test:compileDebugShaders NO-SOURCE
        : > Task :integration_test:generateDebugAssets UP-TO-DATE
        : > Task :integration_test:packageDebugAssets UP-TO-DATE
        : > Task :patrol:mergeDebugShaders UP-TO-DATE
        : > Task :patrol:compileDebugShaders NO-SOURCE
        : > Task :patrol:generateDebugAssets UP-TO-DATE
        : > Task :patrol:packageDebugAssets UP-TO-DATE
        : > Task :app:mergeDebugAssets
        : > Task :app:copyFlutterAssetsDebug
        : > Task :app:generateDebugResValues UP-TO-DATE
        : > Task :integration_test:compileDebugRenderscript NO-SOURCE
        : > Task :integration_test:generateDebugResValues UP-TO-DATE
        : > Task :integration_test:generateDebugResources UP-TO-DATE
        : > Task :integration_test:packageDebugResources UP-TO-DATE
        : > Task :patrol:compileDebugRenderscript NO-SOURCE
        : > Task :patrol:generateDebugResValues UP-TO-DATE
        : > Task :patrol:generateDebugResources UP-TO-DATE
        : > Task :patrol:packageDebugResources UP-TO-DATE
        : > Task :app:mapDebugSourceSetPaths UP-TO-DATE
        : > Task :app:generateDebugResources UP-TO-DATE
        : > Task :app:mergeDebugResources UP-TO-DATE
        : > Task :app:createDebugCompatibleScreenManifests UP-TO-DATE
        : > Task :app:extractDeepLinksDebug UP-TO-DATE
        : > Task :integration_test:extractDeepLinksDebug UP-TO-DATE
        : > Task :integration_test:processDebugManifest UP-TO-DATE
        : > Task :patrol:extractDeepLinksDebug UP-TO-DATE
        : > Task :patrol:processDebugManifest UP-TO-DATE
        : > Task :app:processDebugMainManifest UP-TO-DATE
        : > Task :app:processDebugManifest UP-TO-DATE
        : > Task :app:processDebugManifestForPackage UP-TO-DATE
        : > Task :integration_test:compileDebugLibraryResources UP-TO-DATE
        : > Task :integration_test:parseDebugLocalResources UP-TO-DATE
        : > Task :integration_test:generateDebugRFile UP-TO-DATE
        : > Task :patrol:compileDebugLibraryResources UP-TO-DATE
        : > Task :patrol:parseDebugLocalResources UP-TO-DATE
        : > Task :patrol:generateDebugRFile UP-TO-DATE
        : > Task :app:processDebugResources UP-TO-DATE
        : > Task :integration_test:generateDebugBuildConfig UP-TO-DATE
        : > Task :integration_test:javaPreCompileDebug UP-TO-DATE
        : > Task :integration_test:compileDebugJavaWithJavac UP-TO-DATE
        : > Task :integration_test:bundleLibCompileToJarDebug UP-TO-DATE
        : > Task :patrol:generateDebugBuildConfig UP-TO-DATE
        : > Task :patrol:compileDebugKotlin UP-TO-DATE
        : > Task :patrol:javaPreCompileDebug UP-TO-DATE
        : > Task :patrol:compileDebugJavaWithJavac UP-TO-DATE
        : > Task :patrol:bundleLibCompileToJarDebug UP-TO-DATE
        : > Task :app:compileDebugKotlin UP-TO-DATE
        : > Task :app:javaPreCompileDebug UP-TO-DATE
        : > Task :app:compileDebugJavaWithJavac UP-TO-DATE
        : > Task :app:compressDebugAssets UP-TO-DATE
        : > Task :app:processDebugJavaRes NO-SOURCE
        : > Task :integration_test:processDebugJavaRes NO-SOURCE
        : > Task :integration_test:bundleLibResDebug NO-SOURCE
        : > Task :patrol:processDebugJavaRes NO-SOURCE
        : > Task :patrol:bundleLibResDebug UP-TO-DATE
        : > Task :app:mergeDebugJavaResource UP-TO-DATE
        : > Task :app:checkDebugDuplicateClasses UP-TO-DATE
        : > Task :app:desugarDebugFileDependencies UP-TO-DATE
        : > Task :app:mergeExtDexDebug UP-TO-DATE
        : > Task :patrol:bundleLibRuntimeToJarDebug UP-TO-DATE
        : > Task :integration_test:bundleLibRuntimeToJarDebug UP-TO-DATE
        : > Task :app:dexBuilderDebug UP-TO-DATE
        : > Task :app:mergeLibDexDebug UP-TO-DATE
        : > Task :app:mergeProjectDexDebug UP-TO-DATE
        : > Task :app:mergeDebugJniLibFolders UP-TO-DATE
        : > Task :integration_test:mergeDebugJniLibFolders UP-TO-DATE
        : > Task :integration_test:mergeDebugNativeLibs NO-SOURCE
        : > Task :integration_test:copyDebugJniLibsProjectOnly UP-TO-DATE
        : > Task :patrol:mergeDebugJniLibFolders UP-TO-DATE
        : > Task :patrol:mergeDebugNativeLibs NO-SOURCE
        : > Task :patrol:copyDebugJniLibsProjectOnly UP-TO-DATE
        : > Task :app:mergeDebugNativeLibs UP-TO-DATE
        : > Task :app:stripDebugDebugSymbols UP-TO-DATE
        : > Task :app:validateSigningDebug UP-TO-DATE
        : > Task :app:writeDebugAppMetadata UP-TO-DATE
        : > Task :app:writeDebugSigningConfigVersions UP-TO-DATE
        : > Task :app:packageDebug UP-TO-DATE
        : > Task :app:createDebugApkListingFileRedirect UP-TO-DATE
        : > Task :app:assembleDebug
        : 
        : BUILD SUCCESSFUL in 1s
        : 78 actionable tasks: 4 executed, 74 up-to-date
$ ./gradlew :app:assembleDebugAndroidTest -Ptarget=/Users/haomun/Desktop/Flutter_project/integration_demo/integration_test/test_bundle.dart -Pdart-defines=UEFUUk9MX1dBSVQ9MA==,UEFUUk9MX0FQUF9QQUNLQUdFX05BTUU9Y29tLmV4YW1wbGUuaW50ZWdyYXRpb25fZGVtbw==,UEFUUk9MX0FQUF9CVU5ETEVfSUQ9Y29tLmV4YW1wbGUuaW50ZWdyYXRpb25EZW1v,UEFUUk9MX0FORFJPSURfQVBQX05BTUU9ZGVtbw==,UEFUUk9MX0lPU19BUFBfTkFNRT1kZW1v,SU5URUdSQVRJT05fVEVTVF9TSE9VTERfUkVQT1JUX1JFU1VMVFNfVE9fTkFUSVZFPWZhbHNl,UEFUUk9MX1RFU1RfTEFCRUxfRU5BQkxFRD10cnVl
        : > Task :gradle:extractPluginRequests NO-SOURCE
        : > Task :gradle:generatePluginAdapters UP-TO-DATE
        : > Task :gradle:compileJava NO-SOURCE
        : > Task :gradle:compileGroovy UP-TO-DATE
        : > Task :gradle:compileGroovyPlugins 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:preBuild UP-TO-DATE
        : > Task :app:preDebugBuild UP-TO-DATE
        : > Task :integration_test:preBuild UP-TO-DATE
        : > Task :integration_test:preDebugBuild UP-TO-DATE
        : > Task :integration_test:compileDebugAidl NO-SOURCE
        : > Task :patrol:preBuild UP-TO-DATE
        : > Task :patrol:preDebugBuild UP-TO-DATE
        : > Task :patrol:compileDebugAidl NO-SOURCE
        : > Task :app:compileDebugAidl NO-SOURCE
        : > Task :integration_test:packageDebugRenderscript NO-SOURCE
        : > Task :patrol:packageDebugRenderscript NO-SOURCE
        : > Task :app:compileDebugRenderscript NO-SOURCE
        : > Task :app:generateDebugBuildConfig UP-TO-DATE
        : > Task :integration_test:writeDebugAarMetadata UP-TO-DATE
        : > Task :patrol:writeDebugAarMetadata UP-TO-DATE
        : > Task :app:checkDebugAarMetadata UP-TO-DATE
        : > Task :app:generateDebugResValues UP-TO-DATE
        : > Task :integration_test:compileDebugRenderscript NO-SOURCE
        : > Task :integration_test:generateDebugResValues UP-TO-DATE
        : > Task :integration_test:generateDebugResources UP-TO-DATE
        : > Task :integration_test:packageDebugResources UP-TO-DATE
        : > Task :patrol:compileDebugRenderscript NO-SOURCE
        : > Task :patrol:generateDebugResValues UP-TO-DATE
        : > Task :patrol:generateDebugResources UP-TO-DATE
        : > Task :patrol:packageDebugResources UP-TO-DATE
        : > Task :app:mapDebugSourceSetPaths UP-TO-DATE
        : > Task :app:generateDebugResources UP-TO-DATE
        : > Task :app:mergeDebugResources UP-TO-DATE
        : > Task :app:createDebugCompatibleScreenManifests UP-TO-DATE
        : > Task :app:extractDeepLinksDebug UP-TO-DATE
        : > Task :integration_test:extractDeepLinksDebug UP-TO-DATE
        : > Task :integration_test:processDebugManifest UP-TO-DATE
        : > Task :patrol:extractDeepLinksDebug UP-TO-DATE
        : > Task :patrol:processDebugManifest UP-TO-DATE
        : > Task :app:processDebugMainManifest UP-TO-DATE
        : > Task :app:processDebugManifest UP-TO-DATE
        : > Task :app:processDebugManifestForPackage UP-TO-DATE
        : > Task :integration_test:compileDebugLibraryResources UP-TO-DATE
        : > Task :integration_test:parseDebugLocalResources UP-TO-DATE
        : > Task :integration_test:generateDebugRFile UP-TO-DATE
        : > Task :patrol:compileDebugLibraryResources UP-TO-DATE
        : > Task :patrol:parseDebugLocalResources UP-TO-DATE
        : > Task :patrol:generateDebugRFile UP-TO-DATE
        : > Task :app:processDebugResources UP-TO-DATE
        : > Task :integration_test:generateDebugBuildConfig UP-TO-DATE
        : > Task :integration_test:javaPreCompileDebug UP-TO-DATE
        : > Task :integration_test:compileDebugJavaWithJavac UP-TO-DATE
        : > Task :integration_test:bundleLibCompileToJarDebug UP-TO-DATE
        : > Task :patrol:generateDebugBuildConfig UP-TO-DATE
        : > Task :patrol:compileDebugKotlin UP-TO-DATE
        : > Task :patrol:javaPreCompileDebug UP-TO-DATE
        : > Task :patrol:compileDebugJavaWithJavac UP-TO-DATE
        : > Task :patrol:bundleLibCompileToJarDebug UP-TO-DATE
        : > Task :app:javaPreCompileDebug UP-TO-DATE
        : > Task :app:preDebugAndroidTestBuild SKIPPED
        : > Task :app:compileDebugAndroidTestAidl NO-SOURCE
        : > Task :app:processDebugAndroidTestManifest UP-TO-DATE
        : > Task :app:compileDebugAndroidTestRenderscript NO-SOURCE
        : > Task :app:generateDebugAndroidTestBuildConfig UP-TO-DATE
        : > Task :app:checkDebugAndroidTestAarMetadata UP-TO-DATE
        : > Task :app:generateDebugAndroidTestResValues UP-TO-DATE
        : > Task :app:mapDebugAndroidTestSourceSetPaths UP-TO-DATE
        : > Task :app:generateDebugAndroidTestResources UP-TO-DATE
        : > Task :app:mergeDebugAndroidTestResources UP-TO-DATE
        : > Task :app:processDebugAndroidTestResources UP-TO-DATE
        : > Task :app:javaPreCompileDebugAndroidTest UP-TO-DATE
        : > Task :app:mergeDebugAndroidTestShaders UP-TO-DATE
        : > Task :app:compileDebugAndroidTestShaders NO-SOURCE
        : > Task :app:generateDebugAndroidTestAssets UP-TO-DATE
        : > Task :integration_test:mergeDebugShaders UP-TO-DATE
        : > Task :integration_test:compileDebugShaders NO-SOURCE
        : > Task :integration_test:generateDebugAssets UP-TO-DATE
        : > Task :integration_test:packageDebugAssets UP-TO-DATE
        : > Task :patrol:mergeDebugShaders UP-TO-DATE
        : > Task :patrol:compileDebugShaders NO-SOURCE
        : > Task :patrol:generateDebugAssets UP-TO-DATE
        : > Task :patrol:packageDebugAssets UP-TO-DATE
        : > Task :app:mergeDebugAndroidTestAssets UP-TO-DATE
        : > Task :app:compressDebugAndroidTestAssets UP-TO-DATE
        : > Task :app:processDebugAndroidTestJavaRes NO-SOURCE
        : > Task :integration_test:processDebugJavaRes NO-SOURCE
        : > Task :integration_test:bundleLibResDebug NO-SOURCE
        : > Task :patrol:processDebugJavaRes NO-SOURCE
        : > Task :patrol:bundleLibResDebug UP-TO-DATE
        : > Task :app:mergeDebugAndroidTestJniLibFolders UP-TO-DATE
        : > Task :integration_test:mergeDebugJniLibFolders UP-TO-DATE
        : > Task :integration_test:mergeDebugNativeLibs NO-SOURCE
        : > Task :integration_test:copyDebugJniLibsProjectOnly UP-TO-DATE
        : > Task :patrol:mergeDebugJniLibFolders UP-TO-DATE
        : > Task :patrol:mergeDebugNativeLibs NO-SOURCE
        : > Task :patrol:copyDebugJniLibsProjectOnly UP-TO-DATE
        : > Task :app:mergeDebugAndroidTestNativeLibs NO-SOURCE
        : > Task :app:checkDebugAndroidTestDuplicateClasses UP-TO-DATE
        : > Task :app:desugarDebugAndroidTestFileDependencies UP-TO-DATE
        : > Task :app:mergeExtDexDebugAndroidTest UP-TO-DATE
        : > Task :patrol:bundleLibRuntimeToJarDebug UP-TO-DATE
        : > Task :integration_test:bundleLibRuntimeToJarDebug UP-TO-DATE
        : > Task :app:validateSigningDebugAndroidTest UP-TO-DATE
        : > Task :app:writeDebugAndroidTestSigningConfigVersions UP-TO-DATE
        : > Task :app:compileDebugKotlin
        : > Task :app:compileDebugJavaWithJavac UP-TO-DATE
        : > Task :app:bundleDebugClassesToCompileJar UP-TO-DATE
        : > Task :app:compileDebugAndroidTestKotlin NO-SOURCE
        : > Task :app:compileDebugAndroidTestJavaWithJavac UP-TO-DATE
        : > Task :app:mergeDebugAndroidTestJavaResource UP-TO-DATE
        : > Task :app:mergeLibDexDebugAndroidTest UP-TO-DATE
        : > Task :app:dexBuilderDebugAndroidTest
        : > Task :app:mergeProjectDexDebugAndroidTest UP-TO-DATE
        : > Task :app:packageDebugAndroidTest UP-TO-DATE
        : > Task :app:createDebugAndroidTestApkListingFileRedirect UP-TO-DATE
        : > Task :app:assembleDebugAndroidTest UP-TO-DATE
        : 
        : BUILD SUCCESSFUL in 1s
        : 80 actionable tasks: 2 executed, 78 up-to-date
✓ Completed building apk with entrypoint test_bundle.dart (3.7s)
Will uninstall apps before running tests
Uninstalling com.example.integration_demo from AOSP on IA Emulator
• Executing tests of apk with entrypoint test_bundle.dart on emulator-5554...
$ ./gradlew :app:connectedDebugAndroidTest -Ptarget=/Users/haomun/Desktop/Flutter_project/integration_demo/integration_test/test_bundle.dart -Pdart-defines=UEFUUk9MX1dBSVQ9MA==,UEFUUk9MX0FQUF9QQUNLQUdFX05BTUU9Y29tLmV4YW1wbGUuaW50ZWdyYXRpb25fZGVtbw==,UEFUUk9MX0FQUF9CVU5ETEVfSUQ9Y29tLmV4YW1wbGUuaW50ZWdyYXRpb25EZW1v,UEFUUk9MX0FORFJPSURfQVBQX05BTUU9ZGVtbw==,UEFUUk9MX0lPU19BUFBfTkFNRT1kZW1v,SU5URUdSQVRJT05fVEVTVF9TSE9VTERfUkVQT1JUX1JFU1VMVFNfVE9fTkFUSVZFPWZhbHNl,UEFUUk9MX1RFU1RfTEFCRUxfRU5BQkxFRD10cnVl
        : > Task :gradle:extractPluginRequests NO-SOURCE
        : > Task :gradle:generatePluginAdapters UP-TO-DATE
        : > Task :gradle:compileJava NO-SOURCE
        : > Task :gradle:compileGroovy UP-TO-DATE
        : > Task :gradle:compileGroovyPlugins 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:compileFlutterBuildDebug UP-TO-DATE
        : > Task :app:packLibsflutterBuildDebug UP-TO-DATE
        : > Task :app:preBuild UP-TO-DATE
        : > Task :app:preDebugBuild UP-TO-DATE
        : > Task :integration_test:preBuild UP-TO-DATE
        : > Task :integration_test:preDebugBuild UP-TO-DATE
        : > Task :integration_test:compileDebugAidl NO-SOURCE
        : > Task :patrol:preBuild UP-TO-DATE
        : > Task :patrol:preDebugBuild UP-TO-DATE
        : > Task :patrol:compileDebugAidl NO-SOURCE
        : > Task :app:compileDebugAidl NO-SOURCE
        : > Task :integration_test:packageDebugRenderscript NO-SOURCE
        : > Task :patrol:packageDebugRenderscript NO-SOURCE
        : > Task :app:compileDebugRenderscript NO-SOURCE
        : > Task :app:generateDebugBuildConfig UP-TO-DATE
        : > Task :integration_test:writeDebugAarMetadata UP-TO-DATE
        : > Task :patrol:writeDebugAarMetadata UP-TO-DATE
        : > Task :app:checkDebugAarMetadata UP-TO-DATE
        : > Task :app:cleanMergeDebugAssets
        : > Task :app:mergeDebugShaders UP-TO-DATE
        : > Task :app:compileDebugShaders NO-SOURCE
        : > Task :app:generateDebugAssets UP-TO-DATE
        : > Task :integration_test:mergeDebugShaders UP-TO-DATE
        : > Task :integration_test:compileDebugShaders NO-SOURCE
        : > Task :integration_test:generateDebugAssets UP-TO-DATE
        : > Task :integration_test:packageDebugAssets UP-TO-DATE
        : > Task :patrol:mergeDebugShaders UP-TO-DATE
        : > Task :patrol:compileDebugShaders NO-SOURCE
        : > Task :patrol:generateDebugAssets UP-TO-DATE
        : > Task :patrol:packageDebugAssets UP-TO-DATE
        : > Task :app:mergeDebugAssets
        : > Task :app:copyFlutterAssetsDebug
        : > Task :app:generateDebugResValues UP-TO-DATE
        : > Task :integration_test:compileDebugRenderscript NO-SOURCE
        : > Task :integration_test:generateDebugResValues UP-TO-DATE
        : > Task :integration_test:generateDebugResources UP-TO-DATE
        : > Task :integration_test:packageDebugResources UP-TO-DATE
        : > Task :patrol:compileDebugRenderscript NO-SOURCE
        : > Task :patrol:generateDebugResValues UP-TO-DATE
        : > Task :patrol:generateDebugResources UP-TO-DATE
        : > Task :patrol:packageDebugResources UP-TO-DATE
        : > Task :app:mapDebugSourceSetPaths UP-TO-DATE
        : > Task :app:generateDebugResources UP-TO-DATE
        : > Task :app:mergeDebugResources UP-TO-DATE
        : > Task :app:createDebugCompatibleScreenManifests UP-TO-DATE
        : > Task :app:extractDeepLinksDebug UP-TO-DATE
        : > Task :integration_test:extractDeepLinksDebug UP-TO-DATE
        : > Task :integration_test:processDebugManifest UP-TO-DATE
        : > Task :patrol:extractDeepLinksDebug UP-TO-DATE
        : > Task :patrol:processDebugManifest UP-TO-DATE
        : > Task :app:processDebugMainManifest UP-TO-DATE
        : > Task :app:processDebugManifest UP-TO-DATE
        : > Task :app:processDebugManifestForPackage UP-TO-DATE
        : > Task :integration_test:compileDebugLibraryResources UP-TO-DATE
        : > Task :integration_test:parseDebugLocalResources UP-TO-DATE
        : > Task :integration_test:generateDebugRFile UP-TO-DATE
        : > Task :patrol:compileDebugLibraryResources UP-TO-DATE
        : > Task :patrol:parseDebugLocalResources UP-TO-DATE
        : > Task :patrol:generateDebugRFile UP-TO-DATE
        : > Task :app:processDebugResources UP-TO-DATE
        : > Task :integration_test:generateDebugBuildConfig UP-TO-DATE
        : > Task :integration_test:javaPreCompileDebug UP-TO-DATE
        : > Task :integration_test:compileDebugJavaWithJavac UP-TO-DATE
        : > Task :integration_test:bundleLibCompileToJarDebug UP-TO-DATE
        : > Task :patrol:generateDebugBuildConfig UP-TO-DATE
        : > Task :patrol:compileDebugKotlin UP-TO-DATE
        : > Task :patrol:javaPreCompileDebug UP-TO-DATE
        : > Task :patrol:compileDebugJavaWithJavac UP-TO-DATE
        : > Task :patrol:bundleLibCompileToJarDebug UP-TO-DATE
        : > Task :app:javaPreCompileDebug UP-TO-DATE
        : > Task :app:preDebugAndroidTestBuild SKIPPED
        : > Task :app:compileDebugAndroidTestAidl NO-SOURCE
        : > Task :app:processDebugAndroidTestManifest UP-TO-DATE
        : > Task :app:compileDebugAndroidTestRenderscript NO-SOURCE
        : > Task :app:generateDebugAndroidTestBuildConfig UP-TO-DATE
        : > Task :app:checkDebugAndroidTestAarMetadata UP-TO-DATE
        : > Task :app:generateDebugAndroidTestResValues UP-TO-DATE
        : > Task :app:mapDebugAndroidTestSourceSetPaths UP-TO-DATE
        : > Task :app:generateDebugAndroidTestResources UP-TO-DATE
        : > Task :app:mergeDebugAndroidTestResources UP-TO-DATE
        : > Task :app:processDebugAndroidTestResources UP-TO-DATE
        : > Task :app:javaPreCompileDebugAndroidTest UP-TO-DATE
        : > Task :app:compressDebugAssets UP-TO-DATE
        : > Task :app:processDebugJavaRes NO-SOURCE
        : > Task :integration_test:processDebugJavaRes NO-SOURCE
        : > Task :integration_test:bundleLibResDebug NO-SOURCE
        : > Task :patrol:processDebugJavaRes NO-SOURCE
        : > Task :patrol:bundleLibResDebug UP-TO-DATE
        : > Task :app:checkDebugDuplicateClasses UP-TO-DATE
        : > Task :app:desugarDebugFileDependencies UP-TO-DATE
        : > Task :app:mergeExtDexDebug UP-TO-DATE
        : > Task :patrol:bundleLibRuntimeToJarDebug UP-TO-DATE
        : > Task :integration_test:bundleLibRuntimeToJarDebug UP-TO-DATE
        : > Task :app:mergeDebugJniLibFolders UP-TO-DATE
        : > Task :app:mergeLibDexDebug UP-TO-DATE
        : > Task :integration_test:mergeDebugJniLibFolders UP-TO-DATE
        : > Task :integration_test:mergeDebugNativeLibs NO-SOURCE
        : > Task :integration_test:copyDebugJniLibsProjectOnly UP-TO-DATE
        : > Task :patrol:mergeDebugJniLibFolders UP-TO-DATE
        : > Task :patrol:mergeDebugNativeLibs NO-SOURCE
        : > Task :patrol:copyDebugJniLibsProjectOnly UP-TO-DATE
        : > Task :app:mergeDebugNativeLibs UP-TO-DATE
        : > Task :app:stripDebugDebugSymbols UP-TO-DATE
        : > Task :app:validateSigningDebug UP-TO-DATE
        : > Task :app:writeDebugAppMetadata UP-TO-DATE
        : > Task :app:writeDebugSigningConfigVersions UP-TO-DATE
        : > Task :app:mergeDebugAndroidTestShaders UP-TO-DATE
        : > Task :app:compileDebugAndroidTestShaders NO-SOURCE
        : > Task :app:generateDebugAndroidTestAssets UP-TO-DATE
        : > Task :app:mergeDebugAndroidTestAssets UP-TO-DATE
        : > Task :app:compressDebugAndroidTestAssets UP-TO-DATE
        : > Task :app:processDebugAndroidTestJavaRes NO-SOURCE
        : > Task :app:mergeDebugAndroidTestJniLibFolders UP-TO-DATE
        : > Task :app:mergeDebugAndroidTestNativeLibs NO-SOURCE
        : > Task :app:checkDebugAndroidTestDuplicateClasses UP-TO-DATE
        : > Task :app:desugarDebugAndroidTestFileDependencies UP-TO-DATE
        : > Task :app:mergeExtDexDebugAndroidTest UP-TO-DATE
        : > Task :app:mergeLibDexDebugAndroidTest UP-TO-DATE
        : > Task :app:validateSigningDebugAndroidTest UP-TO-DATE
        : > Task :app:writeDebugAndroidTestSigningConfigVersions UP-TO-DATE
        : > Task :app:compileDebugKotlin
        : > Task :app:compileDebugJavaWithJavac UP-TO-DATE
        : > Task :app:bundleDebugClassesToCompileJar UP-TO-DATE
        : > Task :app:compileDebugAndroidTestKotlin NO-SOURCE
        : > Task :app:compileDebugAndroidTestJavaWithJavac UP-TO-DATE
        : > Task :app:mergeDebugJavaResource UP-TO-DATE
        : > Task :app:dexBuilderDebug UP-TO-DATE
        : > Task :app:mergeProjectDexDebug UP-TO-DATE
        : > Task :app:packageDebug UP-TO-DATE
        : > Task :app:createDebugApkListingFileRedirect UP-TO-DATE
        : > Task :app:mergeDebugAndroidTestJavaResource UP-TO-DATE
        : > Task :app:dexBuilderDebugAndroidTest
        : > Task :app:mergeProjectDexDebugAndroidTest UP-TO-DATE
        : > Task :app:packageDebugAndroidTest UP-TO-DATE
        : > Task :app:createDebugAndroidTestApkListingFileRedirect UP-TO-DATE
        : 
        : > Task :app:connectedDebugAndroidTest
        : Starting 1 tests on Integration_Samsung_Galaxy_S8_1080x2220_API_28(AVD) - 9
        : 
        : BUILD SUCCESSFUL in 21s
        : 103 actionable tasks: 6 executed, 97 up-to-date
✓ Completed executing apk with entrypoint test_bundle.dart on emulator-5554 (22.0s)
Uninstalling com.example.integration_demo from AOSP on IA Emulator
Uninstalling com.example.integration_demo.test from AOSP on IA Emulator

Patrol version

patrol ^2.3.1

Patrol Doctor output

Patrol Doctor output
Patrol CLI version: 2.2.1
Program adb found in /Users/haomun//Library/Android/sdk/platform-tools/adb
Env var $ANDROID_HOME is not set
Program xcodebuild found in /usr/bin/xcodebuild
Program ideviceinstaller found in /usr/local/bin/ideviceinstaller

Flutter Doctor output

Flutter Doctor output
[✓] Flutter (Channel stable, 3.13.8, on macOS 14.0 23A344 darwin-x64, locale en-MY)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.3)
[✓] IntelliJ IDEA Community Edition (version 2022.3)
[✓] VS Code (version 1.83.1)
[✓] Connected device (3 available)
[✓] Network resources

• No issues found!
@bartekpacia
Copy link
Contributor

Hi, Patrol doesn't work with setUpAll (and setUp and tearDown and tearDownAll) from package:flutter_test/package:test. That's because of how our native test bundling feature is implemented. For more details, see #1341.

Fortunately we have these features implemented on our unstable develop branch, which is also on pub.dev.

@bartekpacia
Copy link
Contributor

closing as duplicate of #1341

@bartekpacia bartekpacia closed this as not planned Won't fix, can't repro, duplicate, stale Nov 14, 2023
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar problem, please file a new issue. Make sure to follow the template and provide all the information necessary to reproduce the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants