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

Test bundling doesn't work on physical iOS devices #1297

Closed
bartekpacia opened this issue May 20, 2023 · 5 comments
Closed

Test bundling doesn't work on physical iOS devices #1297

bartekpacia opened this issue May 20, 2023 · 5 comments
Labels
bug Something isn't working package: patrol Related to the patrol package (native automation, test bundling)

Comments

@bartekpacia
Copy link
Contributor

bartekpacia commented May 20, 2023

Since iOS 14, Flutter apps built in debug/profile mode must be run through a debugger.

Before test bundling, we've been accomplishing this by doing just this – starting the app under test in debug mode (with the lldb debugger attached using ios-deploy).

This approach breaks with test bundling because we're running every Dart test in a separate app process – which doesn't work, because there's no debugger attached.

In other words, this is prohibited:

[[[XCUIApplication alloc] init] launch];

We depend on the above heavily.

The only workaround I see around this is to build the app in release mode.

See also:

@bartekpacia bartekpacia added bug Something isn't working package: patrol Related to the patrol package (native automation, test bundling) a: native automation labels May 20, 2023
@bartekpacia
Copy link
Contributor Author

bartekpacia commented May 21, 2023

Trying to run tests in release-built app, but failing to do so. The error (visible in go-ios logs and in Console.app) is:

Failed to create a bundle instance representing '/private/var/containers/Bundle/Application/9A9D727D-E401-46F4-98BB-B4B7888615D9/RunnerUITests-Runner.app.ipa.app/PlugIns/build/ios_integ/Build/Products/Runner_iphoneos16.4-arm64.xctestrun'. Check that the bundle exists on disk.

Possible cause: RunnerTests is present in the .xctestrun, but we want only RunnerUITests nope, most likely not this (still getting the same error after deleting the RunnerTests target)

@bartekpacia
Copy link
Contributor Author

More notes about the error above: the test runner process dies before testInvocations is called. Verified by:

  +(NSArray<NSInvocation *> *)testInvocations {                                                                 
    NSLog(@"testInvocations called");
    // ...
  }

That line is not visible in the logs.

@bartekpacia
Copy link
Contributor Author

This issue is about a feature that isn't yet released to the stable channel.

If you're experiencing problems with the stable version, please report a new bug.

@bartekpacia
Copy link
Contributor Author

bartekpacia commented May 25, 2023

This was fixed by #1303. Caveats apply

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
bug Something isn't working package: patrol Related to the patrol package (native automation, test bundling)
Projects
None yet
Development

No branches or pull requests

1 participant