Skip to content

cicd pipeline for testing code changes #274

Open
0 of 1 issue completed
Open

Description

@kittenkamala

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

Activity

  1. dhruvang21 commented on Jun 30, 2026

    @dhruvang21
    Contributor

    @kittenkamala i have implemented the ci/cd pipeline for the code changes using this PR #325

  2. moved this from Todo to In Progress in Hosting PHPUnit Testson Aug 5, 2026
  3. moved this from In progress to In review in Hosting Team WCUS 2026on Aug 5, 2026
  4. linked a pull request that will close this issueSetup ci/cd for coding standards #325on Aug 5, 2026
  5. moved this from In review to In progress in Hosting Team WCUS 2026on Aug 5, 2026
  6. kittenkamala commented on Aug 5, 2026

    @kittenkamala
    CollaboratorAuthor

    Code tests were implemented in #325

    Next, need to set up containerization and automate an install of the runner, and jobs that trigger prepare.php and test.php scripts to return any errors and other output. I am not sure this could work with a reporter bot relaying data back to test results.

  7. moved this from Done to In Progress in Hosting PHPUnit Testson Aug 5, 2026
  8. dhruvang21 commented on Oct 1, 2026

    @dhruvang21
    Contributor

    @kittenkamala Following up on #325, the next phase is ready in feat/274-containerization:

    Containerized runner

    • docker/Dockerfile builds one image with PHP and the extensions the test suite uses, Composer, Node 24, git, rsync, and SSH. Tests run as a non-root user.
    • compose.yaml pairs it with a throwaway MySQL or MariaDB database. docker compose up runs prepare.php → test.php → report.php → cleanup.php, and cleanup always runs.
    • Each step's log, plus junit.xml, env.json, and a Markdown summary.md, is saved to output/.
    • The new Container Tests workflow runs this on every PR, on PHP 8.3 / MySQL 8.4 and PHP 8.1 / MariaDB 10.6. It shows the summary on the run page and uploads the results as an artifact.

    Reporter bot

    • Container Tests Report posts those summaries as a comment on the PR and updates the same comment on later pushes.
    • It runs from the base repository, so it works for PRs from forks without checking out or running PR code.

    Notes:

    • trunk now needs Node ≥ 24.18.
    • PHP 7.4 can't be containerized because its Debian 11 base no longer gets packages, but phpunit-tests.yml still covers 7.4.
    • 4 Tests_Dependencies_jQuery::test_jquery_files_exist failures show up on every run. They come from prepare.php's build step, not the container, and probably also happen in phpunit-tests.yml, where continue-on-error hides them. I'll open a separate issue.
    • The bot only takes effect once it's on master, so the first real comment will appear on the next PR after merge.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions