Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#50671 closed defect (bug) (fixed)

REST API plugins endpoint create item tests don't work in all environments

Reported by: timothyblynjacobs's profile TimothyBlynJacobs Owned by: timothyblynjacobs's profile TimothyBlynJacobs
Milestone: 5.5 Priority: normal
Severity: normal Version: 5.5
Component: REST API Keywords:
Focuses: rest-api Cc:

Description

A couple of hosts that are running the WordPress test suite reporter are encountering issues with the create_item tests for the new plugins endpoint introduced in [48242]. See wordpress/phpunit-test-reporter#83 for details.

WP_REST_Plugins_Controller_Test::test_create_item
unlink(/var/www/vhosts/wp-test-runner/tests/phpunit/includes/../data/link-manager.zip): No such file or directory
WP_REST_Plugins_Controller_Test::test_create_item_and_activate
unlink(/var/www/vhosts/wp-test-runner/tests/phpunit/includes/../data/link-manager.zip): No such file or directory
WP_REST_Plugins_Controller_Test::test_create_item_and_activate_errors_if_no_permission_to_activate_plugin

I believe this is due to the language pack upgrader running after the plugin has been installed. We should make the package override more specific and possibly unhook the language upgrader async check entirely.

Attachments (1)

50671.diff (820 bytes) - added by TimothyBlynJacobs 4 years ago.

Download all attachments as: .zip

Change History (6)

This ticket was mentioned in Slack in #hosting-community by jadonn. View the logs.


4 years ago

This ticket was mentioned in Slack in #core-restapi by timothybjacobs. View the logs.


4 years ago

This ticket was mentioned in Slack in #hosting-community by timothybjacobs. View the logs.


4 years ago

#4 @TimothyBlynJacobs
4 years ago

  • Owner set to TimothyBlynJacobs
  • Resolution set to fixed
  • Status changed from new to closed

In 48524:

REST API: Make plugin installation tests more robust on alternate test environments.

The REST API plugin installation tests use the upgrader_pre_download filter to avoid downloading the test plugin from WordPress.org. Previously, this would apply to any upgrader, which caused issues if the testing environment required a language update.

Now, the filter only overwrites the file if the Plugin_Upgrader is being used which should hopefully prevent the issue.

Props pfefferle, TimothyBlynJacobs.
Fixes #50671.

This ticket was mentioned in Slack in #hosting-community by amykamala. View the logs.


4 years ago

Note: See TracTickets for help on using tickets.