diff --git a/README.md b/README.md index c41cc6e..9c7e43b 100644 --- a/README.md +++ b/README.md @@ -203,11 +203,18 @@ pgFirstAid is designed to be lightweight and safe to run on production systems: - Typical execution time: <1 second on most databases - No locking or blocking of user queries +## Testing + +- Query and health-check coverage is validated with pgTAP assertions grouped by severity. +- Integration tests cover live runtime behavior, function/view parity, and checks that need concurrent sessions or timing control. +- A coverage guard ensures every `check_name` in `pgFirstAid.sql` is referenced by at least one pgTAP assertion. +- Managed database validation is exercised through the reusable workflow in `.github/workflows/managed-db-validate.yml`. + ## Compatibility -- **PostgreSQL 10+** - Fully supported, but only testing on 15+. This will change as versions are deprecated +- **PostgreSQL 10+** - Supported, with active automated validation focused on PostgreSQL 15-18 - **PostgreSQL 9.x** - Most features work (minor syntax adjustments may be needed) -- Works with all PostgreSQL-compatible databases (Amazon RDS, Aurora, Azure Database, etc.) +- Works with PostgreSQL-compatible databases, including Amazon RDS, Aurora, Azure Database for PostgreSQL, GCP Cloud SQL, and self-hosted PostgreSQL ## Contributing diff --git a/pgFirstAid.sql b/pgFirstAid.sql index 833a72e..2262943 100644 --- a/pgFirstAid.sql +++ b/pgFirstAid.sql @@ -906,7 +906,7 @@ insert select 'MEDIUM' as severity, 'Table Health' as category, - 'Tables larger than 100GB' as check_name, + 'Tables larger than 50GB' as check_name, ts.table_schema || '"."' || ts.table_name as object_name, 'The following table' as description, ts.size_pretty as current_value, diff --git a/testing/pgTAP/03_high_tests.sql b/testing/pgTAP/03_high_tests.sql index 5664c42..f73e7bc 100644 --- a/testing/pgTAP/03_high_tests.sql +++ b/testing/pgTAP/03_high_tests.sql @@ -1,5 +1,5 @@ BEGIN; -SELECT plan(42); +SELECT plan(44); SELECT ok( (SELECT count(*) >= 0 FROM pg_firstAid() WHERE check_name = 'Current Blocked/Blocking Queries'), @@ -172,6 +172,15 @@ SELECT ok( 'View executes Table with more than 50 columns check' ); +SELECT ok( + (SELECT count(*) >= 0 FROM pg_firstAid() WHERE check_name = 'Tables larger than 50GB'), + 'Function executes Tables larger than 50GB check' +); +SELECT ok( + (SELECT count(*) >= 0 FROM v_pgfirstaid WHERE check_name = 'Tables larger than 50GB'), + 'View executes Tables larger than 50GB check' +); + SELECT ok( (SELECT count(*) >= 0 FROM pg_firstAid() WHERE check_name = 'High Connection Count'), 'Function executes High Connection Count check' diff --git a/view_pgFirstAid.sql b/view_pgFirstAid.sql index c102845..22f9eab 100644 --- a/view_pgFirstAid.sql +++ b/view_pgFirstAid.sql @@ -849,7 +849,7 @@ order by select 'MEDIUM' as severity, 'Table Health' as category, - 'Tables larger than 100GB' as check_name, + 'Tables larger than 50GB' as check_name, ts.table_schema || '"."' || ts.table_name as object_name, 'The following table' as description, ts.size_pretty as current_value, diff --git a/view_pgFirstAid_managed.sql b/view_pgFirstAid_managed.sql index 7807d7f..6b2ff2d 100644 --- a/view_pgFirstAid_managed.sql +++ b/view_pgFirstAid_managed.sql @@ -843,7 +843,7 @@ order by select 'MEDIUM' as severity, 'Table Health' as category, - 'Tables larger than 100GB' as check_name, + 'Tables larger than 50GB' as check_name, ts.table_schema || '"."' || ts.table_name as object_name, 'The following table' as description, ts.size_pretty as current_value,