Skip to content

Conversation

@danolivo
Copy link
Contributor

No description provided.

Previously, Spockbench errors would fail silently because:
1. run-tests.sh had 'set -euo pipefail' commented out
2. check-outputs.sh only validated container exit codes
3. PostgreSQL logs were never checked for errors

This meant the old log_old_value syntax could have been failing
silently without triggering test failures in GitHub Actions.

Changes:

1. run-tests.sh:
   - Uncommented 'set -euo pipefail' to fail fast on errors
   - Now SQL errors will immediately terminate the script

2. check-outputs.sh:
   - Added validation that containers actually exist
   - Added PostgreSQL log error checking
   - Scans pg logs for ERROR entries (excluding benign "relation does not exist")
   - Shows container logs on failure for debugging
   - Provides clear pass/fail feedback

This ensures that:
- SQL syntax errors are caught immediately
- Database errors don't go unnoticed
- Test failures are visible in CI/CD
- Debugging is easier with automatic log output

Now Spockbench will fail until the following commits fix detected issues.
@danolivo danolivo self-assigned this Dec 31, 2025
@danolivo danolivo added the bug Something isn't working label Dec 31, 2025
Collect postgresql.conf, logfile, and docker logs from all containers (n1, n2, n3)
after Spockbench completes. This enables debugging of test failures by providing
access to PostgreSQL configuration and logs.

Artifacts are collected even if tests fail (if: always()) and work with stopped
containers. They are uploaded with 7-day retention for each PostgreSQL version.
@danolivo danolivo force-pushed the claude/research-sugus-candy-BK32l branch from 8db4d9e to fd1d2dc Compare December 31, 2025 14:38
Added 'docker compose build' before 'docker compose up' to ensure
the image is built with the correct configuration.

Also fixed docker-compose.yml build context from '.' to '../..' so
it points to the repository root, matching what the Dockerfile expects
(COPY . /home/pgedge/spock needs repo root as context).

This ensures all three containers (n1, n2, n3) are built with the
correct source code and configuration.
@danolivo danolivo force-pushed the claude/research-sugus-candy-BK32l branch from b3d6db0 to f55ba26 Compare December 31, 2025 15:15
Replace pgedge commands with direct PostgreSQL initialization using settings
from regress-postgresql.conf. This ensures proper pgdata creation and
configuration when the Docker image is used with the default entrypoint.

Changes:
- Use initdb directly instead of pgedge for initialization
- Configure postgresql.conf with all required Spock settings:
  * shared_preload_libraries, wal_level, max_wal_senders
  * max_replication_slots, max_worker_processes
  * track_commit_timestamp, max_locks_per_transaction
- Configure pg_hba.conf for network replication access
- Create database user and database
- Use pg_ctl for start/restart instead of pgedge commands

This initialization only runs when entrypoint.sh is used (spockbench
via docker-compose). Regression and TAP tests override the entrypoint
so they are unaffected.
Created run-spockbench-local.sh to run Spockbench tests locally without
the full CI workflow (no regression/TAP tests).

Features:
- Takes PostgreSQL version as argument (defaults to 17)
- Builds Docker image and containers
- Runs docker compose up to execute tests
- Validates output with check-outputs.sh
- Collects artifacts (logs, configs) to local directory
- Cleans up containers after completion

Usage: ./tests/docker/run-spockbench-local.sh [PGVER]
Example: ./tests/docker/run-spockbench-local.sh 18
@danolivo danolivo force-pushed the claude/research-sugus-candy-BK32l branch from a6fb976 to 2726084 Compare December 31, 2025 16:00
claude and others added 2 commits December 31, 2025 16:01
Changed 'drop extension spock' to 'drop extension if exists spock' to avoid
error when the extension hasn't been created yet during initial setup.

During first run:
- PostgreSQL is initialized without the spock extension
- Then we try to drop it (which fails)
- Then we create it

This fix allows the drop to succeed even if the extension doesn't exist yet.
@danolivo danolivo force-pushed the claude/research-sugus-candy-BK32l branch from 4e9f2dd to 5348366 Compare December 31, 2025 17:28
Defined SPOCK_SOURCE_DIR=/home/pgedge/spock as an environment variable
instead of hardcoding the path throughout the codebase.

Changes:
- Added ENV SPOCK_SOURCE_DIR in Dockerfile-step-1.el9
- Updated COPY, RUN, and WORKDIR to use ${SPOCK_SOURCE_DIR}
- Updated entrypoint.sh to use ${SPOCK_SOURCE_DIR} when accessing spock.h

Benefits:
- Single source of truth for Spock source location
- Easier to change path if needed
- More maintainable code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants