Skip to content

feat: add macOS local test support#1021

Merged
suxb201 merged 1 commit intov4from
add-macos-local-test-support
Feb 28, 2026
Merged

feat: add macOS local test support#1021
suxb201 merged 1 commit intov4from
add-macos-local-test-support

Conversation

@suxb201
Copy link
Member

@suxb201 suxb201 commented Feb 28, 2026

Summary

  • Fix build.sh to use GO_LDFLAGS instead of LDFLAGS to avoid conflicts with Homebrew's environment variables
  • Add test_local.sh for easy local testing on macOS/Linux with Homebrew Redis

Changes

  1. build.sh: Changed LDFLAGS to GO_LDFLAGS to prevent conflicts when user's shell has LDFLAGS set by Homebrew packages (e.g., flex)

  2. test_local.sh: New script for local testing

    • Automatically detects Redis version from PATH
    • Runs tests without modules flag (suitable for Homebrew/system Redis)
    • Supports passing additional arguments to pybbt

Usage

# Install Redis (macOS)
brew install redis

# Run all tests
./test_local.sh

# Run specific test file
./test_local.sh cases/rdb.py

# Run tests matching pattern
./test_local.sh -k "rdb"

Test Results (macOS with Redis 8.2.1)

All 6 tests passed locally:

  • cases/aof.py ✓
  • cases/auth_acl.py ✓
  • cases/rdb.py ✓
  • cases/scan.py ✓
  • cases/sync.py ✓

Test plan

  • Build succeeds on macOS with Homebrew environment
  • All tests pass with Homebrew Redis 8.2.1
  • Tests auto-detect Redis version

🤖 Generated with Claude Code

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1ac4aa6178

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

test_local.sh Outdated
if [ $# -eq 0 ]; then
pybbt cases --verbose
else
pybbt cases --verbose "$@"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Accept a single pybbt target when args are provided

When arguments are passed, this branch still prepends cases, which gives pybbt two positional paths (cases and the user-supplied one). pybbt --help defines only one positional file_or_dir, so ./test_local.sh cases/rdb.py fails with unrecognized arguments instead of running that file as documented. This breaks the new “run specific test file” workflow whenever the user passes a positional target.

Useful? React with 👍 / 👎.

1. Fix build.sh to use GO_LDFLAGS instead of LDFLAGS to avoid conflicts
   with Homebrew's LDFLAGS environment variable (e.g., from flex package)

2. Add test_local.sh for easy local testing on macOS/Linux
   - Automatically detects Redis version from PATH
   - Runs tests without modules flag (suitable for Homebrew Redis)

3. Improve cluster test robustness in tests/helpers/cluster.py
   - Add _wait_cluster_ready() method that verifies writes work on all slots
   - This prevents CLUSTERDOWN errors caused by cluster gossip not fully
     propagating before tests start writing

Usage:
  ./test_local.sh              # Run all tests
  ./test_local.sh cases/rdb.py # Run specific test file

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@suxb201 suxb201 force-pushed the add-macos-local-test-support branch from 1ac4aa6 to 63a27b8 Compare February 28, 2026 03:37
@suxb201 suxb201 merged commit 8817386 into v4 Feb 28, 2026
10 checks passed
@suxb201 suxb201 deleted the add-macos-local-test-support branch February 28, 2026 03:50
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