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

Swap xcodeproj_tests from MockProcessManager to FakeProcessManager #56505

Merged
merged 2 commits into from
May 7, 2020

Conversation

jmagman
Copy link
Member

@jmagman jmagman commented May 7, 2020

Description

Change most of the xcodeproj_tests from MockProcessManager to FakeProcessManager. I had to keep MockProcessManager for the one test that needed to throw on run to work around #56415, and another that was using the flakyProcessFactory.

Related Issues

I started working on #56489 and none of the tests in this file that should have been failing were doing so. Used the FakeProcessManager to spot the calls that weren't being verified with the right parameters.

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 team Infra upgrades, team productivity, code health, technical debt. See also team: labels. tool Affects the "flutter" command-line tool. See also t: labels. labels May 7, 2020
@jmagman jmagman requested a review from jonahwilliams May 7, 2020 02:28
@jmagman jmagman self-assigned this May 7, 2020
command: <String>[
xcodebuild,
'-project',
fileSystem.path.separator,
Copy link
Member Author

Choose a reason for hiding this comment

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

This was the test that should have failed but didn't.

platform.pathSeparator is null, fileSystem.path.separator is / but this processManager runSync was never being verified.

Copy link
Member

@jonahwilliams jonahwilliams left a comment

Choose a reason for hiding this comment

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

LGTM with nits

This is a great cleanup!

flakes: 1,
delay: delay + const Duration(seconds: 1),
);
platform.environment = Map<String, String>.unmodifiable(<String, String>{});
Copy link
Member

Choose a reason for hiding this comment

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

const <String, String>{} will also create an unmodifiable map

'-project',
'/',
'-target',
'',
Copy link
Member

Choose a reason for hiding this comment

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

This line is odd ... is this a stray empty string or are we default to '' for some unset value?

Copy link
Member Author

Choose a reason for hiding this comment

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

The second parameter in await xcodeProjectInterpreter.getBuildSettings('', '') is the target, and it's just trusting that input as the target name. I can make it Runner or something more obvious.

@jmagman jmagman merged commit 4be7919 into flutter:master May 7, 2020
@jmagman jmagman deleted the xcodeproj-test-fake-pm branch May 7, 2020 22:18
@jmagman jmagman added the platform-ios iOS applications specifically label Aug 21, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
platform-ios iOS applications specifically team Infra upgrades, team productivity, code health, technical debt. See also team: labels. 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