Skip to content

Add PHPUnit test execution and Composer package management#2325

Merged
hiroshinishio merged 1 commit intomainfrom
wes
Feb 25, 2026
Merged

Add PHPUnit test execution and Composer package management#2325
hiroshinishio merged 1 commit intomainfrom
wes

Conversation

@hiroshinishio
Copy link
Collaborator

Summary

  • PHPUnit test runner: Runs PHPUnit tests during verify_task_is_complete and verify_task_is_ready, catching test failures before pushing. Suppresses PHP deprecation warnings for older codebases running on PHP 8.x.
  • Composer package management: Detects composer.json/composer.lock, triggers CodeBuild to install dependencies, caches vendor.tar.gz on EFS alongside node_modules.tar.gz.
  • Config template copying: Automatically copies .default/.example/.sample config templates (e.g., preference.inc.defaultpreference.inc) during repo preparation, preventing test failures on fresh clones.
  • Infrastructure: PHP CLI + Composer added to Lambda Docker image and CodeBuild buildspec with conditional handling for composer vs npm/yarn/pnpm.
  • Refactored: Inlined reuse-check logic in both ensure_node_packages and ensure_php_packages, removed unnecessary double-checked locking pattern.

Social Media Post (GitAuto)

GitAuto can now run PHPUnit tests before pushing code. PHP projects had no test execution support - the agent would generate changes, push, then CI would fail, requiring another iteration. Now it detects vendor/bin/phpunit, runs tests locally, and fixes failures before they reach CI. Same pattern we use for Jest, extended to PHP with Composer dependency management via CodeBuild.

Social Media Post (Wes)

Took the Jest test runner pattern we already had and extended it to PHP. The frustrating part wasn't the runner itself - it was discovering that every fresh clone of our customer's PHP repo failed tests because a config template (preference.inc.default) needed to be copied first. Turns out this .default/.example/.sample pattern is everywhere across ecosystems. Built a generic copier that handles it for all projects now.

…ojects

PHP projects like SpiderPlus had no test execution support - the agent couldn't catch
PHPUnit test failures before pushing, leading to CI failures requiring extra iterations.
This adds the full PHP test pipeline following the same pattern as Jest/Node.

Key changes:
- PHPUnit test runner (run_phpunit_test.py) with deprecation warning suppression
- Composer package management via CodeBuild (ensure_php_packages.py)
- vendor.tar.gz extraction alongside node_modules.tar.gz
- Config template copying (.default/.example/.sample -> target) in prepare_repo_for_work
- PHP CLI + Composer added to Lambda Docker image and CodeBuild buildspec
- Inline reuse-check logic in both ensure_node_packages and ensure_php_packages
- Integration into verify_task_is_complete and verify_task_is_ready
@hiroshinishio hiroshinishio self-assigned this Feb 25, 2026
@hiroshinishio hiroshinishio merged commit 6540aa8 into main Feb 25, 2026
1 check passed
@hiroshinishio hiroshinishio deleted the wes branch February 25, 2026 22:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant