{"id":240,"date":"2017-08-24T20:55:18","date_gmt":"2017-08-24T20:55:18","guid":{"rendered":"https:\/\/make.wordpress.org\/hosting\/?page_id=240"},"modified":"2022-05-03T22:41:49","modified_gmt":"2022-05-03T22:41:49","slug":"test-results-getting-started","status":"publish","type":"page","link":"https:\/\/make.wordpress.org\/hosting\/test-results-getting-started\/","title":{"rendered":"Getting Started with Distributed Hosting Tests"},"content":{"rendered":"<p>The idea behind the <a href=\"https:\/\/make.wordpress.org\/hosting\/test-results\/\">distributed hosting tests<\/a> is to run WordPress\u2019 automated test suite across a variety of <span tabindex='0' class='glossary-item-container'>hosting<span class='glossary-item-hidden-content'><span class='glossary-item-header'>Hosting<\/span> <span class='glossary-item-description'>A 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.<\/span><\/span><\/span> environments, to help verify that changes in WordPress don\u2019t unintentionally affect hosts, and to help hosts be aware of how changes in WordPress or their environments affect how WordPress runs on their services.<\/p>\n<p>Hosts that report receive automated emails when the tests are passing on <span tabindex='0' class='glossary-item-container'>WordPress.org<span class='glossary-item-hidden-content'><span class='glossary-item-header'>WordPress.org<\/span> <span class='glossary-item-description'>The community site where WordPress code is created and shared by the users. This is where you can download the source code for WordPress core, plugins and themes as well as the central location for community conversations and organization.  <a href=\"https:\/\/wordpress.org\/\">https:\/\/wordpress.org\/<\/a><\/span><\/span><\/span>, but failing on their environment so that they can investigate.<\/p>\n<p>Want to run the WordPress PHPUnit test suite on your own hosting infrastructure? Thank you; we look forward to <a href=\"https:\/\/make.wordpress.org\/hosting\/test-results\/\">seeing your results reported<\/a>!<\/p>\n<p>If you have questions about the process or run into test failures along the way, please <a href=\"https:\/\/github.com\/wordpress\/phpunit-test-runner\/issues\">open an issue in the project repository<\/a>\u00a0and we\u2019ll help diagnose\/get the documentation updated. Alternatively, you can also pop into the <code>#hosting-community<\/code>\u00a0channel on <a href=\"https:\/\/make.wordpress.org\/chat\/\">WordPress.org Slack<\/a> for help.<\/p>\n<h2>Setting Up<\/h2>\n<p>There are two primary steps in the setup process.<\/p>\n<p>First, you\u2019ll need to <a href=\"https:\/\/github.com\/wordpress\/phpunit-test-runner\">configure the phpunit-test-runner<\/a> to run in a representative <span tabindex='0' class='glossary-item-container'>server<span class='glossary-item-hidden-content'><span class='glossary-item-header'>Server<\/span> <span class='glossary-item-description'>A 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.<\/span><\/span><\/span> environment. <a href=\"https:\/\/github.com\/WordPress\/phpunit-test-runner\/blob\/master\/README.md\">Read through the GitHub README<\/a> for full configuration details. Notably:<\/p>\n<ul>\n<li>The test runner can be driven from Travis CI or a <span tabindex='0' class='glossary-item-container'>cron<span class='glossary-item-hidden-content'><span class='glossary-item-header'>Cron<\/span> <span class='glossary-item-description'>Is a time-based job scheduler in Unix. Users that set up and maintain software environments use cron to schedule jobs to run periodically at fixed times, dates, or intervals.<\/span><\/span><\/span> job on the machine itself.\n<ul>\n<li>Eventually, we\u2019d like to trigger the test runner for every commit. At this time, running it every 3-6 hours should be sufficient.<\/li>\n<\/ul>\n<\/li>\n<li>There are a variety of environment variables you can set to control the test runner\u2019s behavior.<\/li>\n<\/ul>\n<p>Second, once the test runner is passing all tests in your server environment, you can begin reporting results to WordPress.org. To do so:<\/p>\n<ol>\n<li>Create a bot WordPress.org account. If your company is Wonderful Hosting, Inc., this bot account username might be <code>wonderfulbot<\/code>. Make sure to set its email address to something monitored by a human \u2014 we\u2019ll send an email when there\u2019s a test failure. Please add a <span tabindex='0' class='glossary-item-container'>Gravatar<span class='glossary-item-hidden-content'><span class='glossary-item-header'>Gravatar<\/span> <span class='glossary-item-description'>Is an acronym for Globally Recognized Avatar. It is the avatar system managed by WordPress.com, and used within the WordPress software.\r<a href=\"https:\/\/gravatar.com\/\">https:\/\/gravatar.com<\/a><\/span><\/span><\/span>\/logo and <span tabindex='0' class='glossary-item-container'>URL<span class='glossary-item-hidden-content'><span class='glossary-item-header'>URL<\/span> <span class='glossary-item-description'>A specific web address of a website or web page on the Internet, such as a website\u2019s URL www.wordpress.org<\/span><\/span><\/span> to the profile as well, to make it clear to users what hosting company is being represented <a href=\"https:\/\/make.wordpress.org\/hosting\/test-results\/\">in the results<\/a>.<\/li>\n<li><a href=\"https:\/\/github.com\/WordPress\/phpunit-test-runner\/issues\/new\">Create a new issue<\/a> in the phpunit-test-runner <span tabindex='0' class='glossary-item-container'>GitHub<span class='glossary-item-hidden-content'><span class='glossary-item-header'>GitHub<\/span> <span class='glossary-item-description'>GitHub is a website that offers online implementation of git repositories that can can easily be shared, copied and modified by other developers. Public repositories are free to host, private repositories require a paid subscription. GitHub introduced the concept of the \u2018pull request\u2019 where code changes done in branches by contributors can be reviewed and discussed before being merged be the repository owner.<\/span><\/span><\/span> repo requesting your bot user to be added to this WordPress.org site as a \u201cTest Reporter\u201d. We\u2019ll need the email address associated with the user in order to add them. Under the hood, we\u2019re using a <span tabindex='0' class='glossary-item-container'>custom post type<span class='glossary-item-hidden-content'><span class='glossary-item-header'>Custom Post Type<\/span> <span class='glossary-item-description'>WordPress can hold and display many different types of content. A single item of such a content is generally called a post, although post is also a specific post type. Custom Post Types gives your site the ability to have templated posts, to simplify the concept.<\/span><\/span><\/span> to log and display test results.<\/li>\n<li>After your bot user has been added to this WordPress.org site, you\u2019ll be able to create an application password for your test runner. Sign into your <a href=\"https:\/\/make.wordpress.org\/hosting\/wp-admin\/profile.php\">Make WordPress.org Admin site<\/a> under Users -&gt; Your Profile to generate the application password. Then, set the application password as an environment variable: <code>export WPT_REPORT_API_KEY='wonderfulbot:Osho NHgM xYSY UWF9 qNUn YdjV'<\/code>. Replace the characters after the colon with the application password for your bot user.<\/li>\n<\/ol>\n<p>If all goes well, you\u2019ll see your test results submitted at the end of <code>php report.php<\/code>:<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"244\" data-permalink=\"https:\/\/make.wordpress.org\/hosting\/test-results-getting-started\/2017-08-24-at-2-25-pm\/#main\" data-orig-file=\"https:\/\/i0.wp.com\/make.wordpress.org\/hosting\/files\/2017\/08\/2017-08-24-at-2.25-PM.png?fit=913%2C279&amp;ssl=1\" data-orig-size=\"913,279\" data-comments-opened=\"1\" data-image-meta='{\"aperture\":\"0\",\"credit\":\"\",\"camera\":\"\",\"caption\":\"\",\"created_timestamp\":\"0\",\"copyright\":\"\",\"focal_length\":\"0\",\"iso\":\"0\",\"shutter_speed\":\"0\",\"title\":\"\",\"orientation\":\"0\"}' data-image-title=\"2017-08-24 at 2.25 PM\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/make.wordpress.org\/hosting\/files\/2017\/08\/2017-08-24-at-2.25-PM.png?fit=300%2C92&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/make.wordpress.org\/hosting\/files\/2017\/08\/2017-08-24-at-2.25-PM.png?fit=776%2C237&amp;ssl=1\" class=\"alignnone size-full wp-image-244\" src=\"https:\/\/i0.wp.com\/make.wordpress.org\/hosting\/files\/2017\/08\/2017-08-24-at-2.25-PM.png?resize=776%2C237&#038;ssl=1\" alt=\"\" width=\"776\" height=\"237\" srcset=\"https:\/\/i0.wp.com\/make.wordpress.org\/hosting\/files\/2017\/08\/2017-08-24-at-2.25-PM.png?w=913&amp;ssl=1 913w, https:\/\/i0.wp.com\/make.wordpress.org\/hosting\/files\/2017\/08\/2017-08-24-at-2.25-PM.png?resize=300%2C92&amp;ssl=1 300w, https:\/\/i0.wp.com\/make.wordpress.org\/hosting\/files\/2017\/08\/2017-08-24-at-2.25-PM.png?resize=768%2C235&amp;ssl=1 768w\" sizes=\"auto, (max-width: 776px) 100vw, 776px\"><\/p>\n<p>The last line indicates your results have been successfully uploaded to the reporter website.<\/p>\n<nav class='o2-post-footer-actions'><ul class='o2-post-footer-action-row'><\/ul><div class='o2-post-footer-action-likes'><\/div><ul class='o2-post-footer-action-row'><\/ul><\/nav>","protected":false},"excerpt":{"rendered":"<p>The idea behind the distributed hosting tests is to run WordPress\u2019 automated test suite across a variety of hostingHosting A 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. environments, to help verify that changes in WordPress don\u2019t unintentionally [&hellip;]<\/p>\n","protected":false},"author":183657,"featured_media":0,"parent":0,"menu_order":16,"comment_status":"closed","ping_status":"closed","template":"","meta":{"jetpack_post_was_ever_published":false,"footnotes":""},"class_list":["post-240","page","type-page","status-publish","hentry","author-danielbachhuber"],"revision_note":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/P8aY12-3S","jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/make.wordpress.org\/hosting\/wp-json\/wp\/v2\/pages\/240","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/make.wordpress.org\/hosting\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/make.wordpress.org\/hosting\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/make.wordpress.org\/hosting\/wp-json\/wp\/v2\/users\/183657"}],"replies":[{"embeddable":true,"href":"https:\/\/make.wordpress.org\/hosting\/wp-json\/wp\/v2\/comments?post=240"}],"version-history":[{"count":20,"href":"https:\/\/make.wordpress.org\/hosting\/wp-json\/wp\/v2\/pages\/240\/revisions"}],"predecessor-version":[{"id":72307,"href":"https:\/\/make.wordpress.org\/hosting\/wp-json\/wp\/v2\/pages\/240\/revisions\/72307"}],"wp:attachment":[{"href":"https:\/\/make.wordpress.org\/hosting\/wp-json\/wp\/v2\/media?parent=240"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}