Skip to content

ci: add unit test workflow and minimal test bootstrap#57

Merged
DavidLambauer merged 1 commit intomage-os-lab:mainfrom
DavidLambauer:feature/ci-baseline
Apr 19, 2026
Merged

ci: add unit test workflow and minimal test bootstrap#57
DavidLambauer merged 1 commit intomage-os-lab:mainfrom
DavidLambauer:feature/ci-baseline

Conversation

@DavidLambauer
Copy link
Copy Markdown
Contributor

Summary

Extracts the CI infrastructure from #49 onto main so every open PR gets CI coverage immediately, without waiting for the #45 -> #46 -> #49 stack to land.

#49 was merged into #46's branch rather than main, which means the test workflow currently only exists inside the unmerged feature stack. This PR lifts just the infrastructure (workflow + bootstrap + one smoke test) to main so CI runs on everything else in flight: #38, #39, #45, #46, #50, #51, plus my remaining #53, #54, #56.

Credit to @rhoerr for the original CI setup in #49. All the interesting bits are his work.

What's included

  • .github/workflows/unit-tests.yml: PHP 8.2/8.3/8.4 matrix via mage-os/github-actions/unit-test@main
  • Test/Unit/bootstrap.php: Magento FactoryGenerator / ProxyGenerator autoloader for standalone testing
  • phpunit.xml.dist: test runner config
  • Test/Unit/Trait/ProductMockTrait.php: shared product mock helper (only depends on Magento\Catalog\Model\Product)
  • Test/Unit/Model/Product/RequestTest.php: smoke test against the existing Request DTO on main

What's intentionally excluded

Overlap note

composer.json gains explicit magento/framework / magento/module-* deps because the bootstrap needs them. That also resolves #22 and overlaps with @rhoerr's #39, which can be closed in favor of this once merged.

Test plan

  • CI workflow runs green on PHP 8.2, 8.3, 8.4
  • Locally: composer install and vendor/bin/phpunit pass the 3 RequestTest cases

Extract CI infrastructure from mage-os-lab#49 so tests run on main before any feature
PR merges. Feature-specific tests remain with their respective PRs.

- GitHub Actions workflow running PHP 8.2/8.3/8.4 via mage-os/github-actions
- PHPUnit bootstrap using Magento's FactoryGenerator/ProxyGenerator
- phpunit.xml.dist test runner config
- ProductMockTrait for shared product mocking
- RequestTest as a smoke test covering the existing Request DTO
- composer.json: add magento/* framework deps required by the bootstrap
  (also resolves mage-os-lab#22, supersedes mage-os-lab#39)
@DavidLambauer DavidLambauer merged commit 37ac260 into mage-os-lab:main Apr 19, 2026
3 checks passed
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.

Improve composer dependencies

1 participant