PHPUnit with custom/contrib and submodules structure I am starting to write our tests with PHPUnit on Drupal 8, and I am not sure about the best practices with the phpunit.xml.dist file.
We separates the custom and the contrib modules using two directories in the /modules directory - /modules/custom and modules/contrib.
The original phpunit.xml.dist file contains the following line &lt;directory&gt;../modules/*/tests/src/Unit&lt;/directory&gt; so I had to add the
&lt;directory&gt;../modules/*/*/tests/src/Unit&lt;/directory&gt; directory.

I have another issue with sub-modules, our current structure is /modules/custom/main_custom_module/modules/sub_module, so I had to add another directory to the file (&lt;directory&gt;../modules/*/*/modules/*/tests/src/Unit&lt;/directory&gt;).

What is the best practice when it comes to overriding the phpunit.xml.dist file? should I remove the file from VC (e.g. git,svn..)?
The right thing to do is to not add it to the core phpunit.xml.dist file. You have your own code, so you want to test that. The idea that core also tests contrib / custom code is not the right thing to do, IMHO