diff --git a/app/buck2_data/data.proto b/app/buck2_data/data.proto index 3640591acd21..6ca54995cbc3 100644 --- a/app/buck2_data/data.proto +++ b/app/buck2_data/data.proto @@ -309,9 +309,17 @@ message InstantEvent { // Just something for us to be able to easily propagate out internal // information. Used for testing. QuickUnstableE2eData unstable_e2e_data = 44; + + /// Notification that execution of all tests for a given command is + /// finished. + EndOfTestResults end_of_test_results = 45; } } +message EndOfTestResults { + int32 exit_code = 1; +} + // This should only be used as a mechanism to easily get information into the // event log for e2e tests. message QuickUnstableE2eData { diff --git a/app/buck2_test/src/orchestrator.rs b/app/buck2_test/src/orchestrator.rs index ec3f5fcefe97..77797d0479d8 100644 --- a/app/buck2_test/src/orchestrator.rs +++ b/app/buck2_test/src/orchestrator.rs @@ -65,6 +65,7 @@ use buck2_core::pattern::pattern_type::TargetPatternExtra; use buck2_core::provider::label::ConfiguredProvidersLabel; use buck2_core::target::configured_or_unconfigured::ConfiguredOrUnconfiguredTargetLabel; use buck2_core::target::configured_target_label::ConfiguredTargetLabel; +use buck2_data::EndOfTestResults; use buck2_data::SetupLocalResourcesEnd; use buck2_data::SetupLocalResourcesStart; use buck2_data::TestDiscovery; @@ -714,6 +715,7 @@ impl<'a> TestOrchestrator for BuckTestOrchestrator<'a> { } async fn end_of_test_results(&self, exit_code: i32) -> anyhow::Result<()> { + self.events.instant_event(EndOfTestResults { exit_code }); self.results_channel .unbounded_send(Ok(ExecutorMessage::ExitCode(exit_code))) .map_err(|_| anyhow::Error::msg("end_of_tests was received twice"))?;