From 9c1643e3608d78b00d162cb7b5b4f11c0959e0e1 Mon Sep 17 00:00:00 2001 From: Anton Malinskiy Date: Wed, 18 Sep 2024 18:59:59 +1000 Subject: [PATCH] feat(run): add branch argument (#58) --- src/api.rs | 5 +++++ src/cli/android/mod.rs | 1 + src/cli/ios/mod.rs | 1 + src/cli/mod.rs | 6 ++++++ src/interactor.rs | 2 ++ 5 files changed, 15 insertions(+) diff --git a/src/api.rs b/src/api.rs index 4799d4f..819ee8e 100644 --- a/src/api.rs +++ b/src/api.rs @@ -34,6 +34,7 @@ pub trait RapiClient { test_app: Option, name: Option, link: Option, + branch: Option, platform: String, os_version: Option, system_image: Option, @@ -129,6 +130,7 @@ impl RapiClient for RapiReqwestClient { test_app: Option, name: Option, link: Option, + branch: Option, platform: String, os_version: Option, system_image: Option, @@ -261,6 +263,7 @@ impl RapiClient for RapiReqwestClient { language: None, link: link.clone(), name: name.clone(), + branch: branch.clone(), os_version: os_version.clone(), project: project.clone(), pull_file_config: pull_file_config @@ -576,6 +579,8 @@ struct CreateRunRequest { link: Option, #[serde(rename = "name", default)] name: Option, + #[serde(rename = "branch", default)] + branch: Option, #[serde(rename = "os_version", default)] os_version: Option, #[serde(rename = "project", default)] diff --git a/src/cli/android/mod.rs b/src/cli/android/mod.rs index 45f221c..558b1ff 100644 --- a/src/cli/android/mod.rs +++ b/src/cli/android/mod.rs @@ -230,6 +230,7 @@ If you are interesting in library testing then please use advance mode with --li &api_args.api_key, common.name, common.link, + common.branch, present_wait, common.isolated, common.ignore_test_failures, diff --git a/src/cli/ios/mod.rs b/src/cli/ios/mod.rs index f545d68..dda4065 100644 --- a/src/cli/ios/mod.rs +++ b/src/cli/ios/mod.rs @@ -285,6 +285,7 @@ If you provide any single or two of these parameters, the others will be inferre &api_args.api_key, common.name, common.link, + common.branch, present_wait, common.isolated, common.ignore_test_failures, diff --git a/src/cli/mod.rs b/src/cli/mod.rs index a7c4b1b..374a28f 100644 --- a/src/cli/mod.rs +++ b/src/cli/mod.rs @@ -223,6 +223,12 @@ Please be aware that if you use the 'annotation' filter type on Android, you sho )] link: Option, + #[arg( + long, + help = "Branch for run, for example it could be git branch like develop or feature/about-screen" + )] + branch: Option, + #[arg( long, help = "When tests fail and this option is true then cli will exit with code 0. By default, cli will exit with code 1 in case of test failures and 0 for passing tests" diff --git a/src/interactor.rs b/src/interactor.rs index 75f48db..210de6b 100644 --- a/src/interactor.rs +++ b/src/interactor.rs @@ -104,6 +104,7 @@ impl TriggerTestRunInteractor { api_key: &str, name: Option, link: Option, + branch: Option, wait: bool, isolated: Option, ignore_test_failures: Option, @@ -151,6 +152,7 @@ impl TriggerTestRunInteractor { test_application, name, link, + branch, platform, os_version, system_image,