benbalter/wordpress-to-jekyll-exporter

script/cibuild results in require_once(/tmp/wordpress-tests-lib/includes/functions.php): failed to open stream: No such file

Closed this issue · 8 comments

After running script/bootstrap and script/setup successfully I get the following error when running script/cibuild:

Running unit tests...
PHP Warning: require_once(/tmp/wordpress-tests-lib/includes/functions.php): failed to open stream: No such file or directory in /mnt/g/GitHub/linux/wordpress-to-jekyll-exporter/tests/bootstrap.php on line 14
PHP Fatal error: require_once(): Failed opening required '/tmp/wordpress-tests-lib/includes/functions.php' (include_path='.:/usr/share/php') in /mnt/g/GitHub/linux/wordpress-to-jekyll-exporter/tests/bootstrap.php on line 14

When I go to /tmp/wordpress-tests-lib I only see one file: wp-tests-config.php.

Environment: WSL (bash on Windows)

Distributor ID: Ubuntu
Description: Ubuntu 16.04.2 LTS
Release: 16.04
Codename: xenial

Also tried on a pure Ubunto VM (newly created from the Azure gallery), same result:

Distributor ID: Ubuntu
Description: Ubuntu 17.04
Release: 17.04
Codename: zesty

@ohadschn Sorry about that. Is this still occurring for you on master?

I just pulled the latest from master and I'm afraid I'm seeing the same. Any more information I can provide that could help?

Does script/install-wp-tests run as expected? (You may need to delete the wodpress_tests database to force it to reinstall).

As far as I can tell it runs OK:

sudo script/setup
+ install_wp
+ '[' -d /tmp/wordpress/ ']'
+ return
+ install_test_suite
++ uname -s
+ [[ Linux == \D\a\r\w\i\n ]]
+ local ioption=-i
+ '[' '!' -d /tmp/wordpress-tests-lib ']'
+ '[' '!' -f wp-tests-config.php ']'
+ download https://develop.svn.wordpress.org/tags/4.8.1/wp-tests-config-sample.php /tmp/wordpress-tests-lib/wp-tests-config.php
++ which curl
+ '[' /usr/bin/curl ']'
+ curl -s https://develop.svn.wordpress.org/tags/4.8.1/wp-tests-config-sample.php
++ echo /tmp/wordpress/
++ sed 's:/\+$::'
+ WP_CORE_DIR=/tmp/wordpress
+ sed -i 's:dirname( __FILE__ ) . '\''/src/'\'':'\''/tmp/wordpress/'\'':' /tmp/wordpress-tests-lib/wp-tests-config.php
+ sed -i s/youremptytestdbnamehere/wordpress_test/ /tmp/wordpress-tests-lib/wp-tests-config.php
+ sed -i s/yourusernamehere/root/ /tmp/wordpress-tests-lib/wp-tests-config.php
+ sed -i s/yourpasswordhere// /tmp/wordpress-tests-lib/wp-tests-config.php
+ sed -i 's|localhost|localhost|' /tmp/wordpress-tests-lib/wp-tests-config.php
+ install_db
+ '[' false = true ']'
+ PARTS=(${DB_HOST//\:/ })
+ local PARTS
+ local DB_HOSTNAME=localhost
+ local DB_SOCK_OR_PORT=
+ local EXTRA=
+ '[' -z localhost ']'
++ echo
++ grep -e '^[0-9]\{1,\}$'
+ '[' ']'
+ '[' -z ']'
+ '[' -z localhost ']'
+ EXTRA=' --host=localhost --protocol=tcp'
+ mysqladmin create wordpress_test --user=root --password='' --host=localhost --protocol=tcp
mysqladmin: [Warning] Using a password on the command line interface can be insecure.
Changed current directory to /home/ohads/.composer
Using version ^0.13.1 for wp-coding-standards/wpcs
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files
Config value "installed_paths" updated successfully; old value was "/home/ohads/.composer/vendor/wp-coding-standards/wpcs"

If I don't use sudo I get the same with this at the end: Config file /usr/share/php/data/PHP_CodeSniffer/CodeSniffer.conf is not writable.

Odd. Looks like includes should be cloned via https://github.com/benbalter/wordpress-to-jekyll-exporter/blob/master/script/install-wp-tests#L78-L83.

If you delete /tmp/wordpress-tests-lib, it should install, or alternatively, you can run svn co --quiet https://develop.svn.wordpress.org/${WP_TESTS_TAG}/tests/phpunit/includes/ $WP_TESTS_DIR/includes directly to get the includes directory.

Ah, that did the trick. I just opened a pull request with a couple of missing dependencies I had to install to make it work.

BTW, I noticed the following files got modified by these scripts, shouldn't they be in the .gitignore?

vendor/autoload.php
vendor/composer/ClassLoader.php
vendor/composer/LICENSE
vendor/composer/autoload_real.php
vendor/composer/installed.json
stale commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.