@@ -653,7 +653,7 @@ targets:
653653 final Commit commit = shaToCommit ('1' );
654654 db.values[commit.key] = commit;
655655
656- final PullRequest alreadyLandedPr = generatePullRequest (headSha : '1' );
656+ final PullRequest alreadyLandedPr = generatePullRequest (sha : '1' );
657657 await scheduler.addPullRequest (alreadyLandedPr);
658658
659659 expect (db.values.values.whereType <Commit >().map <String >(toSha).length, 1 );
@@ -1238,13 +1238,8 @@ targets:
12381238 throw Exception ('Failed to find ${request .url .path }' );
12391239 });
12401240 final luci = MockLuciBuildService ();
1241- when (
1242- luci.scheduleTryBuilds (
1243- targets: anyNamed ('targets' ),
1244- pullRequest: anyNamed ('pullRequest' ),
1245- flutterPrebuiltEngineVersion: anyNamed ('flutterPrebuiltEngineVersion' ),
1246- ),
1247- ).thenAnswer ((inv) async {
1241+ when (luci.scheduleTryBuilds (targets: anyNamed ('targets' ), pullRequest: anyNamed ('pullRequest' )))
1242+ .thenAnswer ((inv) async {
12481243 return [];
12491244 });
12501245
@@ -1338,7 +1333,6 @@ targets:
13381333 luci.scheduleTryBuilds (
13391334 targets: captureAnyNamed ('targets' ),
13401335 pullRequest: captureAnyNamed ('pullRequest' ),
1341- flutterPrebuiltEngineVersion: anyNamed ('flutterPrebuiltEngineVersion' ),
13421336 ),
13431337 );
13441338 expect (result.callCount, 1 );
@@ -1520,106 +1514,6 @@ targets:
15201514 expect (captured.first.summary, 'A critical error occurred, preventing further CI testing.' );
15211515 });
15221516
1523- // Regression test for https://github.com/flutter/flutter/issues/164031.
1524- test ('uses the built-from-source engine artifacts' , () async {
1525- final githubService = config.githubService = MockGithubService ();
1526- final githubClient = MockGitHub ();
1527- final luci = MockLuciBuildService ();
1528- final gitHubChecksService = MockGithubChecksService ();
1529-
1530- when (githubService.github).thenReturn (githubClient);
1531- when (gitHubChecksService.githubChecksUtil).thenReturn (mockGithubChecksUtil);
1532-
1533- scheduler = Scheduler (
1534- cache: cache,
1535- config: config,
1536- datastoreProvider: (DatastoreDB db) => DatastoreService (db, 2 ),
1537- buildStatusProvider: (_, __) => buildStatusService,
1538- getFilesChanged: getFilesChanged,
1539- githubChecksService: gitHubChecksService,
1540- httpClientProvider: () => httpClient,
1541- luciBuildService: luci,
1542- fusionTester: fakeFusion,
1543- markCheckRunConclusion: callbacks.markCheckRunConclusion,
1544- );
1545-
1546- when (gitHubChecksService.findMatchingPullRequest (any, any, any)).thenAnswer ((inv) async {
1547- return pullRequest;
1548- });
1549-
1550- final checkRuns = < CheckRun > [];
1551- when (
1552- mockGithubChecksUtil.createCheckRun (
1553- any,
1554- any,
1555- any,
1556- any,
1557- output: anyNamed ('output' ),
1558- conclusion: anyNamed ('conclusion' ),
1559- ),
1560- ).thenAnswer ((inv) async {
1561- final slug = inv.positionalArguments[1 ] as RepositorySlug ;
1562- final sha = inv.positionalArguments[2 ];
1563- final name = inv.positionalArguments[3 ];
1564- checkRuns.add (createCheckRun (id: 1 , owner: slug.owner, repo: slug.name, sha: sha, name: name));
1565- return checkRuns.last;
1566- });
1567-
1568- when (mockFirestoreService.documentResource ()).thenAnswer ((_) async {
1569- final resource = MockProjectsDatabasesDocumentsResource ();
1570- when (
1571- resource.createDocument (
1572- any,
1573- any,
1574- any,
1575- documentId: argThat (anything, named: 'documentId' ),
1576- mask_fieldPaths: argThat (anything, named: 'mask_fieldPaths' ),
1577- $fields: argThat (anything, named: r'$fields' ),
1578- ),
1579- ).thenAnswer ((_) async {
1580- return Document ();
1581- });
1582- return resource;
1583- });
1584-
1585- String ? flutterPrebuiltEngineVersion;
1586- when (
1587- luci.scheduleTryBuilds (
1588- targets: anyNamed ('targets' ),
1589- pullRequest: anyNamed ('pullRequest' ),
1590- flutterPrebuiltEngineVersion: anyNamed ('flutterPrebuiltEngineVersion' ),
1591- ),
1592- ).thenAnswer ((Invocation i) async {
1593- flutterPrebuiltEngineVersion = i.namedArguments[#flutterPrebuiltEngineVersion] as String ? ;
1594- return [];
1595- });
1596-
1597- final checkRunEvent = cocoon_checks.CheckRunEvent .fromJson (
1598- jsonDecode (checkRunString) as Map <String , dynamic >,
1599- );
1600-
1601- await scheduler.proceedToCiTestingStage (
1602- checkRun: checkRunEvent.checkRun! ,
1603- slug: RepositorySlug ('flutter' , 'flutter' ),
1604- sha: 'abc1234' ,
1605- mergeQueueGuard: checkRunFor (name: 'merge queue guard' ),
1606- logCrumb: 'test' ,
1607- );
1608-
1609- // Ensure that we used the HEAD SHA as as FLUTTER_PREBUILT_ENGINE_VERSION,
1610- // since the engine was built from source.
1611- //
1612- // See https://github.com/flutter/flutter/issues/164031.
1613- expect (
1614- flutterPrebuiltEngineVersion,
1615- allOf ([
1616- isNotNull,
1617- pullRequest.head! .sha,
1618- ]),
1619- reason: 'Should be set to HEAD (i.e. the current SHA), since the engine was built from source.' ,
1620- );
1621- });
1622-
16231517 test ('does not fail the merge queue guard when a test check run fails' , () async {
16241518 final githubService = config.githubService = MockGithubService ();
16251519 final githubClient = MockGitHub ();
@@ -1748,13 +1642,8 @@ targets:
17481642 throw Exception ('Failed to find ${request .url .path }' );
17491643 });
17501644 final luci = MockLuciBuildService ();
1751- when (
1752- luci.scheduleTryBuilds (
1753- targets: anyNamed ('targets' ),
1754- pullRequest: anyNamed ('pullRequest' ),
1755- flutterPrebuiltEngineVersion: anyNamed ('flutterPrebuiltEngineVersion' ),
1756- ),
1757- ).thenAnswer ((inv) async {
1645+ when (luci.scheduleTryBuilds (targets: anyNamed ('targets' ), pullRequest: anyNamed ('pullRequest' )))
1646+ .thenAnswer ((inv) async {
17581647 return [];
17591648 });
17601649
@@ -1847,7 +1736,6 @@ targets:
18471736 luci.scheduleTryBuilds (
18481737 targets: captureAnyNamed ('targets' ),
18491738 pullRequest: captureAnyNamed ('pullRequest' ),
1850- flutterPrebuiltEngineVersion: anyNamed ('flutterPrebuiltEngineVersion' ),
18511739 ),
18521740 );
18531741 expect (result.callCount, 1 );
@@ -2603,13 +2491,8 @@ targets:
26032491 throw Exception ('Failed to find ${request .url .path }' );
26042492 });
26052493 final luci = MockLuciBuildService ();
2606- when (
2607- luci.scheduleTryBuilds (
2608- targets: anyNamed ('targets' ),
2609- pullRequest: anyNamed ('pullRequest' ),
2610- flutterPrebuiltEngineVersion: anyNamed ('flutterPrebuiltEngineVersion' ),
2611- ),
2612- ).thenAnswer ((inv) async {
2494+ when (luci.scheduleTryBuilds (targets: anyNamed ('targets' ), pullRequest: anyNamed ('pullRequest' )))
2495+ .thenAnswer ((inv) async {
26132496 return [];
26142497 });
26152498 final MockGithubService mockGithubService = MockGithubService ();
@@ -2670,7 +2553,6 @@ targets:
26702553 luci.scheduleTryBuilds (
26712554 targets: captureAnyNamed ('targets' ),
26722555 pullRequest: anyNamed ('pullRequest' ),
2673- flutterPrebuiltEngineVersion: anyNamed ('flutterPrebuiltEngineVersion' ),
26742556 ),
26752557 );
26762558 expect (result.callCount, 1 );
@@ -2731,13 +2613,8 @@ targets:
27312613 'Linux engine_build' ,
27322614 };
27332615 });
2734- when (
2735- luci.scheduleTryBuilds (
2736- targets: anyNamed ('targets' ),
2737- pullRequest: anyNamed ('pullRequest' ),
2738- flutterPrebuiltEngineVersion: anyNamed ('flutterPrebuiltEngineVersion' ),
2739- ),
2740- ).thenAnswer ((inv) async {
2616+ when (luci.scheduleTryBuilds (targets: anyNamed ('targets' ), pullRequest: anyNamed ('pullRequest' )))
2617+ .thenAnswer ((inv) async {
27412618 return [];
27422619 });
27432620 final MockGithubService mockGithubService = MockGithubService ();
@@ -2851,13 +2728,8 @@ targets:
28512728 'Mac engine_build' ,
28522729 };
28532730 });
2854- when (
2855- luci.scheduleTryBuilds (
2856- targets: anyNamed ('targets' ),
2857- pullRequest: anyNamed ('pullRequest' ),
2858- flutterPrebuiltEngineVersion: anyNamed ('flutterPrebuiltEngineVersion' ),
2859- ),
2860- ).thenAnswer ((inv) async {
2731+ when (luci.scheduleTryBuilds (targets: anyNamed ('targets' ), pullRequest: anyNamed ('pullRequest' )))
2732+ .thenAnswer ((inv) async {
28612733 return [];
28622734 });
28632735 final MockGithubService mockGithubService = MockGithubService ();
@@ -3247,8 +3119,8 @@ targets:
32473119 await scheduler.triggerPresubmitTargets (pullRequest: pullRequest);
32483120 expect (
32493121 fakeLuciBuildService.flutterPrebuiltEngineVersion,
3250- isNull ,
3251- reason: 'When scheduling engine builds, there is no concept of an engine prebuilt. ' ,
3122+ pullRequest. base ! .sha ,
3123+ reason: 'Should use the base ref for the engine artifacts ' ,
32523124 );
32533125 expect (
32543126 fakeLuciBuildService.scheduledTryBuilds.map ((t) => t.value.name),
@@ -3261,8 +3133,8 @@ targets:
32613133}
32623134
32633135final class _CapturingFakeLuciBuildService extends Fake implements LuciBuildService {
3264- List <Target > scheduledTryBuilds = [] ;
3265- String ? flutterPrebuiltEngineVersion;
3136+ late List <Target > scheduledTryBuilds;
3137+ late String ? flutterPrebuiltEngineVersion;
32663138
32673139 @override
32683140 Future <List <Target >> scheduleTryBuilds ({
0 commit comments