feat(pgpm): add test-packages command for integration testing #450
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
feat(pgpm): add test-packages command for integration testing
Summary
Adds a new
pgpm test-packagesCLI command that abstracts the integration deploy testing scripts frompgpm-modulesandconstructive-dbinto a reusable command in the constructive repo. This addresses constructive-io/projects-issues#375.The command discovers all PGPM modules in a workspace and runs integration tests on each by creating a temporary database, deploying, and optionally running verify/revert/deploy cycles.
Key features:
--exclude- Module names to exclude from testing--stop-on-fail- Stop on first failure vs collect all failures--full-cycle- Run full deploy/verify/revert/deploy cycle (default: deploy only)--cwd- Working directory (default: current directory)Implementation approach:
PgpmPackage.getModules()for module discovery (reads from workspacepgpm.jsonconfig)PgpmPackage.deploy(),verify(),revert()methods directly instead of spawning CLI subprocessespg-cachefor database creation/dropping (no shell commands)Updates since last revision
test-packagescommand to both CLI packages:pgpm/pgpm/README.md(pgpm CLI)packages/cli/README.md(@constructive-io/cli which inherits pgpm commands viacnc/constructive)Review & Testing Checklist for Human
pgpm test-packagesinconstructive-dbto verify it discovers and tests modules correctlyPgpmPackage.getModules()returns the same modules that the oldscripts/test-all-packages.jswould find (check ifpgpm.jsonpackages globs cover all expected directories)CREATE DATABASE/DROP DATABASEmay require different privileges than the oldcreatedb/dropdbapproach--full-cyclebehavior: Test that verify/revert/deploy cycle works correctly with the internal APIsRecommended test plan:
Notes