Skip to content

Commit

Permalink
Restart simulator between different implementation tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-kaufman committed Aug 30, 2024
1 parent e99761b commit 7f0807e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,13 @@ jobs:
run: rustup update
- name: Download and Install HWI
run: ./get_hwi.sh
- name: Test
run: cargo test --features ${{ matrix.rust.features }} -- --test-threads=1
- name: Test python
run: cargo test --features ${{ matrix.rust.features }} test_python -- --test-threads=1
- name: Restart simulator
if: matrix.emulator.name == 'ledger'
run: docker restart simulator
- name: Test binary
run: cargo test --features ${{ matrix.rust.features }} test_binary -- --test-threads=1
- name: Wipe python
run: cargo test test_wipe_device_pyhton -- --ignored --test-threads=1
- name: Restart simulator
Expand Down
12 changes: 6 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -450,19 +450,19 @@ mod tests {
};
}

mod python_tests {
mod test_python_tests {
use super::*;
generate_enumerate_test!(PythonHWIImplementation);
}

mod binary_tests {
mod test_binary_tests {
use super::*;
generate_enumerate_test!(BinaryHWIImplementation<HWIBinaryExecutorImpl>);
}

#[test]
#[serial]
fn test_set_log_level() {
fn test_python_set_log_level() {
HWIClient::<PythonHWIImplementation>::set_log_level(types::LogLevel::DEBUG).unwrap();
let devices = HWIClient::<PythonHWIImplementation>::enumerate().unwrap();
assert!(!devices.is_empty());
Expand All @@ -471,21 +471,21 @@ mod tests {
#[test]
#[serial]
#[ignore]
fn test_install_hwi() {
fn test_python_install_hwi() {
HWIClient::<PythonHWIImplementation>::install_hwilib(Some("2.1.1")).unwrap();
}

#[test]
#[serial]
#[ignore]
fn test_wipe_device_pyhton() {
fn test_python_wipe_device() {
wipe_device::<PythonHWIImplementation>();
}

#[test]
#[serial]
#[ignore]
fn test_wipe_device_binary() {
fn test_binary_wipe_device() {
wipe_device::<BinaryHWIImplementation<HWIBinaryExecutorImpl>>();
}

Expand Down

0 comments on commit 7f0807e

Please sign in to comment.