Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unisntall tests failing on multisite #532

Closed
JDGrimes opened this issue Oct 3, 2016 · 3 comments
Closed

Unisntall tests failing on multisite #532

JDGrimes opened this issue Oct 3, 2016 · 3 comments
Assignees
Labels
Milestone

Comments

@JDGrimes
Copy link
Member

JDGrimes commented Oct 3, 2016

As noted in #531, the uninstall tests are failing on multisite. See https://travis-ci.org/WordPoints/wordpoints/jobs/159920235#L466 for example.

Warning: WordPress Database Error: Table 'wordpress_test.wptests_2_posts' doesn't exist [DELETE FROM wptests_2_posts] in /home/travis/build/WordPoints/wordpoints/tests/phpunit/classes/error/handler/database.php on line 51

WordPress database error Table 'wordpress_test.wptests_2_posts' doesn't exist for query DELETE FROM wptests_2_posts made by PHPUnit_TextUI_Command::main, PHPUnit_TextUI_Command->run, PHPUnit_TextUI_TestRunner->doRun, PHPUnit_Framework_TestSuite->run, PHPUnit_Framework_TestSuite->run, call_user_func, WP_UnitTestCase::tearDownAfterClass, _delete_all_data

This may be related to recent changes in WordPress's test suite, like the addition of _delete_all_data(), or it may be partly caused by the new loader introduced as part of WordPoints/dev-lib#161.

@JDGrimes JDGrimes added the bug label Oct 3, 2016
@JDGrimes JDGrimes added this to the 2.2.0 milestone Oct 3, 2016
@JDGrimes JDGrimes self-assigned this Oct 3, 2016
@JDGrimes
Copy link
Member Author

JDGrimes commented Oct 3, 2016

OK, those particular errors are actually not the issue themselves. They only appear because _delete_all_data() expects for the site not to be switched, and it shouldn't be due to tearDown() having run, but somehow it is. The real issue (or the real error that is causing the test to error), is this:

1) WordPoints_Uninstall_Test::test_uninstall
WordPress Database Error: Table 'wordpress_unit_tests.wptests_2_options' doesn't exist [SELECT option_value FROM wptests_2_options WHERE option_name = 'wptests_2_user_roles' LIMIT 1]

/Users/johngrimes/git/wordpoints/tests/phpunit/classes/error/handler/database.php:51
/Users/johngrimes/vagrant/www/wordpress-develop/src/wp-includes/wp-db.php:1360
/Users/johngrimes/vagrant/www/wordpress-develop/src/wp-includes/wp-db.php:1813
/Users/johngrimes/vagrant/www/wordpress-develop/src/wp-includes/wp-db.php:2312
/Users/johngrimes/vagrant/www/wordpress-develop/src/wp-includes/option.php:86
/Users/johngrimes/vagrant/www/wordpress-develop/src/wp-includes/class-wp-roles.php:157
/Users/johngrimes/vagrant/www/wordpress-develop/src/wp-includes/ms-blogs.php:824
/Users/johngrimes/git/wordpoints/src/includes/class-un-installer-base.php:464
/Users/johngrimes/git/wordpoints/src/includes/class-installables.php:148
/Users/johngrimes/git/wordpoints/src/includes/class-un-installer.php:260
/Users/johngrimes/git/wordpoints/src/includes/class-un-installer.php:206
/Users/johngrimes/git/wordpoints/src/includes/class-un-installer-base.php:447
/Users/johngrimes/git/wordpoints/src/includes/class-installables.php:148
/Users/johngrimes/git/wordpoints/src/uninstall.php:23
/Users/johngrimes/vagrant/www/wordpress-develop/src/wp-admin/includes/plugin.php:1014
/Users/johngrimes/git/wordpoints/vendor/jdgrimes/wpppb/src/WPPPB/TestCase/Uninstall.php:196
/Users/johngrimes/git/wordpoints/tests/phpunit/tests/uninstall.php:118

@JDGrimes
Copy link
Member Author

JDGrimes commented Oct 3, 2016

I guess that doesn't change the fact that somewhere along the way we are switching blogs when we shouldn't be.

@JDGrimes
Copy link
Member Author

JDGrimes commented Oct 4, 2016

Well, actually, we don't switch sites when we shouldn't. We switch to the other site when we go to uninstall the first thing that we uninstall (which happens to be the points component), but the tables for that site truly aren't in the database, even though the ste still legitimately exists (that is, it hasn't been uninstalled at some point).

This is caused by WPPPB removing all tables that aren't in the list of WordPress tables for the current site before it installs the plugins. I suppose it just needs to make provision for multisite there and check for tables that belong to other sites beside the current one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant