diff --git a/v2/robotmk/src/sessions/session.rs b/v2/robotmk/src/sessions/session.rs index 0d34b654..69002aae 100644 --- a/v2/robotmk/src/sessions/session.rs +++ b/v2/robotmk/src/sessions/session.rs @@ -34,14 +34,10 @@ impl Session { impl Display for Session { fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult { - write!( - f, - "{}", - match self { - Self::Current(current_session) => format!("{}", current_session), - Self::User(user_session) => format!("{}", user_session), - } - ) + match self { + Self::Current(current_session) => write!(f, "{}", current_session), + Self::User(user_session) => write!(f, "{}", user_session), + } } } diff --git a/v2/robotmk/tests/test_suite_run.rs b/v2/robotmk/tests/test_suite_run.rs new file mode 100644 index 00000000..c9f59023 --- /dev/null +++ b/v2/robotmk/tests/test_suite_run.rs @@ -0,0 +1,32 @@ +use anyhow::Result; +use camino::Utf8PathBuf; +use robotmk::config::RetryStrategy; +use robotmk::environment::{Environment, SystemEnvironment}; +use robotmk::rf::robot::Robot; +use robotmk::sessions::session::{CurrentSession, Session}; +use robotmk::suites::run_attempts_with_rebot; +use std::env::var; +use std::fs::create_dir_all; +use tokio_util::sync::CancellationToken; + +#[test] +fn test_run() -> Result<()> { + let test_dir = Utf8PathBuf::from(var("TEST_DIR")?); + create_dir_all(&test_dir)?; + let robot = Robot { + robot_target: "~/suite/calculator.robot".into(), + n_attempts_max: 1, + command_line_args: vec![], + retry_strategy: RetryStrategy::Complete, + }; + let (_attempt_outcomes, _rebot) = run_attempts_with_rebot( + &robot, + "test", + &Environment::System(SystemEnvironment {}), + &Session::Current(CurrentSession {}), + 3, + &CancellationToken::default(), + &test_dir, + )?; + Ok(()) +}