I am using something like this to paralleize the unit tests in my python project:
Unit tests - components:
...
variables:
...
parallel:
matrix:
- component: [ folder1, folder2, folder3 ]
folder1, folder2, folder3 unit tests are executed in parallel, but lets say folder1 has many more tests, limiting the benefits of parallization as implemented here. Assume the tests in folder1 are all independent. Without manually breaking down folder1 into its subfolders, can I somehow tell gitlab to use x workers to run the unit tests in folder1 in parallel?
No, there is no way to do that. GitLab executes a command with no native features to run your language-specific tests in parallel. You have to control it on a manual subfolder level as you mentioned.