Problem/Motivation
To me, it was totally not obvious that one should copy core/phpunit.xml.dist to core/phpunit.xml and then modify it.
I asked dawehner how he dealt with phpunit.xml.dist not being listed in Drupal core's .gitignore, and the annoyances that come with that. His response: you haven't read the blogpost from alex, didnt' you?
. In which he was referring to https://www.chapterthree.com/blog/javascript-testing-comes-to-drupal-8.
I had read that blog post, but I read copy phpunit.xml.dist to phpunit.xml.dist
, so I simply didn't notice. Also, that's not widely-known/easily-found documentation, it's just a blog post. (But a great blog post!)
Proposed resolution
- Document it in
core/phpunit.xml.dist
- Document it in
core/README.md
Remaining tasks
Review.
User interface changes
None.
API changes
None.
Data model changes
None.
Comments
Comment #2
wim leersComment #3
dawehnerI think its fine to prefer phpunit.xml over environment variables. It makes it easier, IMHO, so removing it from here is a good idea.
Comment #4
anavarreSee also https://www.drupal.org/node/2116263
Comment #14
quietone commented1) I think the first point in the proposed resolution is covered now, the README.md in core/tests has instructions for phpunit.xml.dist
2) For 2, how about just refer to the README? I have made a patch for that. No interdiff because this and the earlier patch are small.
Comment #15
guilhermevp commentedI think that this is enough to point the user in the right direction, but yes, this is very useful instruction.
Comment #16
alexpottUnfortunately this is not quite true. This file is used by DrupalCI to run all PHPUnit tests. I think this should say something more along the lines of "For best practices on customising PHPUnit configuration see core/tests/README.md." or something like that.
Comment #17
guilhermevp commentedMade changes following #16 feedback. Please review.
Comment #18
quietone commentedNeeds to be wrapped at 80 columns.
Comment #19
guilhermevp commentedSorry @quietone, the parte the belongs to the patch is respecting the columns... Should I change the rest of the comment?
Comment #20
quietone commentedWhen I wrap that for 80 columns it becomes
But then I thought it might be nice to get this to one line. What about one of these? Sorry for not thinking of options earlier. I must take more walks!
or even
<!-- For how to customize PHPUnit configuration see core/tests/README.md. -->Comment #21
longwave"To customize PHPUnit configuration, please see core/tests/README.md"?
Comment #22
quietone commentedI know it is for user interface text, but this says not to use 'please'. Maybe not use 'please' here as well.
Comment #23
guilhermevp commentedUsed the second suggestion in comment #20, please review!
Comment #24
daffie commentedLooks good to me.
Comment #25
alexpottCommitted 3a5c113 and pushed to 9.3.x. Thanks!