Skip to content

Commit

Permalink
Document why tests are ignored
Browse files Browse the repository at this point in the history
  • Loading branch information
sosthene-nitrokey committed Feb 19, 2024
1 parent 5df2899 commit 7c549f3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
12 changes: 8 additions & 4 deletions pkcs11/src/api/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,8 @@ mod tests {

use super::*;

// ignored because it needs to be run alone on one thread
// Ignored by default because it would race with the other #[ignore] tests
// Run with cargo test -- --test-threads=1 --ignored
#[test]
#[ignore]
fn test_wait_for_slot_event_no_event() {
Expand All @@ -441,7 +442,8 @@ mod tests {
assert_eq!(result, cryptoki_sys::CKR_NO_EVENT);
}

// ignored because it needs to be run alone on one thread
// Ignored by default because it would race with the other #[ignore] tests
// Run with cargo test -- --test-threads=1 --ignored
#[test]
#[ignore]
fn test_wait_for_slot_event_one_event() {
Expand All @@ -460,7 +462,8 @@ mod tests {
assert_eq!(slot, 0);
}

// we ignore this test because it requires cargo test -- --test-threads=1
// Ignored by default because it would race with the other #[ignore] tests
// Run with cargo test -- --test-threads=1 --ignored
#[test]
#[ignore]
fn test_wait_for_slot_event_blocking_one_event() {
Expand All @@ -483,7 +486,8 @@ mod tests {
assert_eq!(slot, 0);
}

// we ignore this test because it requires cargo test -- --test-threads=1
// Ignored by default because it would race with the other #[ignore] tests
// Run with cargo test -- --test-threads=1 --ignored
#[test]
#[ignore]
fn test_wait_for_slot_event_blocking_finalize() {
Expand Down
4 changes: 4 additions & 0 deletions pkcs11/src/backend/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,8 @@ mod test {

use super::*;

// Ignored by default due to network access
// Run with cargo test -- --test-threads=1 --ignored
#[test]
#[ignore]
fn parrallel_fetch_all_keys() {
Expand Down Expand Up @@ -741,6 +743,8 @@ mod test {
})
}

// Ignored by default due to network access
// Run with cargo test -- --test-threads=1 --ignored
#[test]
#[ignore]
fn parrallel_fetch_all_keys_fail() {
Expand Down
4 changes: 4 additions & 0 deletions pkcs11/src/config/config_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,8 @@ mod tests {

use super::*;

// Ignored by default due ENV variable being changed for the duration of the tests
// Run with cargo test -- --test-threads=1 --ignored
#[test]
#[ignore]
fn test_read_home_config() {
Expand Down Expand Up @@ -276,6 +278,8 @@ slots:
fs::remove_dir_all(home).unwrap();
}

// Ignored by default due ENV variable being changed for the duration of the tests
// Run with cargo test -- --test-threads=1 --ignored
#[test]
#[ignore]
fn test_read_config_no_file() {
Expand Down

0 comments on commit 7c549f3

Please sign in to comment.