Open
Description
Right now there is a rather weird pattern where FakeConfig implements Config
, and has to redeclare everything:
class FakeConfig implements Config {
FakeConfig({
this.githubClient,
this.deviceLabServiceAccountValue,
this.maxTaskRetriesValue,
this.maxLuciTaskRetriesValue,
this.maxFilesChangedForSkippingEnginePhaseValue,
this.keyHelperValue,
this.oauthClientIdValue,
this.githubOAuthTokenValue,
this.mergeConflictPullRequestMessageValue = 'default mergeConflictPullRequestMessageValue',
this.missingTestsPullRequestMessageValue = 'default missingTestsPullRequestMessageValue',
this.wrongBaseBranchPullRequestMessageValue,
this.wrongHeadBranchPullRequestMessageValue,
this.releaseBranchPullRequestMessageValue,
this.webhookKeyValue,
this.loggingServiceValue,
this.tabledataResource,
this.githubService,
this.bigqueryService,
this.firestoreService,
this.githubGraphQLClient,
this.rollerAccountsValue,
this.flutterBuildValue,
this.flutterBuildDescriptionValue,
this.maxRecordsValue,
this.flutterGoldPendingValue,
this.flutterGoldSuccessValue,
this.flutterGoldChangesValue,
this.flutterGoldAlertConstantValue,
this.flutterGoldInitialAlertValue,
this.flutterGoldFollowUpAlertValue,
this.flutterGoldDraftChangeValue,
this.flutterGoldStalePRValue,
this.postsubmitSupportedReposValue,
this.supportedBranchesValue,
this.supportedReposValue,
this.batchSizeValue,
this.backfillerTargetLimitValue,
this.backfillerCommitLimitValue,
this.issueAndPRLimitValue,
this.githubRequestDelayValue,
This makes augmenting this class cumbersome, because adding a new value means every FakeConfig
becomes invalid unless it also passes in a default value, or you change every test. Ideally FakeConfig extends Config
, and allows providing (overriding) certain values from the otherwise defaults.