-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create integration test to check rebot command
- Loading branch information
1 parent
7a55726
commit cc01804
Showing
12 changed files
with
104 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,11 @@ jobs: | |
- { os: ubuntu-latest, target: x86_64-unknown-linux-gnu } | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
cache: 'pip' | ||
- run: pip install robotframework | ||
- uses: actions-rust-lang/[email protected] | ||
with: | ||
components: rustfmt, clippy | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 tempfile::tempdir; | ||
use tokio_util::sync::CancellationToken; | ||
|
||
#[test] | ||
fn test_rebot_run() -> Result<()> { | ||
let test_dir = Utf8PathBuf::from_path_buf(tempdir()?.into_path()).unwrap(); | ||
let robot = Robot { | ||
robot_target: "tests/minimal_suite/tasks.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, | ||
)?; | ||
println!("{:?}", _attempt_outcomes); | ||
assert!(rebot.is_some()); | ||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
tmp/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
channels: | ||
- conda-forge | ||
|
||
dependencies: | ||
- python=3.11.6 | ||
- pip=23.3.1 | ||
- pip: | ||
- robotframework==6.1.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
def setup() -> None: | ||
print("Setting up...") | ||
|
||
|
||
def teardown() -> None: | ||
print("Tearing down...") | ||
|
||
|
||
def add(left: int, right: int) -> int: | ||
return left + right |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
tasks: | ||
execute: | ||
command: | ||
- python | ||
- --version | ||
|
||
condaConfigFile: conda.yaml | ||
artifactsDir: /tmp/outputdir # Leading slash is ignored, instead we get $(pwd)/tmp/outputdir/ | ||
PATH: | ||
- . | ||
PYTHONPATH: | ||
- . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
*** Settings *** | ||
Documentation Test file for configuring RobotFramework | ||
Library ${CURDIR}/lib/add.py WITH NAME math | ||
|
||
Suite Setup math.setup | ||
Suite Teardown math.teardown | ||
|
||
|
||
*** Test Cases *** | ||
Addition One | ||
${result}= math.add ${20} ${5} | ||
Should Be Equal As Integers ${result} ${25} | ||
|
||
Addition Two | ||
${result}= math.add ${20} ${15} | ||
Should Be Equal As Integers ${result} ${35} | ||
|
||
Addition Three | ||
${result}= math.add ${20} ${25} | ||
Should Be Equal As Integers ${result} ${45} |