Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I set the RUST_TEST_TASKS environment variable?

Tags:

testing

rust

I am attempting to write tests for my Rust program. Normally, these tests are run in parallel but I want to run them sequentially. I looked around and I can set this environment variable RUST_TEST_TASKS=1, but I am not sure where to do that.

like image 711
Varun Avatar asked Sep 01 '25 17:09

Varun


2 Answers

The environment variable is actually RUST_TEST_THREADS

like image 69
brandonchinn178 Avatar answered Sep 04 '25 07:09

brandonchinn178


I think what they mean is setting the environment variables in the shell the test runner is running in, such as:

RUST_TEST_TASKS=1 ./my-test-runner

or exporting it:

export RUST_TEST_TASKS=1
./my-test-runner
like image 36
Gerard van Helden Avatar answered Sep 04 '25 07:09

Gerard van Helden