Skip to content

Verify diagnostic script works #336

Verify diagnostic script works

Verify diagnostic script works #336

Workflow file for this run

# Test diagnostic script from timescaledb-extras works
name: "Verify diagnostic script works"
"on":
schedule:
# run daily 0:00 on main branch
- cron: '0 0 * * *'
pull_request:
workflow_dispatch:
jobs:
diagnostic_test:
name: Test diagnostic script ${{ matrix.image }}
runs-on: ubuntu-latest
services:
ts:
image: timescale/timescaledb:${{ matrix.image }}
ports:
- 5432:5432
env:
POSTGRES_HOST_AUTH_METHOD: trust
POSTGRESQL_PASSWORD: ci
env:
PGHOST: localhost
PGUSER: postgres
PGPASSWORD: ci
strategy:
fail-fast: false
matrix:
image:
- "2.10.0-pg15"
- "2.13.0-pg15"
- "2.17.0-pg15"
- "2.23.0-pg15"
- "latest-pg15"
- "2.13.0-pg16"
- "2.17.0-pg16"
- "2.23.0-pg16"
- "latest-pg16"
- "2.17.0-pg17"
- "2.23.0-pg17"
- "latest-pg17"
- "2.23.0-pg18"
- "latest-pg18"
steps:
- uses: actions/checkout@v6
- name: Wait for services to start
run: |
sleep 10
pg_isready -t 30
- name: Prepare database
run: |
psql -v ON_ERROR_STOP=1 -c "$(cat <<SQL
SELECT version();
SELECT extname, extversion from pg_extension;
SET search_path TO public, _timescaledb_functions, _timescaledb_internal;
SELECT stop_background_workers();
CREATE TABLE t(time timestamptz);
SELECT create_hypertable('t', 'time');
ALTER TABLE t SET (timescaledb.compress, timescaledb.compress_segmentby = 'time');
INSERT INTO t SELECT '2025-01-01';
INSERT INTO t SELECT '2025-02-01';
SELECT compress_chunk(show_chunks('t'));
-- test orphaned chunks
CREATE TABLE _timescaledb_internal.compress_hyper_100_1_chunk();
CREATE TABLE _timescaledb_internal._hyper_100_1_chunk();
SQL
)"
- name: Run diagnostic script
run: |
psql -v ON_ERROR_STOP=1 < diagnostic.sql