#[file_parallel]
Available on crate feature file_locks only.
Expand description

Allows for the creation of file-serialised parallel Rust tests that won’t clash with file-serialised serial tests

#[test]
#[file_serial]
fn test_serial_one() {
  // Do things
}

#[test]
#[file_parallel]
fn test_parallel_one() {
  // Do things
}

#[test]
#[file_parallel]
fn test_parallel_two() {
  // Do things
}

Effectively, this should behave like parallel but for file_serial. Note that as per file_serial this doesn’t do anything for serial/parallel tests.

It also supports an optional path arg e.g

#[test]
#[file_parallel(key, "/tmp/foo")]
fn test_parallel_one() {
  // Do things
}

#[test]
#[file_parallel(key, "/tmp/foo")]
fn test_parallel_another() {
  // Do things
}

Note that in this case you need to specify the name arg as well (as per parallel). The path defaults to a reasonable temp directory for the OS if not specified.