Skip to content

[cocoon] Migrate flaky issue bot to null safety #90139

@CaseyHillers

Description

@CaseyHillers

Related to flutter/cocoon#1246

For various reasons, these tests directly call postJSON which is a generic function. This requires a fallback generator to support (which was done for github webhooks). However, the code here is calling it in a way that does generate the same function signature with what flaky tests is expecting.

Check flaky Can file issue and pr for framework host-only test [E]                                                                                                                        
  MissingStubError: 'postJSON'
  No stub was found which matches the arguments of this method call:
  postJSON('/repos/flutter/flutter/pulls/123/requested_reviewers', {statusCode: null, fail: null, headers: null, params: null, convert: Closure: (Map<String, dynamic>) => PullRequest, body: {"reviewers":["HansMuller"]}, preview: null})
  
  Add a stub for this method using Mockito's 'when' API, or generate the mock for MockGitHub with 'returnNullOnMissingStub: true'.
  package:mockito/src/mock.dart 190:7                                              Mock._noSuchMethod
  package:mockito/src/mock.dart 184:45                                             Mock.noSuchMethod
  test/src/utilities/mocks.mocks.dart 2272:14                                      MockGitHub.postJSON
  package:cocoon_service/src/service/github_service.dart 139:18                    GithubService.assignReviewer
  package:cocoon_service/src/request_handlers/file_flaky_issue_and_pr.dart 115:18  FileFlakyIssueAndPR._fileIssueAndPR
  ===== asynchronous gap ===========================
  package:cocoon_service/src/request_handlers/file_flaky_issue_and_pr.dart 49:7    FileFlakyIssueAndPR.get
  ===== asynchronous gap ===========================
  test/request_handlers/file_flaky_issue_and_pr_test.dart 232:18                   main.<fn>.<fn>

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work listteam-infraOwned by Infrastructure team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions