Re: Splitting tests instead of testcases by processors when parallelizing tests

2022-03-18 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
Hi Alan I'd repeat what Simon says. To write fast tests, you'll want to adopt per-testcase setup, which is shared between tests within that test case. Django has two mechanisms for this in TestCase: fixtures and setUpTestData. (I gave a talk about setUpTestData last year:

Re: Splitting tests instead of testcases by processors when parallelizing tests

2022-03-18 Thread charettes
The main drawback will be that won't be able to take advantage of setUpTestData to perform costly data creation _once_ for all the tests attached to the same TestCase. Splitting the suite per test will likely force setUpTestData to be called once per process that has at least once one test of

Splitting tests instead of testcases by processors when parallelizing tests

2022-03-18 Thread Alan Evangelista
Django only offers the possibility of parallelizing tests by splitting TestCases among processes. As the number of tests per TestCase class can be very different, it seems that splitting individual tests among processes would make more sense. I have replaced partition_suite_by_case() in