-
Notifications
You must be signed in to change notification settings - Fork 765
Expand file tree
/
Copy pathtest_local.sh
More file actions
executable file
·39 lines (31 loc) · 1.05 KB
/
test_local.sh
File metadata and controls
executable file
·39 lines (31 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
# Local test script for macOS/Linux
# Usage: ./test_local.sh [file_or_dir] [pybbt_args...]
# Examples:
# ./test_local.sh # Run all tests
# ./test_local.sh cases/rdb.py # Run specific test file
set -e
echo "=== Building redis-shake ==="
sh build.sh
echo ""
echo "=== Running unit tests ==="
go test ./... -v
echo ""
echo "=== Running black box tests ==="
cd tests/
# Check if redis-server is available
if ! command -v redis-server &> /dev/null; then
echo "Error: redis-server not found in PATH"
echo "Install with: brew install redis (macOS) or apt install redis (Linux)"
exit 1
fi
# Show Redis version
REDIS_VERSION=$(redis-server --version 2>&1 | head -1)
echo "Redis server: $REDIS_VERSION"
# Run tests without modules flag (suitable for Homebrew/system Redis)
# Default to running all cases if no argument provided
TEST_TARGET="${1:-cases}"
shift 2>/dev/null || true
# Use local pybbt module (must set PYTHONPATH before running)
export PYTHONPATH="$(pwd):$PYTHONPATH"
python -m pybbt "$TEST_TARGET" --verbose "$@"