Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
196 changes: 191 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ open = "5.3.2"
tabled = { version = "0.20.0", features = ["ansi"] }
shell-words = "1.1.0"
rmp-serde = "1.3.0"
uuid = { version = "1.21.0", features = ["v4"] }

[target.'cfg(target_os = "linux")'.dependencies]
procfs = "0.17.0"
Expand Down
4 changes: 2 additions & 2 deletions src/api_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ nest! {
#[derive(Debug, Deserialize, Serialize)]*
#[serde(rename_all = "camelCase")]*
struct GetRepositoryData {
repository: Option<pub struct GetRepositoryPayload {
repository_overview: Option<pub struct GetRepositoryPayload {
pub id: String,
}>
}
Expand Down Expand Up @@ -327,7 +327,7 @@ impl CodSpeedAPIClient {
)
.await;
match response {
Ok(response) => Ok(response.repository),
Ok(response) => Ok(response.repository_overview),
Err(err) if err.contains_error_code("REPOSITORY_NOT_FOUND") => Ok(None),
Err(err) if err.contains_error_code("UNAUTHENTICATED") => {
bail!("Your session has expired, please login again using `codspeed auth login`")
Expand Down
26 changes: 11 additions & 15 deletions src/cli/exec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ use crate::prelude::*;
use crate::project_config::ProjectConfig;
use crate::project_config::merger::ConfigMerger;
use crate::upload::UploadResult;
use crate::upload::poll_results::{PollResultsOptions, poll_results};
use clap::Args;
use std::path::Path;

pub mod multi_targets;
mod poll_results;

/// We temporarily force this name for all exec runs
pub const DEFAULT_REPOSITORY_NAME: &str = "local-runs";
Expand Down Expand Up @@ -91,20 +91,19 @@ pub async fn run(
/// result polling. It is used by both `codspeed exec` directly and by `codspeed run` when
/// executing targets defined in codspeed.yaml.
pub async fn execute_with_harness(
config: crate::executor::Config,
mut config: crate::executor::Config,
api_client: &CodSpeedAPIClient,
codspeed_config: &CodSpeedConfig,
setup_cache_dir: Option<&Path>,
) -> Result<()> {
let mut execution_context =
executor::ExecutionContext::new(config, codspeed_config, api_client).await?;
let orchestrator =
executor::Orchestrator::new(&mut config, codspeed_config, api_client).await?;

if !execution_context.is_local() {
if !orchestrator.is_local() {
super::show_banner();
}

debug!("config: {:#?}", execution_context.config);
let executor = executor::get_executor_from_mode(&execution_context.config.mode);
debug!("config: {config:#?}");

let get_exec_harness_installer_url = || {
format!(
Expand All @@ -120,17 +119,14 @@ pub async fn execute_with_harness(
)
.await?;

let poll_opts = PollResultsOptions::for_exec();
let poll_results_fn = async |upload_result: &UploadResult| {
poll_results::poll_results(api_client, upload_result).await
poll_results(api_client, upload_result, &poll_opts).await
};

executor::execute_benchmarks(
executor.as_ref(),
&mut execution_context,
setup_cache_dir,
poll_results_fn,
)
.await?;
orchestrator
.execute(&mut config, setup_cache_dir, poll_results_fn)
.await?;

Ok(())
}
Loading