Skip to content

Commit

Permalink
feat(run): output_glob was added to args for run command
Browse files Browse the repository at this point in the history
  • Loading branch information
matzuk committed May 30, 2024
1 parent 13f126e commit d088ab7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ impl Cli {
true,
instrumentation_arg,
None,
common.output_glob,
)
.await
}
Expand Down Expand Up @@ -280,6 +281,7 @@ If you provide any single or two of these parameters, the others will be inferre
true,
xctestrun_env,
xctestrun_test_env,
common.output_glob,
)
.await
}
Expand Down Expand Up @@ -365,6 +367,12 @@ struct CommonRunArgs {
#[arg(short, long, help = "Output folder for test run results")]
output: Option<PathBuf>,

#[arg(
long,
help = "Only files matching this glob will be downloaded in the output folder, i.e. 'tests/**' will download only the JUnit xml files"
)]
output_glob: Option<String>,

#[arg(long, help = "Run each test in isolation, i.e. isolated batching.")]
isolated: Option<bool>,

Expand Down
4 changes: 4 additions & 0 deletions src/interactor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ impl TriggerTestRunInteractor {
progress: bool,
env_args: Option<Vec<String>>,
test_env_args: Option<Vec<String>>,
output_glob: Option<String>,
) -> Result<bool> {
let client = RapiReqwestClient::new(base_url, api_key);
let steps = match (wait, output) {
Expand Down Expand Up @@ -221,6 +222,9 @@ impl TriggerTestRunInteractor {
style(format!("[3/{}]", steps)).bold().dim()
);
let artifacts = fetch_artifact_list(&client, &id, &token).await?;
let test_run_id_prefix = format!("{}/", &id);
let artifacts =
filter_artifact_list(artifacts, output_glob, &test_run_id_prefix)?;
println!(
"{} Downloading files...",
style(format!("[4/{}]", steps)).bold().dim()
Expand Down

0 comments on commit d088ab7

Please sign in to comment.