The hostingHostingA web hosting service is a type of Internet hosting service that allows individuals and organizations to make their website accessible via the World Wide Web. team works to improve WordPress’ end-user experience across hosting environments through industry collaboration and user education.
The WordPress HostingHostingA web hosting service is a type of Internet hosting service that allows individuals and organizations to make their website accessible via the World Wide Web. Team provides tools for hosting companies to run the WordPress automated tests on their infrastructure to improve compatibility with WordPress. These results can be published them on the Host Test Result information page, to help WordPress’ compatibility with hosts as well.
It consists of two tools: the Runner is the part that runs coreCoreCore is the set of software required to run WordPress. The Core Team builds WordPress.’s PHPUnit tests on a host and optionally sends the information to the results page; and the Reporter which is the pluginPluginA plugin is a piece of software containing a group of functions that can be added to a WordPress website. They can extend functionality or add new features to your WordPress websites. WordPress plugins are written in the PHP programming language and integrate seamlessly with WordPress. These can be free in the WordPress.org Plugin Directory or can be cost-based plugin from a third-party. that works on the hosting page and shows the results.
A serverServerA server is a piece of computer hardware or software that provides functionality for other programs or devices. Typical servers are database servers, file servers, mail servers, print servers, web servers, game servers, and application servers. / hosting (infrastructure) with the usual configuration you have.
A databaseDatabaseA database is an organized collection of data. Access to this data is usually provided by a "database management system" (DBMS) consisting of an integrated set of computer software that allows users to interact with one or more databases and provides access to all of the data contained in the database. Because of the close relationship between them, the term "database" is often used casually to refer to both a database and the DBMS used to manipulate it. where you can test (it will be created and destroyed several times)
First, download the software. This example use /home/wptestrunner/ folder, but set the best for this environment.
git clone https://github.com/WordPress/phpunit-test-runner.git
The next step will be to configure the environment. To do this, make a copy of the example file and then configure it.
cp .env.default .env
The content (in summary form) can be something like this:
# Path to the directory where files can be prepared before being delivered to the environment.
# Path to the directory where the WordPress develop checkout can be placed and tests can be run. When running tests in the same environment, set WPT_TEST_DIR to WPT_PREPARE_DIR
# API key to authenticate with the reporting service in 'username:password' format. Check the "Creating your bot" section on how to get your authentication.
#export WPT_REPORT_API_KEY=examplehostingcompanybot:XXXX XXXX XXXX XXXX
# (Optionally) define an alternate reporting URL
# Credentials for a database that can be written to and reset. WARNING!!! This database will be destroyed between tests. Only use safe database credentials.
# (Optionally) set a custom table prefix to permit concurrency against the same database.
# (Optionally) define the PHP executable to be called
# (Optionally) define the PHPUnit command execution call. Use if `php phpunit.phar` can't be called directly for some reason.
# (Optionally) define the command execution to remove the test directory. Use if `rm -r` can't be called directly for some reason.
# SSH connection string (can also be an alias). Leave empty if tests are meant to run in the same environment.
# Any options to be passed to the SSH connection. Defaults to '-o StrictHostKeyChecking=no'
# SSH private key, base64 encoded.
# Output logging. Use 'verbose' to increase verbosity
Configure the folder where the WordPress software downloads and the database accesses will be made in order to prepare the tests.
Before performing the first test, let’s update all the components. This process can be run before each test in this environment if wanted to keep it up to date, although it will depend more if it is in a production environment.
Now there is the environment ready, run the test preparation.
The system will run a long series of installations, configurations and compilations of different elements in order to prepare the test. If warnings and warnings come out you should not worry too much, as it is quite normal. At the end of the process it will warn you if it needs something it doesn’t have. If it works, you should see something like this at the end:
Replacing variables in wp-tests-config.php
Success: Prepared environment.
Now that the environment has been prepared, the next step is to run the tests for the first time.
Note: The 4 steps have to be executed every time a test is done. The preparation of the environment as well, even if you do not change the configuration.
Now that the environment is ready, let’s run the tests. To do this, execute the file that will perform it.
What do the symbols mean?
. → Each dot means that the test has been passed correctly.
S → It means the test has been skipped. This is usually because these tests are only valid in certain configurations.
F → Means that the test has failed. Information about why this happened is displayed at the end.
E → It means that the test has failed due to a PHP error, which can be an error, warning or notice.
I → Means that the test has been marked as incomplete.
If you follow these steps, everything should work perfectly and not make any mistakes. In case you get any error, it may be normal due to some missing adjustment or extension of PHP, among others. We recommend that you adjust the configuration until it works correctly. After all, this tool is to help you improve the optimal configuration for WordPress in that infrastructure.
Even if the test has failed, a report will be made. The first one shows the information about our environment. Among the most important elements are the extensions that are commonly used in WordPress and some utilities that are also generally useful.
The content of this file is somewhat similar to this:
In addition to this report, a definitive file with all the information of what happened in the tests. This is the one that includes all the tests that are made (more than 10,000) giving information of the time that they take to be executed, problems that have arisen…
At this point we can generate the reports by sending them to WordPress.org, if necessary. Even if you haven’t included the WordPress user (see below for how to create it), you can still run this file.
Once this first manual test has been done, please automate all these steps in a script, since it is required that each of these steps is executed sequentially for each test execution.
This script should be run every time there is a change / commit in the WordPress master. Many hosting companies use a cron to run the script every few hours / days to make the appropriate checks, or when a change is made.
Do not forget that the aim of this tool is to verify that the environment and infrastructure is the optimal one for WordPress to work, so, following the example, could make several improvements such as installing the extension of bcmath, gd, libsodium, mcrypt, mod_xml and imagick or utilities such as ghostscript and imagemagick.
The goal? To be error free and have the green light for the perfect configuration.
Alert: Some tests may be skipped or there may be tests with some risk. It is normal for errors to occur even with a properly configured environment.
The first thing to do is create a user on WordPress.org. If your company is called ExampleHostingCompany, Inc, for example, call your user something like examplehostingcompanybot. Keep in mind that the associated email account should be checked frequently, as emails will arrive regarding the possible operation of the tests.
Create an issue on the test page asking to include the bot in the results page as a Test Reporter, indicating the email account you used with that user.
The avatar of this user must be your company’s logo, and the name and URL must make clear which company it is./tip]
Note: Someone in the hostingHostingA web hosting service is a type of Internet hosting service that allows individuals and organizations to make their website accessible via the World Wide Web. team will review the request and add a user for you, or request additional information. The team will reply as quickly as possible, but as this step is manual, please be patient.
Once the user has been created in the system, you’ll get an invitation to join via email. Then, you can log into make/hosting and create an Application Password in Users -> Your Profile.
To get things reporting properly, place the username for the bot, along with the application password in the .env file, which will look something like this: export WPT_REPORT_API_KEY='examplehostingcompanybot:ABCD 1234 abcd 4567 EFGH efgh'.