Skip to content

Fix Linux/bash compatibility in sequential tests#12

Open
jnasbyupgrade wants to merge 5 commits intoPostgres-Extensions:masterfrom
jnasbyupgrade:linux-compat
Open

Fix Linux/bash compatibility in sequential tests#12
jnasbyupgrade wants to merge 5 commits intoPostgres-Extensions:masterfrom
jnasbyupgrade:linux-compat

Conversation

@jnasbyupgrade
Copy link
Contributor

Related pgxntool PR: Postgres-Extensions/pgxntool#23

Changes

03-setup-final.bats: portable sed + clean repo state

  • Replace BSD-only sed -i '' with portable sed -i.bak + rm; sed -i '' is valid on GNU sed but has different argument parsing — using -i.bak works on both
  • Commit deps.sql after updating so the repo stays clean on subsequent test runs (eliminates the stale skip "deps.sql already updated")

04-pgtle.bats: portable stat for mtime checks

  • Replace BSD-only stat -f %m (primary) with GNU-first stat -c %Y with BSD fallback
  • Fixes mtime-based rebuild detection tests on Linux

Shebang portability (scripts)

  • Replace #!/bin/bash with #!/usr/bin/env bash in bin/create-worktree.sh and .claude/skills/ scripts

jnasbyupgrade and others added 4 commits March 18, 2026 18:07
Delete `pgxntool-test.source` which was left behind when .source
support was removed in c30cdc5. Remove the "can copy expected output
file to test/output" test from `make-test.bats` that referenced it.

Changes only in pgxntool-test. No related changes in pgxntool.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- `03-setup-final.bats`: replace BSD-only `sed -i ''` with portable
  `sed -i.bak` + `rm`; commit `deps.sql` after updating so repo stays
  clean on subsequent runs (removes stale skip)
- `04-pgtle.bats`: use GNU-first `stat -c %Y` with BSD `stat -f %m`
  fallback for mtime checks

Companion to pgxntool d472ba3

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Avoids hardcoding /bin/bash which breaks on systems where bash lives
elsewhere (some BSDs, NixOS, Homebrew on macOS). Documents the rule
in CLAUDE.md.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant