这是indexloc提供的服务,不要输入任何密码
Skip to content

[flutter_conductor] Add candidates sub command #81234

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

Merged

Conversation

christopherfujino
Copy link
Contributor

@christopherfujino christopherfujino commented Apr 26, 2021

Add a new sub-command to the conductor: conductor candidates that lists all release candidate branches newer than the current version. Used in determining dev release candidates.

Usage:

~/git/flutter $ ./dev/tools/bin/conductor candidates
currentVersion = 2.3.0-1.0.pre.217
flutter-2.3-candidate.1
flutter-2.3-candidate.2
flutter-2.3-candidate.3
flutter-2.3-candidate.4

@flutter-dashboard flutter-dashboard bot added the c: contributor-productivity Team-specific productivity, code health, technical debt. label Apr 26, 2021
@google-cla google-cla bot added the cla: yes label Apr 26, 2021
const String remoteName = 'origin';

late MemoryFileSystem fileSystem;
FakePlatform? platform;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why the mix of late and nullable?

Copy link
Contributor Author

@christopherfujino christopherfujino Apr 28, 2021

Choose a reason for hiding this comment

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

platform and processManager are nullable because I set them in createRunner. I set them in createRunner since they depend on variables that can change between tests. I then explicitly null it out in the tearDown (a similar test had a bug where test assets were re-used between tests, so I started explicitly nulling out fields after tests that were not guaranteed to be initialized in setUp()).

Copy link
Contributor

Choose a reason for hiding this comment

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

I've had a lot of problems with using setup helpers that close over part of the test declarations themselves, it gets very hard to track the active state. I would suggest some modifications:

move createRunner to be a top level, so that you need to explicitly pass it all values its using. You could also return some sort of test context object which has fields initialized to what you want them to be. That should let you remove the teardown logic and nullables.

I do not think you should be defensively programming around test configuration problems by nulling things out

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that makes sense to me.

Copy link
Contributor Author

@christopherfujino christopherfujino May 3, 2021

Choose a reason for hiding this comment

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

removed all side effects from createRunner(), and instead initialized processManager and platform directly in the test, PTAL

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!

@christopherfujino christopherfujino marked this pull request as ready for review May 3, 2021 21:59
@fluttergithubbot fluttergithubbot merged commit 7b3ce8c into flutter:master May 3, 2021
@christopherfujino christopherfujino deleted the add-candidates-sub-command branch May 5, 2021 23:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: contributor-productivity Team-specific productivity, code health, technical debt.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants