-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[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
[flutter_conductor] Add candidates sub command #81234
Conversation
dev/tools/test/candidates_test.dart
Outdated
const String remoteName = 'origin'; | ||
|
||
late MemoryFileSystem fileSystem; | ||
FakePlatform? platform; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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()
).
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
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: