Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions packages/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,43 @@ cnc kill
cnc kill --no-drop
```

### Testing

#### `cnc test-packages`

Run integration tests on all modules in a workspace. Creates a temporary database for each module, deploys, and optionally runs verify/revert/deploy cycles.

```bash
# Test all modules in workspace (deploy only)
cnc test-packages

# Run full deploy/verify/revert/deploy cycle
cnc test-packages --full-cycle

# Stop on first failure
cnc test-packages --stop-on-fail

# Exclude specific modules
cnc test-packages --exclude my-module,another-module

# Combine options
cnc test-packages --full-cycle --stop-on-fail --exclude legacy-module
```

**Options:**

- `--full-cycle` - Run full deploy/verify/revert/deploy cycle (default: deploy only)
- `--stop-on-fail` - Stop testing immediately when a module fails
- `--exclude <modules>` - Comma-separated module names to exclude
- `--cwd <directory>` - Working directory (default: current directory)

**Notes:**

- Discovers modules from workspace `pgpm.json` configuration
- Creates isolated test databases (`test_<module_name>`) for each module
- Automatically cleans up test databases after each test
- Uses internal APIs for deploy/verify/revert operations

## 💡 Common Workflows

### Starting a New Project
Expand Down
41 changes: 41 additions & 0 deletions pgpm/pgpm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ Here are some useful commands for reference:
- `pgpm plan` - Generate deployment plans for your modules
- `pgpm package` - Package your module for distribution

### Testing

- `pgpm test-packages` - Run integration tests on all modules in a workspace

### Utilities

- `pgpm add` - Add a new database change
Expand Down Expand Up @@ -302,6 +306,43 @@ pgpm kill
pgpm kill --no-drop
```

### Testing

#### `pgpm test-packages`

Run integration tests on all modules in a workspace. Creates a temporary database for each module, deploys, and optionally runs verify/revert/deploy cycles.

```bash
# Test all modules in workspace (deploy only)
pgpm test-packages

# Run full deploy/verify/revert/deploy cycle
pgpm test-packages --full-cycle

# Stop on first failure
pgpm test-packages --stop-on-fail

# Exclude specific modules
pgpm test-packages --exclude my-module,another-module

# Combine options
pgpm test-packages --full-cycle --stop-on-fail --exclude legacy-module
```

**Options:**

- `--full-cycle` - Run full deploy/verify/revert/deploy cycle (default: deploy only)
- `--stop-on-fail` - Stop testing immediately when a module fails
- `--exclude <modules>` - Comma-separated module names to exclude
- `--cwd <directory>` - Working directory (default: current directory)

**Notes:**

- Discovers modules from workspace `pgpm.json` configuration
- Creates isolated test databases (`test_<module_name>`) for each module
- Automatically cleans up test databases after each test
- Uses internal APIs for deploy/verify/revert operations

## ⚙️ Configuration

### Environment Variables
Expand Down
2 changes: 2 additions & 0 deletions pgpm/pgpm/src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import remove from './commands/remove';
import renameCmd from './commands/rename';
import revert from './commands/revert';
import tag from './commands/tag';
import testPackages from './commands/test-packages';
import verify from './commands/verify';
import { extractFirst, usageText } from './utils';
import { cliExitWithError } from './utils/cli-error';
Expand Down Expand Up @@ -62,6 +63,7 @@ export const createPgpmCommandMap = (skipPgTeardown: boolean = false): Record<st
migrate: pgt(migrate),
analyze: pgt(analyze),
rename: pgt(renameCmd),
'test-packages': pgt(testPackages),
cache,
update: updateCmd
};
Expand Down
Loading
Loading