Run Tests

Run unit, integration, and dump tests for pgschema changes against fixtures.

994|57|Updated Jun 8, 2025
One-click install
npx skills add https://github.com/pgplex/pgschema --skill run-tests-pgplex
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Run Tests
Source: https://github.com/pgplex/pgschema/tree/main/.claude/skills/run_tests
Command: npx skills add https://github.com/pgplex/pgschema --skill run-tests-pgplex

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Running comprehensive tests for pgschema to validate diff logic, plan generation, and dump functionality against test fixtures, ensuring changes are correct before merging.

Core Features & Use Cases

  • Diff Tests (Fast - No Database Required): Validate schema diffs between old and new fixture states using unit-test style checks without a live database.
  • Plan/Apply Integration Tests: Validate end-to-end migration workflows using embedded PostgreSQL to ensure plans are generated and applied correctly.
  • Dump Tests: Validate schema extraction and formatting from live databases through end-to-end dump validation.

Quick Start

Run the provided test commands to execute the pgschema test suite against the included fixtures.

Frequently Asked Questions about Run Tests

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run pgschema tests for diff logic without a live PostgreSQL database?

Execute pgschema diff tests using fixture-based unit-test checks to validate schema diffs without requiring a live database. This fast test suite compares old and new fixture states to ensure your diff logic remains accurate.

How do I validate pgschema plan generation and apply workflows end-to-end?

Validate pgschema plan generation by running plan and apply integration tests using embedded PostgreSQL. These tests execute end-to-end migration workflows against test fixtures to ensure plans are generated and applied correctly.

Does the pgschema test suite support automated dump validation across PostgreSQL versions?

Yes, the pgschema test suite supports automated dump validation across PostgreSQL versions. Dump tests validate schema extraction and formatting from live databases through end-to-end dump validation.

What Go test tooling is needed to execute pgschema integration tests with embedded-postgres?

Executing pgschema integration tests requires Go test tooling and embedded-postgres usage. The suite provides well-scoped test commands, environment variables, and timeout controls to run integration tests against test fixtures.

What are the limitations of using fixture-based expectations for pgschema regression checks?

Fixture-based regression checks for pgschema are limited to the specific diff logic, plan generation, and data dump scenarios defined in the test fixtures. They validate expected states but may not cover unanticipated edge cases outside the provided fixtures.