WordPress / WordPress/phpunit-test-runner

cicd pipeline for testing code changes

Open
#274 3 comments 0 reactions 0 assignees View on GitHub

A pull request for this has already been merged.

  • #325 by @dhruvang21 — merged
enhancement help wanted tooling WCUS26
Dominant language
PHP
Stars
77
Forks
77
Avg merge
15d 15h
Merged PRs (30d)
4

Description

The runner needs a cicd pipeline for testing new pushes/PRs against coding standards, with a container for database builds that mimic a hosting environment, and automation that triggers prepare.php and test.php scripts to return any errors and other output- preferably with a Hosting Team reporting bot relaying data.

Tech specs

Keeping in line with Core standards - this should be built out using GitHub workflows/ actions runner image and Docker containerization for database testing, with phpcs, wpcs coding standard tests and automated triggering of runner scripts. Ideally a Hosting Team reporting bot would post results on PRs. The process of implementing this can be done iteratively.

First Runner code testing can be put in place, then automation triggering environment tests to simulate what happens in a hosting environment, and lastly a bot to report back any errors in PR comments. Then rinse and repeat for the reporter.

Which repos?
PHPunit Test Runner - to start, and as the highest priority
PHPunit Test Reporter - next priority although there is not much development happening here.

Examples:
https://github.com/WordPress/wordpress-develop

GitHub Workflows

Pipeline References:
Docker-compose.yml

Coding standards yml

codesniffer, wpcs

phpcs

Use Cases

Runner Issue #212 : Code here switches to using short array syntax ( $var = [] vs. $var = array() ). The former is eprohibited in wp coding standards. Tests would catch that and prompt a fix.

Runner issue #271: Incorrect syntax was not caught by humans and resulted in a parse error on host test environments

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the existing workflows in WordPress/wordpress-develop and the linked Docker Compose and coding-standards references. Inspect the PHPunit Test Runner entry points, including prepare.php and test.php, and review issue #325 for prior implementation context. Done means the staged workflow runs coding standards, database-backed environment tests, and reports errors as defined by the repository.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, docker-compose, github-actions, php
Domain
ci-cd, databases, devops, testing-qa
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.