MCPcopy Create free account
hub / github.com/CodSpeedHQ/codspeed / setup_executor

Function setup_executor

src/cli/setup.rs:87–122  ·  view source on GitHub ↗

Set up a single executor based on its support level on the current system.

(
    executor: &dyn Executor,
    system_info: &SystemInfo,
    setup_cache_dir: Option<&Path>,
    run_environment: &RunEnvironment,
)

Source from the content-addressed store, hash-verified

85
86/// Set up a single executor based on its support level on the current system.
87async fn setup_executor(
88 executor: &dyn Executor,
89 system_info: &SystemInfo,
90 setup_cache_dir: Option<&Path>,
91 run_environment: &RunEnvironment,
92) -> Result<()> {
93 let support_level = executor.support_level(system_info);
94 if support_level == ExecutorSupport::Unsupported {
95 info!(
96 "Skipping setup for the {} executor: not supported on {}",
97 executor.name(),
98 system_info.os
99 );
100 return Ok(());
101 }
102
103 info!(
104 "Setting up the environment for the executor: {}",
105 executor.name()
106 );
107 let result = setup_and_grant(executor, system_info, setup_cache_dir, run_environment).await;
108
109 match result {
110 // We publish no tooling for this host, so the executor could only try. Leave the
111 // installation to the user and carry on with the other executors.
112 Err(error) if support_level == ExecutorSupport::RequiresManualInstallation => {
113 warn!(
114 "Could not set up the {} executor on {}, install its tooling manually: {error}",
115 executor.name(),
116 system_info.os
117 );
118 Ok(())
119 }
120 result => result,
121 }
122}
123
124async fn setup_and_grant(
125 executor: &dyn Executor,

Callers 1

setupFunction · 0.85

Calls 2

setup_and_grantFunction · 0.85
support_levelMethod · 0.45

Tested by

no test coverage detected