{"id":19245349,"url":"https://github.com/ionos-wordpress/wp-test-runner","last_synced_at":"2026-02-25T08:34:33.308Z","repository":{"id":66948533,"uuid":"244924907","full_name":"IONOS-WordPress/wp-test-runner","owner":"IONOS-WordPress","description":"WordPress Hosting Test","archived":false,"fork":false,"pushed_at":"2024-07-23T14:17:16.000Z","size":158,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-01T12:49:25.695Z","etag":null,"topics":["php","test","testing","wordpress"],"latest_commit_sha":null,"homepage":"https://make.wordpress.org/hosting/test-results/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/IONOS-WordPress.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-04T14:42:51.000Z","updated_at":"2024-07-23T14:17:09.000Z","dependencies_parsed_at":"2024-06-13T12:29:16.303Z","dependency_job_id":"1604d43a-08cc-4920-954d-f7fd6bc03629","html_url":"https://github.com/IONOS-WordPress/wp-test-runner","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IONOS-WordPress%2Fwp-test-runner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IONOS-WordPress%2Fwp-test-runner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IONOS-WordPress%2Fwp-test-runner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IONOS-WordPress%2Fwp-test-runner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IONOS-WordPress","download_url":"https://codeload.github.com/IONOS-WordPress/wp-test-runner/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250040427,"owners_count":21365103,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["php","test","testing","wordpress"],"created_at":"2024-11-09T17:27:31.609Z","updated_at":"2026-02-25T08:34:28.275Z","avatar_url":"https://github.com/IONOS-WordPress.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# phpunit-test-runner\n\nThanks for running the WordPress PHPUnit test suite on your infrastructure. We appreciate you helping to ensure WordPress’s compatibility for your users.\n\nIf you haven't already, [please first read through the \"Getting Started\" documentation](https://make.wordpress.org/hosting/test-results-getting-started/).\n\nThe test suite runner is designed to be used without any file modification. Configuration happens with a series of environment variables (see [.env.default](.env.default) for an annotated overview). Use the [repository wiki](../../wiki) to document implementation details, to avoid README conflicts with the upstream.\n\nAt a high level, the test suite runner:\n\n1. Prepares the test environment for the test suite.\n2. Runs the PHPUnit tests in the test environment.\n3. Reports the PHPUnit test results to WordPress.org\n4. Cleans up the test suite environment.\n\n## Configuring\n\nThe test suite runner can be used in one of two ways:\n\n1. With Travis (or Circle or some other CI service) as the controller that connects to the remote test environment.\n2. With the runner cloned to and run directly within the test environment.\n\nThe test runner is configured through environment variables, documented in [`.env.default`](.env.default). It shouldn't need any code modifications; in fact, please refrain from editing the scripts entirely, as it will make it easier to stay up to date.\n\nWith a direct Git clone, you can:\n\n    # Copy the default .env file.\n    cp .env.default .env\n    # Edit the .env file to define your variables.\n    vim .env\n    # Load your variables into scope.\n    source .env\n\nIn a CI service, you can set these environment variables through the service's web console. Importantly, the `WPT_SSH_CONNECT` environment variable determines whether the test suite is run locally or against a remote environment.\n\nConcurrently run tests in the same environment by appending build ids to the test directory and table prefix:\n\n    export WPT_TEST_DIR=wp-test-runner-$TRAVIS_BUILD_NUMBER\n    export WPT_TABLE_PREFIX=wptests_$TRAVIS_BUILD_NUMBER\\_\n\nConnect to a remote environment over SSH by having the CI job provision the SSH key:\n\n    # 1. Create a SSH key pair for the controller to use\n    ssh-keygen -t rsa -b 4096 -C \"travis@travis-ci.org\"\n    # 2. base64 encode the private key for use with the environment variable\n    cat ~/.ssh/id_rsa | base64 --wrap=0\n    # 3. Append id_rsa.pub to authorized_keys so the CI service can SSH in\n    cat ~/.ssh/id_rsa.pub \u003e\u003e ~/.ssh/authorized_keys\n\nUse a more complex SSH connection process by creating a SSH alias:\n\n    # 1. Add the following to ~/.ssh/config to create a 'wpt' alias\n    Host wpt\n      Hostname 123.45.67.89\n      User wpt\n      Port 1234\n    # 2. Use 'wpt' wherever you might normally use a SSH connection string\n    ssh wpt\n\n## Running\n\nThe test suite runner is run in four steps.\n\n### 0. Requirements\n\nBoth the prep and test environments must meet some basic requirements.\n\nPrep environment:\n\n* PHP 5.6 or greater (to run scripts).\n* Utilities: `git` version 1.8.5 or greater, `rsync`, `wget`, `unzip`.\n* Node.js including `npm` and `grunt` packages\n\nTest environment:\n\n* PHP 5.6 or greater with Phar support enabled (for PHPUnit).\n* MySQL or MariaDB with access to a writable database.\n* Writable filesystem for the entire test directory (see [#40910](https://core.trac.wordpress.org/ticket/40910)).\n* Run with a non-root user, both for security and practical purposes (see [#44233](https://core.trac.wordpress.org/ticket/44233#comment:34)/[#46577](https://core.trac.wordpress.org/ticket/46577)).\n\n### 1. Prepare\n\nThe [`prepare.php`](prepare.php) step:\n\n1. Extracts the base64-encoded SSH private key, if necessary.\n2. Clones the master branch of the WordPress develop git repo into the preparation directory.\n3. Downloads `phpunit.phar` to the preparation directory.\n4. Generates `wp-tests-config.php` and puts it into the preparation directory.\n5. Delivers the prepared test directory to the test environment.\n\n### 2. Test\n\nThe [`test.php`](test.php) step:\n\n1. Calls `php phpunit.phar` to produce `tests/phpunit/build/logs/junit.xml`.\n\n### 3. Report\n\nThe [`report.php`](report.php) step:\n\n1. Processes PHPUnit XML log into a JSON blob.\n2. Sends the JSON to WordPress.org.\n\n### 4. Cleanup\n\nThe [`cleanup.php`](cleanup.php) step:\n\n1. Resets the database.\n2. Deletes all files delivered to the test environment.\n\n## Contributing\n\ntk\n\n## License\n\nSee [LICENSE](LICENSE) for project license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fionos-wordpress%2Fwp-test-runner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fionos-wordpress%2Fwp-test-runner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fionos-wordpress%2Fwp-test-runner/lists"}