From fb8704de03f0b0ec29a5741613096d3ef928cda7 Mon Sep 17 00:00:00 2001 From: Anton Malinskiy Date: Thu, 5 Mar 2026 17:02:18 +1000 Subject: [PATCH 1/2] feat(ios): --batch-isolation --- src/api.rs | 9 ++++++++- src/cli/android/maestro/mod.rs | 1 + src/cli/android/mod.rs | 1 + src/cli/ios/maestro/mod.rs | 1 + src/cli/ios/mod.rs | 3 +++ src/cli/mod.rs | 10 ++++++++++ src/cli/model.rs | 8 ++++++++ src/interactor.rs | 4 +++- 8 files changed, 35 insertions(+), 2 deletions(-) diff --git a/src/api.rs b/src/api.rs index 0bc2234..13b504d 100644 --- a/src/api.rs +++ b/src/api.rs @@ -18,7 +18,7 @@ use tokio::io; use crate::{ bundle::{ApplicationBundleReference, LibraryBundleReference}, - cli::model::LocalFileReference, + cli::model::{BatchIsolation, LocalFileReference}, errors::{ApiError, EnvArgError, InputError}, filtering::model::SparseMarathonfile, pull::PullFileConfig, @@ -63,6 +63,7 @@ pub trait RapiClient { application_bundle: Option>, library_bundle: Option>, granted_permission: Option>, + batch_isolation: Option, ) -> Result; async fn get_run(&self, id: &str) -> Result; @@ -162,6 +163,7 @@ impl RapiClient for RapiReqwestClient { application_bundle: Option>, library_bundle: Option>, granted_permission: Option>, + batch_isolation: Option, ) -> Result { let url = format!("{}/v2/run", self.base_url); let params = [("api_key", self.api_key.clone())]; @@ -258,6 +260,8 @@ impl RapiClient for RapiReqwestClient { let env_args_map = vec_to_hashmap(env_args)?; let test_env_args_map = vec_to_hashmap(test_env_args)?; + let app_uninstall = batch_isolation.map(|x| x == BatchIsolation::UninstallApp); + let create_request = CreateRunRequest { s3_test_app_path: s3_test_app_path.clone(), test_app_md5: test_app.clone().map(|s| s.md5), @@ -294,6 +298,7 @@ impl RapiClient for RapiReqwestClient { test_env_args: test_env_args_map, bundles, granted_permission: granted_permission.clone(), + app_uninstall, }; let response = self.client.post(url).json(&create_request).send().await?; @@ -675,6 +680,8 @@ struct CreateRunRequest { bundles: Option>, #[serde(rename = "granted_permission", default)] granted_permission: Option>, + #[serde(rename = "app_uninstall", default)] + app_uninstall: Option, } #[derive(Serialize, Deserialize, Debug)] diff --git a/src/cli/android/maestro/mod.rs b/src/cli/android/maestro/mod.rs index b0b27fe..18b64f7 100644 --- a/src/cli/android/maestro/mod.rs +++ b/src/cli/android/maestro/mod.rs @@ -130,6 +130,7 @@ pub(crate) async fn run( None, None, None, + None, formatter, ) .await diff --git a/src/cli/android/mod.rs b/src/cli/android/mod.rs index 2b41b8b..30e36ec 100644 --- a/src/cli/android/mod.rs +++ b/src/cli/android/mod.rs @@ -283,6 +283,7 @@ If you are interesting in library testing then please use advance mode with --li application_bundle, library_bundle, None, + None, formatter, ) .await diff --git a/src/cli/ios/maestro/mod.rs b/src/cli/ios/maestro/mod.rs index 16be9b0..5fd9982 100644 --- a/src/cli/ios/maestro/mod.rs +++ b/src/cli/ios/maestro/mod.rs @@ -157,6 +157,7 @@ pub(crate) async fn run( None, None, None, + None, formatter, ) .await diff --git a/src/cli/ios/mod.rs b/src/cli/ios/mod.rs index a29d506..2cedefe 100644 --- a/src/cli/ios/mod.rs +++ b/src/cli/ios/mod.rs @@ -7,6 +7,7 @@ use anyhow::Result; use indicatif::{ProgressBar, ProgressStyle}; use std::collections::HashSet; +use crate::cli::model::BatchIsolation; use crate::cli::validate; use crate::formatter::Formatter; use crate::{ @@ -218,6 +219,7 @@ pub(crate) async fn run( test_timeout_default: Option, test_timeout_max: Option, granted_permission: Option>, + batch_isolation: Option, ) -> Result { let (device, os_version) = match validate_device_configuration(os_version, device).await { Ok(value) => value, @@ -380,6 +382,7 @@ pub(crate) async fn run( None, None, granted_permission, + batch_isolation, formatter, ) .await diff --git a/src/cli/mod.rs b/src/cli/mod.rs index 31f4a8c..ffafff0 100644 --- a/src/cli/mod.rs +++ b/src/cli/mod.rs @@ -9,6 +9,7 @@ use clap::CommandFactory; use clap::{Args, Parser, Subcommand}; use std::path::PathBuf; +use crate::cli::model::BatchIsolation; use crate::errors::default_error_handler; use crate::interactor::{DownloadArtifactsInteractor, GetDeviceCatalogInteractor}; @@ -97,6 +98,7 @@ impl Cli { test_timeout_default, test_timeout_max, granted_permission, + batch_isolation, } => { ios::run( application, @@ -115,6 +117,7 @@ impl Cli { test_timeout_default, test_timeout_max, granted_permission, + batch_isolation, ) .await } @@ -586,6 +589,13 @@ Example: '--library-bundle apks/library1-debug-androidTest.apk --library-bundle #[command(flatten)] analytics_args: AnalyticsArgs, + #[arg( + value_enum, + long, + help = "Batch isolation mode. Use app uninstall if you want to uninstall app between test batches" + )] + batch_isolation: Option, + #[arg( long, help = "xctestrun environment variable (EnvironmentVariables item), example FOO=BAR" diff --git a/src/cli/model.rs b/src/cli/model.rs index 352ba95..09f80e8 100644 --- a/src/cli/model.rs +++ b/src/cli/model.rs @@ -27,3 +27,11 @@ pub struct LocalFileReference { pub path: PathBuf, pub md5: String, } + +#[derive(Debug, clap::ValueEnum, Clone, PartialEq, Eq)] +pub enum BatchIsolation { + #[clap(name = "default")] + Default, + #[clap(name = "uninstall_app")] + UninstallApp, +} diff --git a/src/interactor.rs b/src/interactor.rs index 67be030..7e13c3e 100644 --- a/src/interactor.rs +++ b/src/interactor.rs @@ -1,6 +1,6 @@ use crate::{ bundle::{ApplicationBundleReference, LibraryBundleReference}, - cli::model::{LocalFileReference, Platform}, + cli::model::{BatchIsolation, LocalFileReference, Platform}, pull::PullFileConfig, }; use anyhow::Result; @@ -143,6 +143,7 @@ impl TriggerTestRunInteractor { application_bundle: Option>, library_bundle: Option>, granted_permission: Option>, + batch_isolation: Option, mut formatter: StandardFormatter, ) -> Result { let client = RapiReqwestClient::new(base_url, api_key); @@ -182,6 +183,7 @@ impl TriggerTestRunInteractor { application_bundle, library_bundle, granted_permission, + batch_isolation, ) .await?; From f8e669df150cfa268d35a30efcfbf662cd2d2b09 Mon Sep 17 00:00:00 2001 From: Anton Malinskiy Date: Thu, 5 Mar 2026 17:10:57 +1000 Subject: [PATCH 2/2] chore(deps): update --- Cargo.lock | 101 ++++++++--------------------------------------------- Cargo.toml | 6 ++-- 2 files changed, 17 insertions(+), 90 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 43c7f81..3219b46 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -347,12 +347,11 @@ checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" [[package]] name = "colored" -version = "2.2.0" +version = "3.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "117725a109d387c937a1533ce01b450cbde6b88abceea8473c4d7a85853cda3c" +checksum = "faf9468729b8cbcea668e36183cb69d317348c2e08e994829fb56ebfdfbaac34" dependencies = [ - "lazy_static", - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -1188,12 +1187,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" - [[package]] name = "libc" version = "0.2.180" @@ -2037,9 +2030,9 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.16.1" +version = "3.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fa237f2807440d238e0364a218270b98f767a00d3dada77b1c53ae88940e2e7" +checksum = "381b283ce7bc6b476d903296fb59d0d36633652b633b27f64db4fb46dcbfc3b9" dependencies = [ "base64", "chrono", @@ -2056,9 +2049,9 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.16.1" +version = "3.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52a8e3ca0ca629121f70ab50f95249e5a6f925cc0f6ffe8256c45b728875706c" +checksum = "a6d4e30573c8cb306ed6ab1dca8423eec9a463ea0e155f45399455e0368b27e0" dependencies = [ "darling 0.21.3", "proc-macro2", @@ -2112,14 +2105,14 @@ checksum = "e320a6c5ad31d271ad523dcf3ad13e2767ad8b1cb8f047f75a8aeaf8da139da2" [[package]] name = "simple_logger" -version = "4.3.3" +version = "5.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e7e46c8c90251d47d08b28b8a419ffb4aede0f87c2eea95e17d1d5bacbf3ef1" +checksum = "c7038d0e96661bf9ce647e1a6f6ef6d6f3663f66d9bf741abf14ba4876071c17" dependencies = [ "colored", "log", "time", - "windows-sys 0.48.0", + "windows-sys 0.61.2", ] [[package]] @@ -2259,9 +2252,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.46" +version = "0.3.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9da98b7d9b7dad93488a84b8248efc35352b0b2657397d4167e7ad67e5d535e5" +checksum = "743bd48c283afc0388f9b8827b976905fb217ad9e647fae3a379a9283c4def2c" dependencies = [ "deranged", "itoa", @@ -2282,9 +2275,9 @@ checksum = "7694e1cfe791f8d31026952abf09c69ca6f6fa4e1a1229e18988f06a04a12dca" [[package]] name = "time-macros" -version = "0.2.26" +version = "0.2.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78cc610bac2dcee56805c99642447d4c5dbde4d01f752ffea0199aee1f601dc4" +checksum = "2e70e4c5a0e0a8a4823ad65dfe1a6930e4f4d756dcd9dd7939022b5e8c501215" dependencies = [ "num-conv", "time-core", @@ -2715,15 +2708,6 @@ dependencies = [ "windows-targets 0.42.2", ] -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - [[package]] name = "windows-sys" version = "0.52.0" @@ -2775,21 +2759,6 @@ dependencies = [ "windows_x86_64_msvc 0.42.2", ] -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - [[package]] name = "windows-targets" version = "0.52.6" @@ -2829,12 +2798,6 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - [[package]] name = "windows_aarch64_gnullvm" version = "0.52.6" @@ -2853,12 +2816,6 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - [[package]] name = "windows_aarch64_msvc" version = "0.52.6" @@ -2877,12 +2834,6 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - [[package]] name = "windows_i686_gnu" version = "0.52.6" @@ -2913,12 +2864,6 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - [[package]] name = "windows_i686_msvc" version = "0.52.6" @@ -2937,12 +2882,6 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - [[package]] name = "windows_x86_64_gnu" version = "0.52.6" @@ -2961,12 +2900,6 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - [[package]] name = "windows_x86_64_gnullvm" version = "0.52.6" @@ -2985,12 +2918,6 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - [[package]] name = "windows_x86_64_msvc" version = "0.52.6" diff --git a/Cargo.toml b/Cargo.toml index 3ec7bdc..19a7499 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,8 +26,8 @@ serde = { version = "1.0.209", features = ["derive"] } serde-enum-str = "0.4.0" serde_json = "1.0.127" serde_yaml = "0.9.33" -serde_with = "3.6.0" -simple_logger = "4.3.3" +serde_with = "3.17.0" +simple_logger = "5.2.0" shellexpand = "3.1.0" tempfile = "3.9.0" # Reqwest pulls in dependency on openssl which we replace with rustls, hence disabling default features @@ -37,7 +37,7 @@ reqwest = { version = "0.13", default-features = false, features = [ "stream", "rustls", ] } -time = { version = "0.3.36", features = ["serde-well-known"] } +time = { version = "0.3.47", features = ["serde-well-known"] } tokio = { version = "1.40.0", features = ["full"] } tokio-util = "0.7.11" futures = "0.3"