-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Run test by order #1532
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
AVA won't guarantee any particular execution order. Why do you need this? (I'm closing this issue, but please don't refrain from discussing it further.) |
hey @novemberborn is there a way to run the tests file by file (I don't mind the order). Reason is, I need to be authenticated to do some tests and the authenticated user needs to be an admin. But each time I test something like this I have to clean up the user (remove it from admin role). This conflicts if I have multiple tests doing the same thing ( I imagine, haven't tested yet ). I use |
@johhansantana try the |
@novemberborn wow, that's perfect, thanks! |
@novemberborn I would need to run tests in a specific order. Reason is : I'm tracking an issue, which is occuring sometimes (but not every time) when running my test suite with ava. I think it might be related to the order of test, like a test run A is corrupting another test run B. Problem is : i have 37 tests and even if i know test B (because it is failing) it is very hard to track test run A if the order of test run is changing. |
@piercus the order within a test file is currently fixed, though asynchronous tests may complete in a different order based on the async APIs they're relying on. The order by which test files run is not currently randomized, but we don't guarantee any particular order either. #595 proposes we randomize the order, which as you found requires a way to reproduce that order, too. So ironically that would help you. I would use the |
For anybody looking for a solution for this, how i came around it was looping through the files and running the tests individually.
The |
Why was this closed if I may ask ? Is there already a way to defined an order in which the test files should run ? |
@GentileFulvio this is a rather old issue. Perhaps you could post your question anew in our Discussions section? |
I have config file:
It seems that ava run test not by filename order, how to make ava run test by order? I've added
serial
in config or in cli arguments but it doesn't works too.The text was updated successfully, but these errors were encountered: