Spec: Shipper Test Coverage Initiative
Date: 2026-04-26 Status: Draft
Overview
Shipper has zero meaningful test coverage for its core components: provider managers (34 files), actions (8 files), flows, and value objects. This spec defines the testing strategy and target coverage.
Current State
| Component | Has Tests | Gap |
|---|---|---|
| Config Classes | Partial (ProjectConfigTest.php only) | All other config classes uncovered |
| Config Loader | YES | — |
| Actions | NO | All 8 action files |
| Flows | NO | All deployment flows |
| Provider Managers | NO | All 34 manager files |
| Value Objects | NO | OperationResult, SiteResult, Contexts |
Proposed Coverage Targets
Tier 1 — Critical (must have before any deployment to production)
OperationResultandSiteResultvalue object testsDeploymentContext,ServerContext,SiteContexttestsProviderFactorytest — creates correct provider by nameApplyDeploymentFlowtest — full happy pathDestroyDeploymentFlowtest — full happy pathCreateDeploymentPlanActiontestExecuteDeploymentActiontestValidateProjectActiontest
Tier 2 — Important (regression protection)
SiteManagerInterfaceimplementations (Ploi + Forge)DatabaseManagerInterfaceimplementationsDeployScriptManagerInterfaceimplementationsEnvironmentManagerInterfaceimplementations- All 17 interface contract tests
Tier 3 — Nice to have
- Config classes: ProfileConfig, ShipperConfig, SslConfig, EnvironmentConfig, DatabaseConfig, QueueConfig, CronConfig, RedirectConfig, DaemonConfig, NetworkRuleConfig
GetAllSitesAction,DeleteSiteAction,DestroySiteActionPlanDeploymentFlowCleanupOrphanedSitesFlow
Testing Approach
- Use PHPUnit (already configured)
- Mock provider SDK clients via interface injection
- Use data providers for multi-provider parity (Ploi + Forge)
- Test value objects for all combinations: ok/fail, found/created/new site
Acceptance Criteria
- Tier 1 tests written and passing
- CI pipeline runs tests on every PR
- Code coverage report generated
- Tier 2 tests written (stretch goal)