Skip to content

Add iOS simulator log parse test - #55808

Merged
jmagman merged 2 commits into
flutter:masterfrom
jmagman:xcode-8-logs
Apr 29, 2020
Merged

jmagman merged 2 commits into
flutter:masterfrom
jmagman:xcode-8-logs

Conversation

@jmagman

@jmagman jmagman commented Apr 28, 2020 •

Copy link
Copy Markdown
Member

Description

Add a test to parse a log line style tested in g3. I think this corresponds to Xcode 8 (shipped iOS 10) syslog style, but I'm not really sure.

Related Issues

This looks random, but it's the exact log line in g3 that failed to parse when #46838 landed, and caused it to break the roll and be reverted. Add the test now to prove I don't break it again when I merge #55799.

Tests

simulators_test

Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I signed the [CLA].
  • I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

  • No, no existing tests failed, so this is not a breaking change.
  • Yes, this is a breaking change. If not, delete the remainder of this section.

@jmagman jmagman added platform-ios iOS applications specifically tool Affects the "flutter" command-line tool. See also t: labels. t: xcode "xcodebuild" on iOS and general Xcode project management labels Apr 28, 2020
@jmagman
jmagman requested a review from jonahwilliams April 28, 2020 02:09
@jmagman jmagman self-assigned this Apr 28, 2020
@jmagman

jmagman commented Apr 28, 2020

Copy link
Copy Markdown
Member Author

I can't even find the test now since I get a wall of unrelated errors when I FRoB #55799

when(mockProcess.stderr)
.thenAnswer((Invocation invocation) => const Stream<List<int>>.empty());
// Delay return of exitCode until after stdout stream data, since it terminates the logger.
when(mockProcess.exitCode)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Instead of setting up a potential future timing issue, you could structure the test so that you can hold the exit until you have verified the log output:

var completer = Completer<int>();
when(mockProcess.exitCode).thenAnswer((_) {
  return completer.future;
});
...
final DeviceLogReader logReader = device.getLogReader(
  app: await BuildableIOSApp.fromProject(mockIosProject),
 );

await expectLater(logReader.logLines, emitsThrough(...));
completer.complete(0); // not sure if its actually necessary to exit, cloud dispose instead?

@jmagman

jmagman commented Apr 28, 2020

Copy link
Copy Markdown
Member Author

Swapped to FakeProcessManager in logging tests.

@jonahwilliams jonahwilliams left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM very nice!

@jmagman
jmagman merged commit 46a5c55 into flutter:master Apr 29, 2020
@jmagman
jmagman deleted the xcode-8-logs branch April 29, 2020 20:02
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jul 31, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

platform-ios iOS applications specifically t: xcode "xcodebuild" on iOS and general Xcode project management tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants