Skip to content

New flag to flutter drive to skip installing fresh app on device#30818

Merged
christopherfujino merged 12 commits intoflutter:masterfrom
chris-forks:add-no-build-to-drive
Apr 15, 2019
Merged

New flag to flutter drive to skip installing fresh app on device#30818
christopherfujino merged 12 commits intoflutter:masterfrom
chris-forks:add-no-build-to-drive

Conversation

@christopherfujino
Copy link
Contributor

@christopherfujino christopherfujino commented Apr 9, 2019

Description

In response to the issue below, I added a --build/--no-build flag to the flutter drive command (it defaults to the former, the previous behavior). This is for situations where the app is already on the device and its desired to run the drive test using the existing app, either for speed or to preserve some state from a prior run (see issue).

Related Issues

flutter_driver does not support running a test on a pre-installed app #28662

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • 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 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.

@goderbauer goderbauer added the tool Affects the "flutter" command-line tool. See also t: labels. label Apr 9, 2019
@christopherfujino christopherfujino changed the title add a --build/--no-build flag to flutter drive command (WIP) add a --build/--no-build flag to flutter drive command Apr 11, 2019
@christopherfujino christopherfujino marked this pull request as ready for review April 12, 2019 17:58
@christopherfujino christopherfujino changed the title add a --build/--no-build flag to flutter drive command New flag to flutter drive to skip installing fresh app on device Apr 12, 2019

Device _device;
Device get device => _device;
bool get shouldBuild => argResults['build'] ?? true;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
bool get shouldBuild => argResults['build'] ?? true;
bool get shouldBuild => argResults['build'];

observatoryPort: command.observatoryPort,
),
platformArgs: platformArgs,
prebuiltApplication: !command.shouldBuild,
Copy link
Contributor

Choose a reason for hiding this comment

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

Rather than negate this here I would expose the negative in the getter as shouldSkipBuild

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess you use it the other way too...NBD then

when(mockDevice.getLogReader()).thenReturn(mockDeviceLogReader);
final MockLaunchResult mockLaunchResult = MockLaunchResult();
when(mockLaunchResult.started).thenReturn(true);
when(mockDevice.startApp(
Copy link
Contributor

Choose a reason for hiding this comment

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

I would indent these twice

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cool, yeah, I don't like this look anyway :)

Copy link
Contributor

@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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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.

5 participants