| 1 | #!/usr/bin/env bash |
| 2 | set -euo pipefail |
| 3 | |
| 4 | SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" |
| 5 | |
| 6 | # PostgreSQL versions 14-18 with pg_stat_statements (standard) |
| 7 | # Version 13 reached EOL in November 2025 |
| 8 | POSTGRES_VARIANTS=( |
| 9 | "postgres:14|postgres-14|pg_stat_statements" |
| 10 | "postgres:15|postgres-15|pg_stat_statements" |
| 11 | "postgres:16|postgres-16|pg_stat_statements" |
| 12 | "postgres:17|postgres-17|pg_stat_statements" |
| 13 | "postgres:18|postgres-18|pg_stat_statements" |
| 14 | ) |
| 15 | |
| 16 | # pg_stat_monitor variants using Percona distribution |
| 17 | # Note: Percona images include pg_stat_monitor pre-installed |
| 18 | PGSM_VARIANTS=( |
| 19 | "percona/percona-distribution-postgresql:16|percona-pgsm-16|pg_stat_monitor" |
| 20 | "percona/percona-distribution-postgresql:17|percona-pgsm-17|pg_stat_monitor" |
| 21 | ) |
| 22 | |
| 23 | # Run pg_stat_statements tests |
| 24 | for entry in "${POSTGRES_VARIANTS[@]}"; do |
| 25 | IFS='|' read -r image label ext <<< "$entry" |
| 26 | printf '\n=== Running PostgreSQL collector E2E for %s (%s) with %s ===\n' "$label" "$image" "$ext" >&2 |
| 27 | POSTGRES_IMAGE="$image" POSTGRES_VARIANT="$label" POSTGRES_STATS_EXT="$ext" bash "$SCRIPT_DIR/postgres.sh" |
| 28 | done |
| 29 | |
| 30 | # Run pg_stat_monitor tests |
| 31 | for entry in "${PGSM_VARIANTS[@]}"; do |
| 32 | IFS='|' read -r image label ext <<< "$entry" |
| 33 | printf '\n=== Running PostgreSQL collector E2E for %s (%s) with %s ===\n' "$label" "$image" "$ext" >&2 |
| 34 | POSTGRES_IMAGE="$image" POSTGRES_VARIANT="$label" POSTGRES_STATS_EXT="$ext" bash "$SCRIPT_DIR/postgres.sh" |
| 35 | done |
| 36 | |
| 37 | echo "" |
| 38 | echo "=== All PostgreSQL E2E tests passed ===" |
| 39 | echo " - pg_stat_statements: PostgreSQL 14, 15, 16, 17, 18" |
| 40 | echo " - pg_stat_monitor: Percona 16, 17" |