Open Luc45 opened 4 years ago
Aha! Got it.
I've switched to a branch where I update all test-related packages to the latest version, AND I've removed Function Mocker.
npm install && npm run build
because it consistently fails to run those in ET's Common [1] (not sure if something on my end)Now it's running :rocket: .
Now I just have to fix FunctionMocker, instead of removing it.
It seems that /tmp/function-mocker
is not writable by the PHP process inside Tric:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
78ec061677a6 lucatume/codeception:cc3.1.0 "docker-entrypoint.s…" 2 minutes ago Up 2 minutes dev_codeception_run_4649ebc820c9
➜ common git:(ae1e144ce) ✗ docker exec -it 78ec061677a6 bash
docker@94b950b41d1b:/tmp$ ls -la /tmp
total 12
drwxrwxrwt 1 root root 4096 May 22 15:40 .
drwxr-xr-x 1 root root 4096 May 22 15:40 ..
drwxr-xr-x 2 root root 4096 May 22 10:24 function-mocker
/tmp
folder is 777
, but function-mocker
is 755
.
Since it's owned by root, it probably wasn't created by PHP. I'm not sure where this function-mocker
folder is coming from inside the codeception
container. I'll keep looking, but I'm open for suggestions.
-- Edit
tric-stack.yml
volumes:
- function-mocker-cache:/tmp/function-mocker
Not sure how to solve it, OOO next hour
@lucatume , perhaps a chmod 0777 /tmp/function-mocker
in the Codeception image Dockerfile
could solve this? https://github.com/lucatume/dockerfiles/blob/master/containers/codeception/Dockerfile
@Luc45 I'm not updating a docker image I'm using elsewhere, and often w/o function-mocker to fit an application.
It seems like, in the function-mocker bootstrap PHP file, we should check and create, or update, the function-mocker cache application to have 0777
file mode.
@lucatume we can't do that in PHP because the folder is owned by root (created by Docker)
We could probably just get rid of this volume, then, and let PHP create it since /tmp
has 0777 anyway: https://github.com/moderntribe/products-test-automation/blob/master/dev/tric-stack.yml#L171
Function Mocker will try to create and use that folder by default: https://github.com/moderntribe/event-tickets/blob/master/tests/_function-mocker-bootstrap.php#L30
So we can just get Docker out of the way for PHP to do it instead
(tl;dr This is partially solved, check the next comment)
Hey folks,
First of all, amazing work.
Secondly but hereafter therefore after all not less important, I faced a couple of issues while trying to run tric, specifically with
event-tickets
.1 - Pressing "Enter" will skip the option
Before I get to that, just one observation: When I'm presented with an option such as "Do you want to run composer (yes)", if I just press ENTER, it will skip, I'd expect it to default to "yes".
So, back to the issue at hand. I could succesfully run
wpunit
onthe-events-calendar
with these commands:While running the same for event-tickets give me some errors:
2 - Function mocker cache path not writeable
The first of them is related to the cache path of function mocker:
Click here to see the full output of `tric run wpunit`
``` ➜ event-tickets git:(master) ✗ tric run wpunit tric version 0.0.1 - Modern Tribe local testing and development tool Using event-tickets Creating dev_db_1 ... done Creating dev_chrome_1 ... done Creating dev_redis_1 ... done Creating dev_wordpress_1 ... done Fixing file ownership issues... fixuid: fixuid should only ever be used on development systems. DO NOT USE IN PRODUCTION fixuid: runtime UID '1000' already matches container user 'docker' UID fixuid: updating group 'docker' to GID '1001 fixuid: recursively searching path /project WordPress db is unavailable, waiting... WordPress db is unavailable, waiting... WordPress db is unavailable, waiting... WordPress db is unavailable, waiting... WordPress db is unavailable, waiting... WordPress db is unavailable, waiting... WordPress db is unavailable, waiting... WordPress db is unavailable, waiting... WordPress db up. Waiting for WordPress site to be available at http://wordpress.test... WordPress available at http://wordpress.test. Waiting 3 seconds... Changing directory to /var/www/html/wp-content/plugins/event-tickets Using project Codeception binary. Codeception PHP Testing Framework v2.5.6 Powered by PHPUnit 6.5.14 by Sebastian Bergmann and contributors. Running with seed: Function Mocker cache path: /tmp/function-mocker Warning: Uncaught Patchwork\Exceptions\CachePathUnavailable: The specified cache path is inexistent or read-only: /tmp/function-mocker in /var/www/html/wp-content/plugins/event-tickets/vendor/antecedent/patchwork/src/CodeManipulation.php:56 Stack trace: #0 /var/www/html/wp-content/plugins/event-tickets/vendor/antecedent/patchwork/src/CodeManipulation.php(105): Patchwork\CodeManipulation\cacheEnabled() #1 /var/www/html/wp-content/plugins/event-tickets/vendor/antecedent/patchwork/src/CodeManipulation.php(117): Patchwork\CodeManipulation\internalToCache('/var/www/html/w...') #2 /var/www/html/wp-content/plugins/event-tickets/vendor/antecedent/patchwork/src/CodeManipulation/Stream.php(46): Patchwork\CodeManipulation\transformAndOpen('/var/www/html/w...') #3 /var/www/html/wp-content/plugins/event-tickets/vendor/lucatume/wp-browser/src/includes/mock-mailer.php(2): Patchwork\CodeManipulation\Stream->stream_open('/var/www/html/w...', 'rb', 16512, NULL) #4 /var/www/html/wp-content/plugins/event-tickets/vendor/lucatume/wp-browse in /var/www/html/wp-content/plugins/event-tickets/vendor/antecedent/patchwork/src/CodeManipulation.php on line 56 Call Stack: 0.0002 411200 1. {main}() /var/www/html/wp-content/plugins/event-tickets/vendor/codeception/codeception/codecept:0 0.0860 6949168 2. Codeception\Application->run() /var/www/html/wp-content/plugins/event-tickets/vendor/codeception/codeception/codecept:43 0.0860 6949168 3. Codeception\Application->run() /var/www/html/wp-content/plugins/event-tickets/vendor/codeception/codeception/src/Codeception/Application.php:108 0.0961 7166240 4. Codeception\Application->doRun() /var/www/html/wp-content/plugins/event-tickets/vendor/symfony/console/Application.php:148 0.0968 7172240 5. Codeception\Application->doRunCommand() /var/www/html/wp-content/plugins/event-tickets/vendor/symfony/console/Application.php:255 0.0968 7172240 6. Codeception\Command\Run->run() /var/www/html/wp-content/plugins/event-tickets/vendor/symfony/console/Application.php:987 0.0973 7175624 7. Codeception\Command\Run->execute() /var/www/html/wp-content/plugins/event-tickets/vendor/symfony/console/Command/Command.php:255 0.1186 8125424 8. Codeception\Command\Run->runSuites() /var/www/html/wp-content/plugins/event-tickets/vendor/codeception/codeception/src/Codeception/Command/Run.php:390 0.1186 8125424 9. Codeception\Codecept->run() /var/www/html/wp-content/plugins/event-tickets/vendor/codeception/codeception/src/Codeception/Command/Run.php:495 0.1275 8131864 10. Codeception\Codecept->runSuite() /var/www/html/wp-content/plugins/event-tickets/vendor/codeception/codeception/src/Codeception/Codecept.php:159 0.1340 8742224 11. Codeception\SuiteManager->initialize() /var/www/html/wp-content/plugins/event-tickets/vendor/codeception/codeception/src/Codeception/Codecept.php:188 0.1838 11637080 12. Codeception\Module\WPLoader->_initialize() /var/www/html/wp-content/plugins/event-tickets/vendor/codeception/codeception/src/Codeception/SuiteManager.php:80 0.1838 11637080 13. Codeception\Module\WPLoader->initialize() /var/www/html/wp-content/plugins/event-tickets/vendor/lucatume/wp-browser/src/Codeception/Module/WPLoader.php:205 0.1863 11832168 14. Codeception\Module\WPLoader->_loadWordpress() /var/www/html/wp-content/plugins/event-tickets/vendor/lucatume/wp-browser/src/Codeception/Module/WPLoader.php:225 0.1875 11941872 15. Codeception\Module\WPLoader->installAndBootstrapInstallation() /var/www/html/wp-content/plugins/event-tickets/vendor/lucatume/wp-browser/src/Codeception/Module/WPLoader.php:316 0.1878 11975544 16. require_once('/var/www/html/wp-content/plugins/event-tickets/vendor/lucatume/wp-browser/src/includes/bootstrap.php') /var/www/html/wp-content/plugins/event-tickets/vendor/lucatume/wp-browser/src/Codeception/Module/WPLoader.php:504 0.1882 11997368 17. require_once('/var/www/html/wp-content/plugins/event-tickets/vendor/lucatume/wp-browser/src/includes/mock-mailer.php') /var/www/html/wp-content/plugins/event-tickets/vendor/lucatume/wp-browser/src/includes/bootstrap.php:55 Fatal error: Codeception\Module\WPLoader::main(): Failed opening required '/var/www/html//wp-includes/class-phpmailer.php' (include_path='.:/usr/local/lib/php') in /var/www/html/wp-content/plugins/event-tickets/vendor/lucatume/wp-browser/src/includes/mock-mailer.php on line 2 Call Stack: 0.0002 411200 1. {main}() /var/www/html/wp-content/plugins/event-tickets/vendor/codeception/codeception/codecept:0 0.0860 6949168 2. Codeception\Application->run() /var/www/html/wp-content/plugins/event-tickets/vendor/codeception/codeception/codecept:43 0.0860 6949168 3. Codeception\Application->run() /var/www/html/wp-content/plugins/event-tickets/vendor/codeception/codeception/src/Codeception/Application.php:108 0.0961 7166240 4. Codeception\Application->doRun() /var/www/html/wp-content/plugins/event-tickets/vendor/symfony/console/Application.php:148 0.0968 7172240 5. Codeception\Application->doRunCommand() /var/www/html/wp-content/plugins/event-tickets/vendor/symfony/console/Application.php:255 0.0968 7172240 6. Codeception\Command\Run->run() /var/www/html/wp-content/plugins/event-tickets/vendor/symfony/console/Application.php:987 0.0973 7175624 7. Codeception\Command\Run->execute() /var/www/html/wp-content/plugins/event-tickets/vendor/symfony/console/Command/Command.php:255 0.1186 8125424 8. Codeception\Command\Run->runSuites() /var/www/html/wp-content/plugins/event-tickets/vendor/codeception/codeception/src/Codeception/Command/Run.php:390 0.1186 8125424 9. Codeception\Codecept->run() /var/www/html/wp-content/plugins/event-tickets/vendor/codeception/codeception/src/Codeception/Command/Run.php:495 0.1275 8131864 10. Codeception\Codecept->runSuite() /var/www/html/wp-content/plugins/event-tickets/vendor/codeception/codeception/src/Codeception/Codecept.php:159 0.1340 8742224 11. Codeception\SuiteManager->initialize() /var/www/html/wp-content/plugins/event-tickets/vendor/codeception/codeception/src/Codeception/Codecept.php:188 0.1838 11637080 12. Codeception\Module\WPLoader->_initialize() /var/www/html/wp-content/plugins/event-tickets/vendor/codeception/codeception/src/Codeception/SuiteManager.php:80 0.1838 11637080 13. Codeception\Module\WPLoader->initialize() /var/www/html/wp-content/plugins/event-tickets/vendor/lucatume/wp-browser/src/Codeception/Module/WPLoader.php:205 0.1863 11832168 14. Codeception\Module\WPLoader->_loadWordpress() /var/www/html/wp-content/plugins/event-tickets/vendor/lucatume/wp-browser/src/Codeception/Module/WPLoader.php:225 0.1875 11941872 15. Codeception\Module\WPLoader->installAndBootstrapInstallation() /var/www/html/wp-content/plugins/event-tickets/vendor/lucatume/wp-browser/src/Codeception/Module/WPLoader.php:316 0.1878 11975544 16. require_once('/var/www/html/wp-content/plugins/event-tickets/vendor/lucatume/wp-browser/src/includes/bootstrap.php') /var/www/html/wp-content/plugins/event-tickets/vendor/lucatume/wp-browser/src/Codeception/Module/WPLoader.php:504 0.1882 11997368 17. require_once('/var/www/html/wp-content/plugins/event-tickets/vendor/lucatume/wp-browser/src/includes/mock-mailer.php') /var/www/html/wp-content/plugins/event-tickets/vendor/lucatume/wp-browser/src/includes/bootstrap.php:55 ```I got around that by setting
$cache_path = __DIR__ . '/.function-mocker-cache';
inevent-tickets/tests/_function-mocker-bootstrap.php
3 - Can't connect to database
Notwithstanding my efforts, it can't connect to the test database, and it claims that
wp_kses()
has already been declared (as if it were trying to load the WordPress environment twice):Click to see the output of `tric run wpunit` again
``` ➜ event-tickets git:(master) ✗ tric run wpunit tric version 0.0.1 - Modern Tribe local testing and development tool Using event-tickets Starting dev_db_1 ... done Starting dev_redis_1 ... done Starting dev_chrome_1 ... done Starting dev_wordpress_1 ... done Fixing file ownership issues... fixuid: fixuid should only ever be used on development systems. DO NOT USE IN PRODUCTION fixuid: runtime UID '1000' already matches container user 'docker' UID fixuid: updating group 'docker' to GID '1001 fixuid: recursively searching path /project WordPress db up. Waiting for WordPress site to be available at http://wordpress.test... WordPress available at http://wordpress.test. Waiting 3 seconds... Changing directory to /var/www/html/wp-content/plugins/event-tickets Using project Codeception binary. Codeception PHP Testing Framework v2.5.6 Powered by PHPUnit 6.5.14 by Sebastian Bergmann and contributors. Running with seed: Function Mocker cache path: /var/www/html/wp-content/plugins/event-tickets/tests/.function-mocker-cache Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-content/plugins/event-tickets/tests/_function-mocker-bootstrap.php:41) in /var/www/html/wp-includes/pluggable.php on line 1281 Call Stack: 0.0002 411200 1. {main}() /var/www/html/wp-content/plugins/event-tickets/vendor/codeception/codeception/codecept:0 0.0809 6949168 2. Codeception\Application->run() /var/www/html/wp-content/plugins/event-tickets/vendor/codeception/codeception/codecept:43 0.0809 6949168 3. Codeception\Application->run() /var/www/html/wp-content/plugins/event-tickets/vendor/codeception/codeception/src/Codeception/Application.php:108 0.0862 7166240 4. Codeception\Application->doRun() /var/www/html/wp-content/plugins/event-tickets/vendor/symfony/console/Application.php:148 0.0868 7172240 5. Codeception\Application->doRunCommand() /var/www/html/wp-content/plugins/event-tickets/vendor/symfony/console/Application.php:255 0.0869 7172240 6. Codeception\Command\Run->run() /var/www/html/wp-content/plugins/event-tickets/vendor/symfony/console/Application.php:987 0.0874 7175624 7. Codeception\Command\Run->execute() /var/www/html/wp-content/plugins/event-tickets/vendor/symfony/console/Command/Command.php:255 0.1023 8125424 8. Codeception\Command\Run->runSuites() /var/www/html/wp-content/plugins/event-tickets/vendor/codeception/codeception/src/Codeception/Command/Run.php:390 0.1023 8125424 9. Codeception\Codecept->run() /var/www/html/wp-content/plugins/event-tickets/vendor/codeception/codeception/src/Codeception/Command/Run.php:495 0.1081 8131864 10. Codeception\Codecept->runSuite() /var/www/html/wp-content/plugins/event-tickets/vendor/codeception/codeception/src/Codeception/Codecept.php:159 0.1160 8742224 11. Codeception\SuiteManager->initialize() /var/www/html/wp-content/plugins/event-tickets/vendor/codeception/codeception/src/Codeception/Codecept.php:188 0.1607 11636528 12. Codeception\Module\WPLoader->_initialize() /var/www/html/wp-content/plugins/event-tickets/vendor/codeception/codeception/src/Codeception/SuiteManager.php:80 0.1607 11636528 13. Codeception\Module\WPLoader->initialize() /var/www/html/wp-content/plugins/event-tickets/vendor/lucatume/wp-browser/src/Codeception/Module/WPLoader.php:205 0.1638 11831616 14. Codeception\Module\WPLoader->_loadWordpress() /var/www/html/wp-content/plugins/event-tickets/vendor/lucatume/wp-browser/src/Codeception/Module/WPLoader.php:225 0.1655 11941320 15. Codeception\Module\WPLoader->installAndBootstrapInstallation() /var/www/html/wp-content/plugins/event-tickets/vendor/lucatume/wp-browser/src/Codeception/Module/WPLoader.php:316 0.1661 11974992 16. require_once('/var/www/html/wp-content/plugins/event-tickets/vendor/lucatume/wp-browser/src/includes/bootstrap.php') /var/www/html/wp-content/plugins/event-tickets/vendor/lucatume/wp-browser/src/Codeception/Module/WPLoader.php:504 0.4933 12997536 17. require_once('/var/www/html/wp-settings.php') /var/www/html/wp-content/plugins/event-tickets/vendor/lucatume/wp-browser/src/includes/bootstrap.php:162 0.5618 21199048 18. wp_not_installed() /var/www/html/wp-settings.php:161 0.5814 22079608 19. wp_redirect() /var/www/html/wp-includes/load.php:614 0.5823 22079712 20. header() /var/www/html/wp-includes/pluggable.php:1281 Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-content/plugins/event-tickets/tests/_function-mocker-bootstrap.php:41) in /var/www/html/wp-includes/pluggable.php on line 1284 Call Stack: 0.0002 411200 1. {main}() /var/www/html/wp-content/plugins/event-tickets/vendor/codeception/codeception/codecept:0 0.0809 6949168 2. Codeception\Application->run() /var/www/html/wp-content/plugins/event-tickets/vendor/codeception/codeception/codecept:43 0.0809 6949168 3. Codeception\Application->run() /var/www/html/wp-content/plugins/event-tickets/vendor/codeception/codeception/src/Codeception/Application.php:108 0.0862 7166240 4. Codeception\Application->doRun() /var/www/html/wp-content/plugins/event-tickets/vendor/symfony/console/Application.php:148 0.0868 7172240 5. Codeception\Application->doRunCommand() /var/www/html/wp-content/plugins/event-tickets/vendor/symfony/console/Application.php:255 0.0869 7172240 6. Codeception\Command\Run->run() /var/www/html/wp-content/plugins/event-tickets/vendor/symfony/console/Application.php:987 0.0874 7175624 7. Codeception\Command\Run->execute() /var/www/html/wp-content/plugins/event-tickets/vendor/symfony/console/Command/Command.php:255 0.1023 8125424 8. Codeception\Command\Run->runSuites() /var/www/html/wp-content/plugins/event-tickets/vendor/codeception/codeception/src/Codeception/Command/Run.php:390 0.1023 8125424 9. Codeception\Codecept->run() /var/www/html/wp-content/plugins/event-tickets/vendor/codeception/codeception/src/Codeception/Command/Run.php:495 0.1081 8131864 10. Codeception\Codecept->runSuite() /var/www/html/wp-content/plugins/event-tickets/vendor/codeception/codeception/src/Codeception/Codecept.php:159 0.1160 8742224 11. Codeception\SuiteManager->initialize() /var/www/html/wp-content/plugins/event-tickets/vendor/codeception/codeception/src/Codeception/Codecept.php:188 0.1607 11636528 12. Codeception\Module\WPLoader->_initialize() /var/www/html/wp-content/plugins/event-tickets/vendor/codeception/codeception/src/Codeception/SuiteManager.php:80 0.1607 11636528 13. Codeception\Module\WPLoader->initialize() /var/www/html/wp-content/plugins/event-tickets/vendor/lucatume/wp-browser/src/Codeception/Module/WPLoader.php:205 0.1638 11831616 14. Codeception\Module\WPLoader->_loadWordpress() /var/www/html/wp-content/plugins/event-tickets/vendor/lucatume/wp-browser/src/Codeception/Module/WPLoader.php:225 0.1655 11941320 15. Codeception\Module\WPLoader->installAndBootstrapInstallation() /var/www/html/wp-content/plugins/event-tickets/vendor/lucatume/wp-browser/src/Codeception/Module/WPLoader.php:316 0.1661 11974992 16. require_once('/var/www/html/wp-content/plugins/event-tickets/vendor/lucatume/wp-browser/src/includes/bootstrap.php') /var/www/html/wp-content/plugins/event-tickets/vendor/lucatume/wp-browser/src/Codeception/Module/WPLoader.php:504 0.4933 12997536 17. require_once('/var/www/html/wp-settings.php') /var/www/html/wp-content/plugins/event-tickets/vendor/lucatume/wp-browser/src/includes/bootstrap.php:162 0.5618 21199048 18. wp_not_installed() /var/www/html/wp-settings.php:161 0.5814 22079608 19. wp_redirect() /var/www/html/wp-includes/load.php:614 0.5825 22079736 20. header() /var/www/html/wp-includes/pluggable.php:1284 Fatal error: Cannot redeclare wp_kses() (previously declared in /var/www/html/wp-includes/kses.php:731) in /var/www/html/wp-includes/kses.php on line 739 Call Stack: 0.0002 411200 1. {main}() /var/www/html/wp-content/plugins/event-tickets/vendor/codeception/codeception/codecept:0 0.0809 6949168 2. Codeception\Application->run() /var/www/html/wp-content/plugins/event-tickets/vendor/codeception/codeception/codecept:43 0.0809 6949168 3. Codeception\Application->run() /var/www/html/wp-content/plugins/event-tickets/vendor/codeception/codeception/src/Codeception/Application.php:108 0.0862 7166240 4. Codeception\Application->doRun() /var/www/html/wp-content/plugins/event-tickets/vendor/symfony/console/Application.php:148 0.0868 7172240 5. Codeception\Application->doRunCommand() /var/www/html/wp-content/plugins/event-tickets/vendor/symfony/console/Application.php:255 0.0869 7172240 6. Codeception\Command\Run->run() /var/www/html/wp-content/plugins/event-tickets/vendor/symfony/console/Application.php:987 0.0874 7175624 7. Codeception\Command\Run->execute() /var/www/html/wp-content/plugins/event-tickets/vendor/symfony/console/Command/Command.php:255 0.1023 8125424 8. Codeception\Command\Run->runSuites() /var/www/html/wp-content/plugins/event-tickets/vendor/codeception/codeception/src/Codeception/Command/Run.php:390 0.1023 8125424 9. Codeception\Codecept->run() /var/www/html/wp-content/plugins/event-tickets/vendor/codeception/codeception/src/Codeception/Command/Run.php:495 0.1081 8131864 10. Codeception\Codecept->runSuite() /var/www/html/wp-content/plugins/event-tickets/vendor/codeception/codeception/src/Codeception/Codecept.php:159 0.1160 8742224 11. Codeception\SuiteManager->initialize() /var/www/html/wp-content/plugins/event-tickets/vendor/codeception/codeception/src/Codeception/Codecept.php:188 0.1607 11636528 12. Codeception\Module\WPLoader->_initialize() /var/www/html/wp-content/plugins/event-tickets/vendor/codeception/codeception/src/Codeception/SuiteManager.php:80 0.1607 11636528 13. Codeception\Module\WPLoader->initialize() /var/www/html/wp-content/plugins/event-tickets/vendor/lucatume/wp-browser/src/Codeception/Module/WPLoader.php:205 0.1638 11831616 14. Codeception\Module\WPLoader->_loadWordpress() /var/www/html/wp-content/plugins/event-tickets/vendor/lucatume/wp-browser/src/Codeception/Module/WPLoader.php:225 0.1655 11941320 15. Codeception\Module\WPLoader->installAndBootstrapInstallation() /var/www/html/wp-content/plugins/event-tickets/vendor/lucatume/wp-browser/src/Codeception/Module/WPLoader.php:316 0.1661 11974992 16. require_once('/var/www/html/wp-content/plugins/event-tickets/vendor/lucatume/wp-browser/src/includes/bootstrap.php') /var/www/html/wp-content/plugins/event-tickets/vendor/lucatume/wp-browser/src/Codeception/Module/WPLoader.php:504 0.4933 12997536 17. require_once('/var/www/html/wp-settings.php') /var/www/html/wp-content/plugins/event-tickets/vendor/lucatume/wp-browser/src/includes/bootstrap.php:162 WordPress database error Table 'test.test_options' doesn't exist for query SELECT option_value FROM test_options WHERE option_name = 'WPLANG' LIMIT 1 made by Patchwork\CallRerouting\{closure}, ReflectionMethod->invokeArgs, WP_Fatal_Error_Handler->handle, load_default_textdomain, determine_locale, get_locale, get_optionWordPress database error: [Table 'test.test_options' doesn't exist]
SELECT option_value FROM test_options WHERE option_name = 'WPLANG' LIMIT 1
Same command without loading FunctionMocker
``` ➜ event-tickets git:(master) ✗ tric run wpunit tric version 0.0.1 - Modern Tribe local testing and development tool Using event-tickets Starting dev_db_1 ... done Starting dev_chrome_1 ... done Starting dev_wordpress_1 ... done Fixing file ownership issues... fixuid: fixuid should only ever be used on development systems. DO NOT USE IN PRODUCTION fixuid: runtime UID '1000' already matches container user 'docker' UID fixuid: updating group 'docker' to GID '1001 fixuid: recursively searching path /project WordPress db up. Waiting for WordPress site to be available at http://wordpress.test... WordPress available at http://wordpress.test. Waiting 3 seconds... Changing directory to /var/www/html/wp-content/plugins/event-tickets Using project Codeception binary. Codeception PHP Testing Framework v2.5.6 Powered by PHPUnit 6.5.14 by Sebastian Bergmann and contributors. Running with seed: Fatal error: Cannot redeclare wp_kses() (previously declared in /var/www/html/wp-includes/kses.php:731) in /var/www/html/wp-includes/kses.php on line 739 Call Stack: 0.0003 411200 1. {main}() /var/www/html/wp-content/plugins/event-tickets/vendor/codeception/codeception/codecept:0 0.0656 6941560 2. Codeception\Application->run() /var/www/html/wp-content/plugins/event-tickets/vendor/codeception/codeception/codecept:43 0.0656 6941560 3. Codeception\Application->run() /var/www/html/wp-content/plugins/event-tickets/vendor/codeception/codeception/src/Codeception/Application.php:108 0.0708 7158632 4. Codeception\Application->doRun() /var/www/html/wp-content/plugins/event-tickets/vendor/symfony/console/Application.php:148 0.0715 7164632 5. Codeception\Application->doRunCommand() /var/www/html/wp-content/plugins/event-tickets/vendor/symfony/console/Application.php:255 0.0715 7164632 6. Codeception\Command\Run->run() /var/www/html/wp-content/plugins/event-tickets/vendor/symfony/console/Application.php:987 0.0720 7168016 7. Codeception\Command\Run->execute() /var/www/html/wp-content/plugins/event-tickets/vendor/symfony/console/Command/Command.php:255 0.0861 8094240 8. Codeception\Command\Run->runSuites() /var/www/html/wp-content/plugins/event-tickets/vendor/codeception/codeception/src/Codeception/Command/Run.php:390 0.0861 8094240 9. Codeception\Codecept->run() /var/www/html/wp-content/plugins/event-tickets/vendor/codeception/codeception/src/Codeception/Command/Run.php:495 0.0916 8099928 10. Codeception\Codecept->runSuite() /var/www/html/wp-content/plugins/event-tickets/vendor/codeception/codeception/src/Codeception/Codecept.php:159 0.0973 8710288 11. Codeception\SuiteManager->initialize() /var/www/html/wp-content/plugins/event-tickets/vendor/codeception/codeception/src/Codeception/Codecept.php:188 0.0976 8717520 12. Codeception\Module\WPLoader->_initialize() /var/www/html/wp-content/plugins/event-tickets/vendor/codeception/codeception/src/Codeception/SuiteManager.php:80 0.0976 8717520 13. Codeception\Module\WPLoader->initialize() /var/www/html/wp-content/plugins/event-tickets/vendor/lucatume/wp-browser/src/Codeception/Module/WPLoader.php:205 0.0994 8910096 14. Codeception\Module\WPLoader->_loadWordpress() /var/www/html/wp-content/plugins/event-tickets/vendor/lucatume/wp-browser/src/Codeception/Module/WPLoader.php:225 0.1002 8951448 15. Codeception\Module\WPLoader->installAndBootstrapInstallation() /var/www/html/wp-content/plugins/event-tickets/vendor/lucatume/wp-browser/src/Codeception/Module/WPLoader.php:316 0.1005 8984880 16. require_once('/var/www/html/wp-content/plugins/event-tickets/vendor/lucatume/wp-browser/src/includes/bootstrap.php') /var/www/html/wp-content/plugins/event-tickets/vendor/lucatume/wp-browser/src/Codeception/Module/WPLoader.php:504 0.3856 9736664 17. require_once('/var/www/html/wp-settings.php') /var/www/html/wp-content/plugins/event-tickets/vendor/lucatume/wp-browser/src/includes/bootstrap.php:162 WordPress database error Table 'test.test_options' doesn't exist for query SELECT option_value FROM test_options WHERE option_name = 'WPLANG' LIMIT 1 made by WP_Fatal_Error_Handler->handle, load_default_textdomain, determine_locale, get_locale, get_optionWordPress database error: [Table 'test.test_options' doesn't exist]
SELECT option_value FROM test_options WHERE option_name = 'WPLANG' LIMIT 1
4 - Racing conditions between ET and Common
And lastly, I do believe we still face racing conditions between ET and Common, even in tric. This is tricky (pun intended) since it can cause some errors that are really hard to debug. The solution for that was to run
composer install --no-dev
inevent-tickets/common
:composer install --no-dev
``` ➜ common git:(924035ead) ✗ composer install --no-dev in `common` Loading composer repositories with package information Installing dependencies from lock file Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. It is recommended that you run `composer update` or `composer updateIf
common
andET
have different versions for any of this package it would rely on racing conditions to load one or the other because of namespace conflicts in Composer [1], [2], etcWe can either prefix
require-dev
on Common and ET (or Common and TEC, etc), with Mozart or PHP-Scoper, or we can runcomposer install --no-dev
on Common inevent-tickets
andthe-events-calendar
and have a development version of common in a separate directory that won't cause conflicts.Debug information
My system information
``` ➜ event-tickets git:(master) ✗ docker --version Docker version 19.03.8-ce, build afacb8b7f0 ``` ``` ➜ event-tickets git:(master) ✗ id uid=1000(lucas) gid=1001(lucas) groups=1001(lucas),3(sys),90(network),98(power),965(docker),991(lp),998(wheel),1000(autologin) ``` ``` ➜ event-tickets git:(master) ✗ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 744dec9ce6a2 wordpress:5.4.1-apache "docker-entrypoint.s…" About an hour ago Up About an hour 0.0.0.0:8888->80/tcp dev_wordpress_1 fb1a18bec139 selenium/standalone-chrome:3.141.59-oxygen "/opt/bin/entry_poin…" About an hour ago Up About an hour 4444/tcp dev_chrome_1 d9b52bd9511c mariadb "docker-entrypoint.s…" About an hour ago Up About an hour 3306/tcp dev_db_1 bc5bda6f4c89 redis "docker-entrypoint.s…" About an hour ago Up About an hour 0.0.0.0:8379->6379/tcp dev_redis_1 ``` ``` ➜ event-tickets git:(master) ✗ docker exec -it d9b52bd9511c bash root@d9b52bd9511c:/# mariadb -u root -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 39 Server version: 10.4.13-MariaDB-1:10.4.13+maria~bionic mariadb.org binary distribution Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> use test Database changed MariaDB [test]> show tables; Empty set (0.001 sec) MariaDB [test]> ``` ``` ➜ event-tickets git:(master) ✗ inxi -Fxxxza System: Host: lucas-gl502vs Kernel: 5.6.12-1-MANJARO x86_64 bits: 64 compiler: gcc v: 9.3.0 parameters: BOOT_IMAGE=/boot/vmlinuz-5.6-x86_64 root=UUID=a4c38697-f422-447b-9572-597499bf038b rw quiet apparmor=1 security=apparmor udev.log_priority=3 Desktop: KDE Plasma 5.18.5 tk: Qt 5.14.2 wm: kwin_x11 dm: SDDM Distro: Manjaro Linux Machine: Type: Laptop System: ASUSTeK product: GL502VS v: 1.0 serial: