Any ways to run some tests in sequences/order?

Hi,

I am writing some integration tests that test endpoints that write/update/delete items in a database. Connection to the database are limited though(free tier plan) so I cannot run those tests in parallels or most will fail because they can't get a connection. I can use cargo test -- --test-threads=1 but it slow down all the other tests.

Is there any way to run some tests in orders? If not, is it something that is planned in the future?

Sounds like you should have one big integration test for the database stuff with multiple assertions, etc. in it? Tests that don't need the database can remain separated so they still benefit from parallelism.

I thought it was 1 test per action so that's why I was separating them. I've now refractored that test in doing the POST, PUT and DEL tests all in one with an assert btw them and it works.

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.