Skip to content

Commit

Permalink
Run all termination + plan tests in system tests workflow
Browse files Browse the repository at this point in the history
Also re-order workflow a bit:
1) Setup: Repo checkout, Rust, Python, RCC
3) Plan + termination tests (fast)
3) Full scheduler test (slow)
  • Loading branch information
jherbel committed Aug 9, 2024
1 parent 5413cab commit 55b0188
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 17 deletions.
40 changes: 29 additions & 11 deletions .github/workflows/system_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,26 @@ jobs:
test_scheduler_windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/[email protected]
with:
target: x86_64-pc-windows-gnu
- uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
- run: pip install -r tests/minimal_suite/requirements.txt
- uses: actions/download-artifact@v4
with:
name: rcc
path: C:\
- uses: actions/checkout@v4

- run: cargo test --target=x86_64-pc-windows-gnu --test test_plan_run -- --ignored
- run: cargo run --example termination --target=x86_64-pc-windows-gnu
- run: cargo run --example termination --target=x86_64-pc-windows-gnu -- C:\windows64\rcc.exe

- run: mkdir C:\managed_robots
- run: tar --create -z --directory tests\minimal_suite\ --file C:\managed_robots\minimal_suite.tar.gz *
- uses: actions-rust-lang/[email protected]
with:
target: x86_64-pc-windows-gnu
- run: cargo test --target=x86_64-pc-windows-gnu --test test_scheduler -- --nocapture --ignored
env:
TEST_DIR: C:\test_scheduler
Expand All @@ -29,25 +39,34 @@ jobs:
with:
name: system_test_debug_information_windows
path: C:\test_scheduler
- run: cargo run --example termination -- C:\windows64\rcc.exe

test_scheduler_linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/[email protected]
with:
target: x86_64-unknown-linux-gnu
- run: echo "RUSTFLAGS=--cfg tokio_unstable" >> "$GITHUB_ENV"
- uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
- run: pip install -r tests/minimal_suite/requirements.txt
- uses: actions/download-artifact@v4
with:
name: rcc
path: /tmp/
# file permissions are not retained during upload:
# https://github.com/actions/upload-artifact?tab=readme-ov-file#permission-loss
- run: chmod +x /tmp/linux64/rcc
- uses: actions/checkout@v4

- run: cargo test --target=x86_64-unknown-linux-gnu --test test_plan_run -- --ignored
- run: cargo run --example termination --target=x86_64-unknown-linux-gnu
- run: cargo run --example termination --target=x86_64-unknown-linux-gnu -- /tmp/linux64/rcc

- run: mkdir /tmp/managed_robots
- run: tar --create --gzip --directory tests/minimal_suite/ --file /tmp/managed_robots/minimal_suite.tar.gz .
- uses: actions-rust-lang/[email protected]
with:
target: x86_64-unknown-linux-gnu
- run: echo "RUSTFLAGS=--cfg tokio_unstable" >> "$GITHUB_ENV"
- run: cargo test --target=x86_64-unknown-linux-gnu --test test_scheduler -- --nocapture --ignored
env:
TEST_DIR: /tmp/test_scheduler
Expand All @@ -59,4 +78,3 @@ jobs:
with:
name: system_test_debug_information_linux
path: /tmp/test_scheduler
- run: cargo run --example termination -- /tmp/linux64/rcc
6 changes: 0 additions & 6 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,12 @@ jobs:
- { os: ubuntu-latest, target: x86_64-unknown-linux-gnu }
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
- run: pip install -r requirements.txt
- uses: actions-rust-lang/[email protected]
with:
components: rustfmt, clippy
target: ${{ matrix.type.target }}
- run: echo "RUSTFLAGS=--cfg tokio_unstable" >> "$GITHUB_ENV"
- run: cargo fmt -- --check
- run: cargo test --all-targets --target ${{ matrix.type.target }} -- --skip test_scheduler
- run: cargo run --example termination --target ${{ matrix.type.target }}
- run: cargo clippy --all-targets --target ${{ matrix.type.target }} -- --deny warnings
- run: cargo build --target ${{ matrix.type.target }}
File renamed without changes.
2 changes: 2 additions & 0 deletions tests/test_plan_run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use tempfile::tempdir;
use tokio_util::sync::CancellationToken;

#[test]
#[ignore]
fn test_rebot_run() -> AnyhowResult<()> {
let test_dir = Utf8PathBuf::from_path_buf(tempdir()?.into_path()).unwrap();
let robot = Robot {
Expand All @@ -36,6 +37,7 @@ fn test_rebot_run() -> AnyhowResult<()> {
}

#[test]
#[ignore]
fn test_timeout_process() -> AnyhowResult<()> {
let test_dir = Utf8PathBuf::from_path_buf(tempdir()?.into_path()).unwrap();
let resource = test_dir.join("resource");
Expand Down

0 comments on commit 55b0188

Please sign in to comment.