Needs work
Project:
Drupal core
Version:
main
Component:
phpunit
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
21 Feb 2018 at 14:30 UTC
Updated:
3 Apr 2025 at 17:05 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
MixologicThis would greatly reduce the complexity/needs of #2941560: Add testing with webdriver instructions for other operating systems
Comment #3
dawehnerComment #4
alexpottGot a browser test running with zero config. Now we just need to implement starting up chromedriver. There's a problem with PHPUnit and phpunit.xml env var declarations taking precedence of the things already set up. This behaviour is fixed in PHPUnit 6 but this means we probably need to read that too to provide a consistent behaviour for the user.
Comment #6
alexpottDowngrading symfony/dotenv
Comment #7
dawehnerRight now the chromedriver on JS is installed using the package.json. I'm wondering whether we could leverage that somehow too.
Comment #8
alexpottNot sure about #7 but here's a zero config js test working if chromedriver is installed in the path. So I guess all we would need to do is add wherever package.json puts chromedriver to the paths to search.
Comment #9
alexpottNow supporting the most common PHPUnit argument / options. Should be able to run any PHPUnit test we have bar the Phantom ones and that is solvable too.
Comment #10
alexpottWhoops - only filter was working.
So
php ./core/scripts/php-test.php run-phpunit --testsuite unitworks as expected. Obviously that's kinda silly because we don't need to use this to run unit tests but the it proves it works and all the browser tests would take ages.Comment #11
alexpottMore docs.
Comment #12
dawehnerI'm curious, should we adapt some of this documentation to point more towards phpunit based testing as well?
Can we have a composer script for this?
I'm curious whether we could have the same entry point for all tests, basically run-tests.sh 2.0?
Note: We should update the name
We should document that for more advanced needs you might should run it directly still. One more advanced usage would be to actually run the entire test suite.
What about using
$webserverProcessand$chromedriverProcessas name?I think this help text should point to Phpunit documentation
It is nice that you support multiple arguments.
What a nice idea ;)
So if we know there will be just one command anyway, could we skip having a custom class and wire it up in the main entry point?
Comment #13
justafishUpdating comment in the dotenv file
Interdiff: https://github.com/justafish/drupal/pull/3/commits/5364274a14739488cfa65...
Comment #14
justafish🤦♀️
Comment #15
justafishSyncing with changes in https://github.com/jsdrupal/nightwatch/pull/1
Comment #16
alexpottPatch addresses #12
Re #12.3 - I think there is value using PHP to run PHP tests and JS to run JS tests. Not sure we want a single runner. It also makes it simple just to pass things through to PHPUnit. This doesn't attempt to pass things to run-tests.sh to run Simpletest tests for example.
Comment #17
alexpottI was also thinking we could implement a phpunit-other-args option to pass more options on to phpunit if people want.
Comment #18
dawehnerLet's open up a followup for that?
Fair point. To be honest having
composer run-script testsandnpm run testswould be enough of consistency for me.I'm wondering: Should we check somehow whether we run unit tests and in that case not try to start up a webserver/chromedriver, given that both might be quite slow?
Comment #28
smustgrave commentedIf still needed. A follow up ticket was requested in #18
Comment #29
nod_Patch or MR doesn't apply anymore
The last patch or MR doesn't apply to the target branch, please reroll the code so that it can be reviewed by the automated testbot.
D10 version needed
At this time we would need a D10.1.x patch or MR for this issue.
Comment #31
andypostComment #32
andypostAs selenium 4 is out and W3C Webdriver standardized it will need to prepare specific docker image for new CI.
Faced while worked on split of PHP image #3387737: Split PHP image into php(cli/apache) and yarn(node/nightwatch)
Comment #33
vsujeetkumar commentedRe-roll patch created for 11.x.
Comment #34
vsujeetkumar commentedFixed the CCF Issue. Please have a look.
Comment #35
smustgrave commentedCan the follow in #18 be addressed if it's needed or not?
Comment #36
andypost