From b4084a7f9fbfc2335d992f05b6e0976143c6c168 Mon Sep 17 00:00:00 2001 From: Dmitry Grand Date: Thu, 12 Mar 2026 11:09:07 -0700 Subject: [PATCH 01/13] Decrease failed count for re-run. Make status inProgress while at least one build is nurring. --- .../lib/src/service/firestore/unified_check_run.dart | 2 ++ packages/cocoon_common/lib/guard_status.dart | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app_dart/lib/src/service/firestore/unified_check_run.dart b/app_dart/lib/src/service/firestore/unified_check_run.dart index bcd7b0b2a3..5b393b5382 100644 --- a/app_dart/lib/src/service/firestore/unified_check_run.dart +++ b/app_dart/lib/src/service/firestore/unified_check_run.dart @@ -210,7 +210,9 @@ final class UnifiedCheckRun { if (currentStatus.isBuildCompleted) { guard.remainingBuilds += 1; + guard.failedBuilds -= 1; } + builds[buildName] = TaskStatus.waitingForBackfill; guard.builds = builds; diff --git a/packages/cocoon_common/lib/guard_status.dart b/packages/cocoon_common/lib/guard_status.dart index af3998c5e5..54a86b6724 100644 --- a/packages/cocoon_common/lib/guard_status.dart +++ b/packages/cocoon_common/lib/guard_status.dart @@ -33,14 +33,14 @@ enum GuardStatus { required int remainingBuilds, required int totalBuilds, }) { - if (failedBuilds > 0) { - return GuardStatus.failed; + if (remainingBuilds == totalBuilds) { + return GuardStatus.waitingForBackfill; + } else if (remainingBuilds > 0) { + return GuardStatus.inProgress; } else if (failedBuilds == 0 && remainingBuilds == 0) { return GuardStatus.succeeded; - } else if (remainingBuilds == totalBuilds) { - return GuardStatus.waitingForBackfill; } else { - return GuardStatus.inProgress; + return GuardStatus.failed; } } } From 3a923b2741170f66f169d62937f5e3e949b3f0e9 Mon Sep 17 00:00:00 2001 From: Dmitry Grand Date: Thu, 12 Mar 2026 12:51:36 -0700 Subject: [PATCH 02/13] presubmitGuard.failedBuilds decreased and remainingBuilds increasd when re-run requested so `markConclusion` should handle re-runned checks same way it handle it for the first time run --- .../service/firestore/unified_check_run.dart | 25 ++++--------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/app_dart/lib/src/service/firestore/unified_check_run.dart b/app_dart/lib/src/service/firestore/unified_check_run.dart index 5b393b5382..3348b11f75 100644 --- a/app_dart/lib/src/service/firestore/unified_check_run.dart +++ b/app_dart/lib/src/service/firestore/unified_check_run.dart @@ -210,7 +210,9 @@ final class UnifiedCheckRun { if (currentStatus.isBuildCompleted) { guard.remainingBuilds += 1; - guard.failedBuilds -= 1; + if (currentStatus.isBuildFailed && guard.failedBuilds > 0) { + guard.failedBuilds -= 1; + } } builds[buildName] = TaskStatus.waitingForBackfill; @@ -595,29 +597,12 @@ final class UnifiedCheckRun { throw '$logCrumb: field "${PresubmitGuard.fieldRemainingBuilds}" is already zero for $transaction / ${presubmitGuardDocument.fields}'; } remaining = remaining - 1; - } - - if (status.isBuildSuccessed) { - // Only rollback the "failed" counter if this is a successful test run, - // i.e. the test failed, the user requested a rerun, and now it passes. - if (state.attemptNumber > 1) { - log.info( - '$logCrumb: conclusion flipped to positive - assuming test was re-run', - ); - if (failed == 0) { - throw '$logCrumb: field "${PresubmitGuard.fieldFailedBuilds}" is already zero for $transaction / ${presubmitGuardDocument.fields}'; - } - failed = failed - 1; - } valid = true; } - // Only increment the "failed" counter if the conclusion failed for the first attempt. if (status.isBuildFailed) { - if (state.attemptNumber == 1) { - log.info('$logCrumb: test failed'); - failed = failed + 1; - } + log.info('$logCrumb: test failed'); + failed = failed + 1; valid = true; } From 0011a64079e1f39ac9b9be389cd1ab03bd9df296 Mon Sep 17 00:00:00 2001 From: Dmitry Grand Date: Thu, 12 Mar 2026 13:06:20 -0700 Subject: [PATCH 03/13] conductor(checkpoint): Phase Complete: Data Seeding Updates --- conductor/tracks.md | 2 +- .../tracks/rerun_failed_ui_20260309/plan.md | 4 ++-- dashboard/test/service/data_seeder_test.dart | 22 +++++++++++++++++++ 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/conductor/tracks.md b/conductor/tracks.md index 2f13ad003c..f54fb4d276 100644 --- a/conductor/tracks.md +++ b/conductor/tracks.md @@ -7,5 +7,5 @@ --- -- [x] **Track: Re-run Event Handling in Presubmit Guard Details** +- [~] **Track: Re-run Event Handling in Presubmit Guard Details** *Link: [./tracks/rerun_failed_ui_20260309/](./tracks/rerun_failed_ui_20260309/)* diff --git a/conductor/tracks/rerun_failed_ui_20260309/plan.md b/conductor/tracks/rerun_failed_ui_20260309/plan.md index a7eb41b662..4918f6f1c4 100644 --- a/conductor/tracks/rerun_failed_ui_20260309/plan.md +++ b/conductor/tracks/rerun_failed_ui_20260309/plan.md @@ -26,10 +26,10 @@ Update the backend service interface and the state management logic to support r ## Phase 3: Data Seeding Updates Update the backend data seeder to provide more realistic dummy data for integration tests. -- [~] Task: Update `_seedPresubmitData` in `dashboard/lib/service/data_seeder.dart` to seed `prCheckRuns` with dummy `pull_request`. +- [x] Task: Update `_seedPresubmitData` in `dashboard/lib/service/data_seeder.dart` to seed `prCheckRuns` with dummy `pull_request`. - For every `PresubmitGuard`, create a matching `PrCheckRuns` document. - Include a dummy `PullRequest` object with: `head.sha`, `base.repo`, `base.ref`, `user.login`, `number`, `labels`. -- [ ] Task: Conductor - User Manual Verification 'Phase 3: Data Seeding Updates' (Protocol in workflow.md) +- [x] Task: Conductor - User Manual Verification 'Phase 3: Data Seeding Updates' (Protocol in workflow.md) ## Phase 2: UI Implementation Update the `PresubmitView` to connect the existing buttons to the new state methods and handle error reporting. diff --git a/dashboard/test/service/data_seeder_test.dart b/dashboard/test/service/data_seeder_test.dart index 0769c93d88..9e955c2840 100644 --- a/dashboard/test/service/data_seeder_test.dart +++ b/dashboard/test/service/data_seeder_test.dart @@ -30,4 +30,26 @@ void main() { .toList(); expect(suppressed, isNotEmpty); }); + + test('DataSeeder seeds presubmit data', () async { + final server = IntegrationServer(); + final seeder = DataSeeder(server); + seeder.seed(); + + final firestore = server.firestore; + final guards = firestore.documents + .where((d) => d.name!.contains('presubmit_guards')) + .toList(); + expect(guards, isNotEmpty); + + final checks = firestore.documents + .where((d) => d.name!.contains('presubmit_checks')) + .toList(); + expect(checks, isNotEmpty); + + final prCheckRuns = firestore.documents + .where((d) => d.name!.contains('prCheckRuns')) + .toList(); + expect(prCheckRuns, isNotEmpty); + }); } From 62e07f218d9ed269631c7470607dffd0b31022e9 Mon Sep 17 00:00:00 2001 From: Dmitry Grand Date: Thu, 12 Mar 2026 13:06:32 -0700 Subject: [PATCH 04/13] conductor(plan): Mark phase 'Phase 3: Data Seeding Updates' as complete --- conductor/tracks/rerun_failed_ui_20260309/plan.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conductor/tracks/rerun_failed_ui_20260309/plan.md b/conductor/tracks/rerun_failed_ui_20260309/plan.md index 4918f6f1c4..96e50fbab5 100644 --- a/conductor/tracks/rerun_failed_ui_20260309/plan.md +++ b/conductor/tracks/rerun_failed_ui_20260309/plan.md @@ -23,7 +23,7 @@ Update the backend service interface and the state management logic to support r - [x] Task: Rename `rerunTask` to `rerunFailedJob` and `rerunFailed` to `rerunAllFailedJobs` in `PresubmitState` and its usages. - [x] Task: Conductor - User Manual Verification 'Phase 1: Service and State Updates' (Protocol in workflow.md) -## Phase 3: Data Seeding Updates +## Phase 3: Data Seeding Updates [checkpoint: 0011a64] Update the backend data seeder to provide more realistic dummy data for integration tests. - [x] Task: Update `_seedPresubmitData` in `dashboard/lib/service/data_seeder.dart` to seed `prCheckRuns` with dummy `pull_request`. From 005de1872cb5eb697f76872d6f215192094a2a8f Mon Sep 17 00:00:00 2001 From: Dmitry Grand Date: Thu, 12 Mar 2026 13:06:40 -0700 Subject: [PATCH 05/13] chore(conductor): Mark track 'Re-run Event Handling in Presubmit Guard Details' as complete --- conductor/tracks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conductor/tracks.md b/conductor/tracks.md index f54fb4d276..2f13ad003c 100644 --- a/conductor/tracks.md +++ b/conductor/tracks.md @@ -7,5 +7,5 @@ --- -- [~] **Track: Re-run Event Handling in Presubmit Guard Details** +- [x] **Track: Re-run Event Handling in Presubmit Guard Details** *Link: [./tracks/rerun_failed_ui_20260309/](./tracks/rerun_failed_ui_20260309/)* From fe2599d04cf70e41a868a43785f6e1a9dad496c5 Mon Sep 17 00:00:00 2001 From: Dmitry Grand Date: Thu, 12 Mar 2026 13:07:29 -0700 Subject: [PATCH 06/13] docs(conductor): Synchronize docs for track 'Re-run Event Handling in Presubmit Guard Details' --- conductor/product.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conductor/product.md b/conductor/product.md index a7be7308bd..ce269c3051 100644 --- a/conductor/product.md +++ b/conductor/product.md @@ -19,7 +19,7 @@ Cocoon is the CI coordination and orchestration system for the Flutter project. * **Tree Status Dashboard:** A Flutter-based web application that provides a visual overview of build health across various commits and branches. * **Presubmit Check Details:** Backend APIs to retrieve detailed attempt history and status for specific presubmit checks, aiding in debugging and visibility. * **Presubmit Guard Summaries:** Backend APIs to retrieve summaries of all presubmit checks (Presubmit Guards) of the provided pull request to the dashboard. -* **Presubmit Guard Details:** Displays detailed information and CI check statuses for a specific presubmit check (Presubmit Guard), including the commit SHA in the view header for precise version tracking. +* **Presubmit Guard Details:** Displays detailed information and CI check statuses for a specific presubmit check (Presubmit Guard), and allows authenticated users to trigger re-runs for individual jobs or all failed jobs directly from the dashboard. * **Merge Queue Visibility:** APIs for querying and inspecting recent GitHub Merge Queue webhook events to diagnose integration issues. * **Auto-submit Bot:** Handles automated pull request management, including label-based merges, reverts, and validation checks. * **GitHub Integration:** Robust handling of GitHub webhooks to sync commits, manage check runs, and report build statuses back to PRs. From ddb45ba7d50d313acd16540a82ec070343edb3ce Mon Sep 17 00:00:00 2001 From: Dmitry Grand Date: Thu, 12 Mar 2026 13:08:09 -0700 Subject: [PATCH 07/13] chore(conductor): Archive track 'Re-run Event Handling in Presubmit Guard Details' --- .../{tracks => archive}/rerun_failed_ui_20260309/index.md | 0 .../rerun_failed_ui_20260309/metadata.json | 0 .../{tracks => archive}/rerun_failed_ui_20260309/plan.md | 0 .../{tracks => archive}/rerun_failed_ui_20260309/spec.md | 0 conductor/tracks.md | 5 ----- 5 files changed, 5 deletions(-) rename conductor/{tracks => archive}/rerun_failed_ui_20260309/index.md (100%) rename conductor/{tracks => archive}/rerun_failed_ui_20260309/metadata.json (100%) rename conductor/{tracks => archive}/rerun_failed_ui_20260309/plan.md (100%) rename conductor/{tracks => archive}/rerun_failed_ui_20260309/spec.md (100%) diff --git a/conductor/tracks/rerun_failed_ui_20260309/index.md b/conductor/archive/rerun_failed_ui_20260309/index.md similarity index 100% rename from conductor/tracks/rerun_failed_ui_20260309/index.md rename to conductor/archive/rerun_failed_ui_20260309/index.md diff --git a/conductor/tracks/rerun_failed_ui_20260309/metadata.json b/conductor/archive/rerun_failed_ui_20260309/metadata.json similarity index 100% rename from conductor/tracks/rerun_failed_ui_20260309/metadata.json rename to conductor/archive/rerun_failed_ui_20260309/metadata.json diff --git a/conductor/tracks/rerun_failed_ui_20260309/plan.md b/conductor/archive/rerun_failed_ui_20260309/plan.md similarity index 100% rename from conductor/tracks/rerun_failed_ui_20260309/plan.md rename to conductor/archive/rerun_failed_ui_20260309/plan.md diff --git a/conductor/tracks/rerun_failed_ui_20260309/spec.md b/conductor/archive/rerun_failed_ui_20260309/spec.md similarity index 100% rename from conductor/tracks/rerun_failed_ui_20260309/spec.md rename to conductor/archive/rerun_failed_ui_20260309/spec.md diff --git a/conductor/tracks.md b/conductor/tracks.md index 2f13ad003c..43048451de 100644 --- a/conductor/tracks.md +++ b/conductor/tracks.md @@ -4,8 +4,3 @@ - [~] **Track: Build a Merge Queue Dashboard** *Link: [./tracks/merge_queue_dashboard_20260205/](./tracks/merge_queue_dashboard_20260205/)* - ---- - -- [x] **Track: Re-run Event Handling in Presubmit Guard Details** -*Link: [./tracks/rerun_failed_ui_20260309/](./tracks/rerun_failed_ui_20260309/)* From 244057c34c22f679bf0328999512a7ec1f75ab1f Mon Sep 17 00:00:00 2001 From: Dmitry Grand Date: Thu, 12 Mar 2026 13:12:41 -0700 Subject: [PATCH 08/13] fixed gemini review commants --- packages/cocoon_common/lib/guard_status.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/cocoon_common/lib/guard_status.dart b/packages/cocoon_common/lib/guard_status.dart index 54a86b6724..bef6aa1b18 100644 --- a/packages/cocoon_common/lib/guard_status.dart +++ b/packages/cocoon_common/lib/guard_status.dart @@ -33,12 +33,12 @@ enum GuardStatus { required int remainingBuilds, required int totalBuilds, }) { - if (remainingBuilds == totalBuilds) { + if (failedBuilds == 0 && remainingBuilds == 0) { + return GuardStatus.succeeded; + } else if (remainingBuilds == totalBuilds) { return GuardStatus.waitingForBackfill; } else if (remainingBuilds > 0) { return GuardStatus.inProgress; - } else if (failedBuilds == 0 && remainingBuilds == 0) { - return GuardStatus.succeeded; } else { return GuardStatus.failed; } From 51a772575e4c462743da4243a2a093b590dd0f9e Mon Sep 17 00:00:00 2001 From: Dmitry Grand Date: Thu, 12 Mar 2026 16:04:06 -0700 Subject: [PATCH 09/13] fix review comments --- dashboard/test/service/data_seeder_test.dart | 25 ++++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/dashboard/test/service/data_seeder_test.dart b/dashboard/test/service/data_seeder_test.dart index 9e955c2840..5d53ee6170 100644 --- a/dashboard/test/service/data_seeder_test.dart +++ b/dashboard/test/service/data_seeder_test.dart @@ -14,8 +14,9 @@ void main() { final firestore = server.firestore; final changes = firestore.documents - .where((d) => d.name!.contains('tree_status_change')) - .toList(); + .where( + (d) => d.name!.contains('tree_status_change'), + ); expect(changes, isNotEmpty); }); @@ -26,8 +27,9 @@ void main() { final firestore = server.firestore; final suppressed = firestore.documents - .where((d) => d.name!.contains('suppressed_tests')) - .toList(); + .where( + (d) => d.name!.contains('suppressed_tests'), + ); expect(suppressed, isNotEmpty); }); @@ -38,18 +40,21 @@ void main() { final firestore = server.firestore; final guards = firestore.documents - .where((d) => d.name!.contains('presubmit_guards')) - .toList(); + .where( + (d) => d.name!.contains('presubmit_guards'), + ); expect(guards, isNotEmpty); final checks = firestore.documents - .where((d) => d.name!.contains('presubmit_checks')) - .toList(); + .where( + (d) => d.name!.contains('presubmit_checks'), + ); expect(checks, isNotEmpty); final prCheckRuns = firestore.documents - .where((d) => d.name!.contains('prCheckRuns')) - .toList(); + .where( + (d) => d.name!.contains('prCheckRuns'), + ); expect(prCheckRuns, isNotEmpty); }); } From 9cbb282aab0ee05d4b863eaa14847ad32622b575 Mon Sep 17 00:00:00 2001 From: Dmitry Grand Date: Thu, 12 Mar 2026 16:11:46 -0700 Subject: [PATCH 10/13] add comments --- app_dart/lib/src/service/firestore/unified_check_run.dart | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app_dart/lib/src/service/firestore/unified_check_run.dart b/app_dart/lib/src/service/firestore/unified_check_run.dart index 3348b11f75..afac0e7556 100644 --- a/app_dart/lib/src/service/firestore/unified_check_run.dart +++ b/app_dart/lib/src/service/firestore/unified_check_run.dart @@ -208,6 +208,12 @@ final class UnifiedCheckRun { final builds = guard.builds; final currentStatus = builds[buildName]!; + + // If build is failed we increment remain builds and decrement failed. + // If build succeeded re-run is not possible but if some how they manage to + // request re-run we have to only increment remaining builds. + // If build is still in progress re-run is not possible but if some how they + // manage to request rerun we should not touch any counters. if (currentStatus.isBuildCompleted) { guard.remainingBuilds += 1; if (currentStatus.isBuildFailed && guard.failedBuilds > 0) { From 8c82eb7b84bc6b90f7e25f6770b02eb882eaa873 Mon Sep 17 00:00:00 2001 From: Dmitry Grand Date: Thu, 12 Mar 2026 16:12:41 -0700 Subject: [PATCH 11/13] spell check --- app_dart/lib/src/service/firestore/unified_check_run.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app_dart/lib/src/service/firestore/unified_check_run.dart b/app_dart/lib/src/service/firestore/unified_check_run.dart index afac0e7556..96c3eb0c92 100644 --- a/app_dart/lib/src/service/firestore/unified_check_run.dart +++ b/app_dart/lib/src/service/firestore/unified_check_run.dart @@ -213,7 +213,7 @@ final class UnifiedCheckRun { // If build succeeded re-run is not possible but if some how they manage to // request re-run we have to only increment remaining builds. // If build is still in progress re-run is not possible but if some how they - // manage to request rerun we should not touch any counters. + // manage to request re-run we should not touch any counters. if (currentStatus.isBuildCompleted) { guard.remainingBuilds += 1; if (currentStatus.isBuildFailed && guard.failedBuilds > 0) { From faa3e5565b3e2d4781afb1ce1bfd32f681296f92 Mon Sep 17 00:00:00 2001 From: Dmitry Grand Date: Thu, 12 Mar 2026 16:35:23 -0700 Subject: [PATCH 12/13] If build already compleated remaining and failed should not updated. --- .../service/firestore/unified_check_run.dart | 60 ++++++++++--------- 1 file changed, 32 insertions(+), 28 deletions(-) diff --git a/app_dart/lib/src/service/firestore/unified_check_run.dart b/app_dart/lib/src/service/firestore/unified_check_run.dart index 96c3eb0c92..99aae7c675 100644 --- a/app_dart/lib/src/service/firestore/unified_check_run.dart +++ b/app_dart/lib/src/service/firestore/unified_check_run.dart @@ -208,7 +208,6 @@ final class UnifiedCheckRun { final builds = guard.builds; final currentStatus = builds[buildName]!; - // If build is failed we increment remain builds and decrement failed. // If build succeeded re-run is not possible but if some how they manage to // request re-run we have to only increment remaining builds. @@ -590,37 +589,42 @@ final class UnifiedCheckRun { } valid = true; } else { - // "remaining" should go down if build is succeeded or failed. - // "failed_count" can go up or down depending on: - // attemptNumber > 1 && buildSuccessed: down (-1) - // attemptNumber = 1 && buildFailed: up (+1) - // So if the test existed and either remaining or failed_count is changed; - // the response is valid. - status = state.status; - if (status.isBuildCompleted) { - // Guard against going negative and log enough info so we can debug. - if (remaining == 0) { - throw '$logCrumb: field "${PresubmitGuard.fieldRemainingBuilds}" is already zero for $transaction / ${presubmitGuardDocument.fields}'; + // If build already compleated remaining and failed should not updated. + if (!status.isBuildCompleted) { + // "remaining" should go down if build is succeeded or failed. + // "failed_count" can go up or down depending on: + // attemptNumber > 1 && buildSuccessed: down (-1) + // attemptNumber = 1 && buildFailed: up (+1) + // So if the test existed and either remaining or failed_count is changed; + // the response is valid. + if (state.status.isBuildCompleted) { + // Guard against going negative and log enough info so we can debug. + if (remaining == 0) { + throw '$logCrumb: field "${PresubmitGuard.fieldRemainingBuilds}" is already zero for $transaction / ${presubmitGuardDocument.fields}'; + } + remaining -= 1; + valid = true; } - remaining = remaining - 1; - valid = true; - } - if (status.isBuildFailed) { - log.info('$logCrumb: test failed'); - failed = failed + 1; + if (state.status.isBuildFailed) { + log.info('$logCrumb: test failed'); + failed += 1; + valid = true; + } + status = state.status; + // All checks pass. "valid" is only set to true if there was a change in either the remaining or failed count. + log.info( + '$logCrumb: setting remaining to $remaining, failed to $failed', + ); + presubmitGuard.remainingBuilds = remaining; + presubmitGuard.failedBuilds = failed; + presubmitCheck.endTime = state.endTime!; + presubmitCheck.summary = state.summary; + presubmitCheck.buildNumber = state.buildNumber; + } else { + status = state.status; valid = true; } - - // All checks pass. "valid" is only set to true if there was a change in either the remaining or failed count. - log.info( - '$logCrumb: setting remaining to $remaining, failed to $failed', - ); - presubmitGuard.remainingBuilds = remaining; - presubmitGuard.failedBuilds = failed; - presubmitCheck.endTime = state.endTime!; - presubmitCheck.summary = state.summary; - presubmitCheck.buildNumber = state.buildNumber; } builds[state.buildName] = status; presubmitGuard.builds = builds; From e6d1470eb5a7181242621079a3bbdf3c42d7b1a2 Mon Sep 17 00:00:00 2001 From: Dmitry Grand Date: Thu, 12 Mar 2026 16:44:06 -0700 Subject: [PATCH 13/13] fix formating --- dashboard/test/service/data_seeder_test.dart | 35 +++++++++----------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/dashboard/test/service/data_seeder_test.dart b/dashboard/test/service/data_seeder_test.dart index 5d53ee6170..959f73a0d1 100644 --- a/dashboard/test/service/data_seeder_test.dart +++ b/dashboard/test/service/data_seeder_test.dart @@ -13,11 +13,10 @@ void main() { seeder.seed(); final firestore = server.firestore; - final changes = firestore.documents - .where( - (d) => d.name!.contains('tree_status_change'), + expect( + firestore.documents.where((d) => d.name!.contains('tree_status_change')), + isNotEmpty, ); - expect(changes, isNotEmpty); }); test('DataSeeder seeds suppressed tests', () async { @@ -26,11 +25,10 @@ void main() { seeder.seed(); final firestore = server.firestore; - final suppressed = firestore.documents - .where( - (d) => d.name!.contains('suppressed_tests'), + expect( + firestore.documents.where((d) => d.name!.contains('suppressed_tests')), + isNotEmpty, ); - expect(suppressed, isNotEmpty); }); test('DataSeeder seeds presubmit data', () async { @@ -39,22 +37,19 @@ void main() { seeder.seed(); final firestore = server.firestore; - final guards = firestore.documents - .where( - (d) => d.name!.contains('presubmit_guards'), + expect( + firestore.documents.where((d) => d.name!.contains('presubmit_guards')), + isNotEmpty, ); - expect(guards, isNotEmpty); - final checks = firestore.documents - .where( - (d) => d.name!.contains('presubmit_checks'), + expect( + firestore.documents.where((d) => d.name!.contains('presubmit_checks')), + isNotEmpty, ); - expect(checks, isNotEmpty); - final prCheckRuns = firestore.documents - .where( - (d) => d.name!.contains('prCheckRuns'), + expect( + firestore.documents.where((d) => d.name!.contains('prCheckRuns')), + isNotEmpty, ); - expect(prCheckRuns, isNotEmpty); }); }