@@ -7,11 +7,11 @@ use crate::prelude::*;
77use crate :: project_config:: ProjectConfig ;
88use crate :: project_config:: merger:: ConfigMerger ;
99use crate :: upload:: UploadResult ;
10+ use crate :: upload:: poll_results:: { PollResultsOptions , poll_results} ;
1011use clap:: Args ;
1112use std:: path:: Path ;
1213
1314pub mod multi_targets;
14- mod poll_results;
1515
1616/// We temporarily force this name for all exec runs
1717pub const DEFAULT_REPOSITORY_NAME : & str = "local-runs" ;
@@ -91,20 +91,19 @@ pub async fn run(
9191/// result polling. It is used by both `codspeed exec` directly and by `codspeed run` when
9292/// executing targets defined in codspeed.yaml.
9393pub async fn execute_with_harness (
94- config : crate :: executor:: Config ,
94+ mut config : crate :: executor:: Config ,
9595 api_client : & CodSpeedAPIClient ,
9696 codspeed_config : & CodSpeedConfig ,
9797 setup_cache_dir : Option < & Path > ,
9898) -> Result < ( ) > {
99- let mut execution_context =
100- executor:: ExecutionContext :: new ( config, codspeed_config, api_client) . await ?;
99+ let orchestrator =
100+ executor:: Orchestrator :: new ( & mut config, codspeed_config, api_client) . await ?;
101101
102- if !execution_context . is_local ( ) {
102+ if !orchestrator . is_local ( ) {
103103 super :: show_banner ( ) ;
104104 }
105105
106- debug ! ( "config: {:#?}" , execution_context. config) ;
107- let executor = executor:: get_executor_from_mode ( & execution_context. config . mode ) ;
106+ debug ! ( "config: {config:#?}" ) ;
108107
109108 let get_exec_harness_installer_url = || {
110109 format ! (
@@ -120,17 +119,14 @@ pub async fn execute_with_harness(
120119 )
121120 . await ?;
122121
122+ let poll_opts = PollResultsOptions :: for_exec ( ) ;
123123 let poll_results_fn = async |upload_result : & UploadResult | {
124- poll_results:: poll_results ( api_client, upload_result) . await
124+ poll_results ( api_client, upload_result, & poll_opts ) . await
125125 } ;
126126
127- executor:: execute_benchmarks (
128- executor. as_ref ( ) ,
129- & mut execution_context,
130- setup_cache_dir,
131- poll_results_fn,
132- )
133- . await ?;
127+ orchestrator
128+ . execute ( & mut config, setup_cache_dir, poll_results_fn)
129+ . await ?;
134130
135131 Ok ( ( ) )
136132}
0 commit comments