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

Patrol test crash on my test (There are no test bundles available to test) #1167

Closed
1 task done
AlexisDeslandes opened this issue Apr 2, 2023 · 8 comments
Closed
1 task done

Comments

@AlexisDeslandes
Copy link

AlexisDeslandes commented Apr 2, 2023

Is there an existing issue for this?

Steps to reproduce

Just did the setup: https://patrol.leancode.co/native/setup
But can't make it work.
Some parts of the config were confusing, so it can be a personal mistake.

Actual results

I have an error message speaking about test bundles missing!

Capture d’écran 2023-04-02 à 16 44 27

Logs

Logs

Verbose mode enabled. More logs will be printed.
Received 1 test target(s)
Received test target: /Users/adeslandes/work/enterprise/integration_test/authentication_test.dart
Received Android flavor: qa
Received iOS flavor: qa
$ flutter --no-version-check devices --machine
No device specified, using the first one (iPhone 14 Pro)
Received 1 device(s) to run on
Received device: iPhone 14 Pro
Every test target will be run 1 time(s)
Received 1 --dart-define(s) (0 custom, 1 internal)
Received internal --dart-define: PATROL_WAIT=0
• Building app with entrypoint authentication_test.dart for iOS simulator (debug)...
$ flutter build ios --no-version-check --config-only --no-codesign --debug --simulator --flavor qa --target /Users/adeslandes/work/enterprise/integration_test/authentication_test.dart --dart-define PATROL_WAIT=0 --dart-define PATROL_TEST_LABEL=authentication_test.dart
        Building enterprise-ppm.qa for simulator (ios)...
$ xcodebuild build-for-testing -workspace Runner.xcworkspace -scheme qa -configuration Debug-qa -sdk iphonesimulator -destination generic/platform=iOS Simulator -quiet -derivedDataPath ../build/ios_integ OTHER_SWIFT_FLAGS=$(inherited) -D PATROL_ENABLED
        /Users/adeslandes/work/enterprise/ios/Runner/AppDelegate.swift:14:58: warning: conditional cast from 'AppDelegate' to 'any UNUserNotificationCenterDelegate' always succeeds
              UNUserNotificationCenter.current().delegate = self as? UNUserNotificationCenterDelegate
                                                                 ^
        warning: The CFBundleVersion of an app extension ('1') must match that of its containing parent app ('58').
        note: Building targets in dependency order
        note: Run script build phase 'Run Script' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'Runner' from project 'Runner')
        warning: Run script build phase 'Copy GoogleService-Info.plist to the correct location' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Runner' from project 'Runner')
        note: Run script build phase 'Thin Binary' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'Runner' from project 'Runner')
        warning: Run script build phase 'xcode_backend build' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'RunnerUITests' from project 'Runner')
        warning: Run script build phase 'xcode_backend embed_and_thin' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'RunnerUITests' from project 'Runner')
✓ Completed building app with entrypoint authentication_test.dart for iOS simulator (48.7s)
• Running app with entrypoint authentication_test.dart for iOS simulator on simulator iPhone 14 Pro...
$ xcodebuild -showsdks -json
Assuming SDK version 16.2 for iphonesimulator
Looking for .xctestrun matching qa_iphonesimulator16.2*.xctestrun at /Users/adeslandes/work/enterprise/build/ios_integ/Build/Products
Found 2 match(es), the first one will be used
Found /Users/adeslandes/work/enterprise/build/ios_integ/Build/Products/qa_iphonesimulator16.2.xctestrun
Found /Users/adeslandes/work/enterprise/build/ios_integ/Build/Products/qa_iphonesimulator16.2-x86_64.xctestrun
$ xcodebuild test-without-building -xctestrun /Users/adeslandes/work/enterprise/build/ios_integ/Build/Products/qa_iphonesimulator16.2.xctestrun -destination platform=iOS Simulator,name=iPhone 14 Pro
        Command line invocation:
            /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild test-without-building -xctestrun /Users/adeslandes/work/enterprise/build/ios_integ/Build/Products/qa_iphonesimulator16.2.xctestrun -destination "platform=iOS Simulator,name=iPhone 14 Pro"
        User defaults from command line:
            IDEPackageSupportUseBuiltinSCM = YES
        2023-04-02 16:39:06.773 xcodebuild[35145:2924496] Writing error result bundle to /var/folders/11/fskxr91x1fd6fs2ztsp0dtj40032xp/T/ResultBundle_2023-02-04_16-39-0006.xcresult
        xcodebuild: error: Failed to build workspace Runner with scheme qa.
                Reason: There are no test bundles available to test.
                Recovery suggestion: Ensure that all package dependencies have resolved and that there are no missing test bundles in the active scheme or test plan.
✗ Failed to execute tests of app with entrypoint authentication_test.dart for iOS simulator on simulator iPhone 14 Pro (xcodebuild exited with code 70) (1.9s)
Error: xcodebuild exited with code 70
#0      throwToolExit (package:patrol_cli/src/base/exceptions.dart:7:3)
#1      IOSTestBackend.execute.<anonymous closure> (package:patrol_cli/src/ios/ios_test_backend.dart:182:9)
<asynchronous suspension>
#2      DisposeScope.run (package:dispose_scope/src/dispose_scope.dart:44:7)
<asynchronous suspension>
#3      IOSTestBackend.execute (package:patrol_cli/src/ios/ios_test_backend.dart:139:5)
<asynchronous suspension>
#4      TestCommand._executorFor.<anonymous closure> (package:patrol_cli/src/commands/test.dart:279:9)
<asynchronous suspension>
#5      _NativeTestRunner.run.runTestsOnDevice (package:patrol_cli/src/test_runner.dart:243:15)
<asynchronous suspension>
#6      Future.wait.<anonymous closure> (dart:async/future.dart:522:21)
<asynchronous suspension>
#7      _NativeTestRunner.run (package:patrol_cli/src/test_runner.dart:258:5)
<asynchronous suspension>
#8      TestCommand.run (package:patrol_cli/src/commands/test.dart:188:21)
<asynchronous suspension>
#9      CommandRunner.runCommand (package:args/command_runner.dart:212:13)
<asynchronous suspension>
#10     PatrolCommandRunner.runCommand (package:patrol_cli/src/runner/patrol_command_runner.dart:308:18)
<asynchronous suspension>
#11     PatrolCommandRunner.run (package:patrol_cli/src/runner/patrol_command_runner.dart:253:18)
<asynchronous suspension>
#12     patrolCommandRunner (package:patrol_cli/src/runner/patrol_command_runner.dart:63:20)
<asynchronous suspension>
#13     main (file:///Users/adeslandes/work/patrol/packages/patrol_cli/bin/main.dart:6:20)
<asynchronous suspension>

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.
 FAIL  authentication_test.dart on iPhone 14 Pro

Patrol version

patrol: ^1.0.8
patrol_cli: 1.1.3 (git)

Patrol Doctor output

Patrol Doctor output

Patrol CLI version: 1.1.3
Program adb found in /opt/homebrew/bin/adb
Env var $ANDROID_HOME set to ~/Library/Android/sdk
Program xcodebuild found in /usr/bin/xcodebuild
Program ideviceinstaller found in /opt/homebrew/bin/ideviceinstaller
Program ios-deploy found in /opt/homebrew/bin/ios-deploy

Flutter Doctor output

Flutter Doctor output
[✓] Flutter (Channel stable, 3.7.8, on macOS 13.0.1 22A400 darwin-arm64, locale fr-FR)
    • Flutter version 3.7.8 on channel stable at /Users/adeslandes/work/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 90c64ed42b (12 days ago), 2023-03-21 11:27:08 -0500
    • Engine revision 9aa7816315
    • Dart version 2.19.5
    • DevTools version 2.20.1

[✗] Android toolchain - develop for Android devices
    • Android SDK at /opt/homebrew/Caskroom/android-platform-tools/34.0.1
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.

[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14C18
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.3)
    • 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 11.0.13+0-b1751.21-8125866)

[✓] Connected device (3 available)
    • iPhone 14 Pro (mobile) • 444254AC-69E6-4096-84D5-E224A59DDE60 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-16-2 (simulator)
    • macOS (desktop)        • macos                                • darwin-arm64   • macOS 13.0.1 22A400 darwin-arm64
    • Chrome (web)           • chrome                               • web-javascript • Google Chrome 109.0.5414.87

[✓] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 1 category.

@bartekpacia
Copy link
Contributor

Please share your repo so I can clone and investigate.

@redDwarf03
Copy link

redDwarf03 commented Apr 14, 2023

Hello. i have the same issue with my open source project : https://github.com/archethic-foundation/archethic-wallet

Readme : https://github.com/archethic-foundation/archethic-wallet/tree/dev/integration_test
Branch: Dev

@AlexisDeslandes
Copy link
Author

Perfect because mine is not open-sourced.

@andyshephard
Copy link

Has there been any further progress on this? I have two schemes (Dev & Production). Dev actually works just fine, however Production scheme gives me the same error. I've checked the scheme configurations and it seems that the test bundle is linked correctly. I've also adjusted the bundle identifiers so that the suffix is .RunnerUITests on both (along with their respective flavor bundle ids) but still not having any luck.

@bartekpacia
Copy link
Contributor

bartekpacia commented May 9, 2023

Hi, no progress, unfortunately. When we release the new "10x feature", then we'll make a few stabilization sprints to fix bugs like this. Right now we don't have the resources.

@andyshephard
Copy link

I managed to get it working on my own project by duplicating my Dev scheme and repurpose it for Production, removing the other scheme. I would suggest to others however if you're having the issue, check your scheme to ensure that the test target is linked correctly.

Screenshot 2023-05-10 at 19 23 37 Screenshot 2023-05-10 at 19 23 46

I did also run into issues re: flavors where my configuration names weren't written as kebab-case (I changed DebugDev to Debug-Dev and it worked):

Screenshot 2023-05-10 at 19 29 22

@AlexisDeslandes
Copy link
Author

No more this issue, I close.

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 17, 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

4 participants