Timeline for Is it bad practice to enforce an execution order for unit tests?
Current License: CC BY-SA 3.0
10 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Apr 5, 2018 at 15:48 | comment | added | Robbie Dee | @MikeHoller There are still better ways of doing this rather than ordering e.g. test attributes and various schedules for CI/CD environments, but yes, it is a misunderstanding on the part of the OP calling these unit tests. | |
| Apr 5, 2018 at 15:33 | comment | added | Mike Holler | I've also edited my original post to remove "unit test" completely. | |
| Apr 5, 2018 at 15:32 | history | edited | Mike Holler | CC BY-SA 3.0 | Remove "unit" terminology. |
| Apr 5, 2018 at 15:31 | comment | added | Mike Holler | @RobbieDee I was merely using the terminology the OP was using. I understand that these are not true unit tests. If you want to fight about terminology, bring it up with OP. (hence why I clarified with "true unit tests" in my earlier comment") | |
| Apr 5, 2018 at 7:35 | comment | added | Robbie Dee | @MikeHoller Then they're not unit tests. There really should be no confusion as to what unit tests are. | |
| Apr 4, 2018 at 23:39 | comment | added | WillC | You're both right, I think; Robbie is right that unit tests should be small and fast and isolated from dependencies so order shouldn't matter and random-ordering often encourages better design by enforcing that independence; and Mike is right that running faster tests first is very, very good for integration tests. As in answers above, part of the problem is terminology of unit vs. integration tests. | |
| Apr 4, 2018 at 15:46 | comment | added | Mike Holler | The OP says he cannot work with dummy data for some of these tests. That means a database hit of some sort, slowing down all tests (even some true unit tests that should run fast naturally). If he has other tests that do not require database hits, they will run an order of magnitude faster than anything requiring disk or network hits. | |
| Apr 4, 2018 at 14:27 | comment | added | Robbie Dee | I'd be more inclined to investigate why a certain unit test is running slowly rather than enforce an order. Unit tests are supposed to be fast. | |
| Apr 4, 2018 at 14:11 | review | First posts | |||
| Apr 5, 2018 at 5:50 | |||||
| Apr 4, 2018 at 14:10 | history | answered | Mike Holler | CC BY-SA 3.0 |