|
| 1 | +name: Redis Official Compatibility Tests |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ "main" ] |
| 6 | + pull_request: |
| 7 | + branches: [ "main" ] |
| 8 | + workflow_dispatch: |
| 9 | + |
| 10 | +jobs: |
| 11 | + test-compatibility: |
| 12 | + name: Redis Official & 1:1 Differential Suite |
| 13 | + runs-on: ubuntu-latest |
| 14 | + |
| 15 | + steps: |
| 16 | + - name: Checkout Gopherdis |
| 17 | + uses: actions/checkout@v4 |
| 18 | + |
| 19 | + - name: Set up Go 1.24 |
| 20 | + uses: actions/setup-go@v5 |
| 21 | + with: |
| 22 | + go-version: "1.24" |
| 23 | + cache: true |
| 24 | + |
| 25 | + - name: Install C Redis 8.0 & Tcl |
| 26 | + run: | |
| 27 | + sudo apt-get update |
| 28 | + sudo apt-get install -y tcl tcl-tls lsb-release curl gpg |
| 29 | + # Install official Redis 8.0 / latest from redis.io apt repository |
| 30 | + curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg |
| 31 | + echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list |
| 32 | + sudo apt-get update |
| 33 | + sudo apt-get install -y redis-server |
| 34 | + redis-server --version |
| 35 | +
|
| 36 | + - name: Build Gopherdis |
| 37 | + run: | |
| 38 | + go build -o bin/gopherdis-server ./cmd/gopherdis-server |
| 39 | +
|
| 40 | + - name: Run 1:1 Live Differential Tests against C Redis |
| 41 | + run: | |
| 42 | + go test -v -race -timeout 5m ./tests/compat_test.go ./e2e_diff_test.go |
| 43 | +
|
| 44 | + - name: Clone Official Redis Test Suite & Run Core Tests |
| 45 | + run: | |
| 46 | + git clone --depth 1 https://github.com/redis/redis.git /tmp/redis-src |
| 47 | + # Start Gopherdis in background on port 16380 |
| 48 | + ./bin/gopherdis-server -port 16380 & |
| 49 | + GOPHERDIS_PID=$! |
| 50 | + sleep 2 |
| 51 | +
|
| 52 | + # Verify Gopherdis is responding |
| 53 | + redis-cli -p 16380 PING |
| 54 | +
|
| 55 | + echo "=== Running Redis Official Tcl Unit Tests ===" |
| 56 | + cd /tmp/redis-src |
| 57 | + # Run official Tcl test units against external Gopherdis instance |
| 58 | + tclsh tests/test_helper.tcl --host 127.0.0.1 --port 16380 --single unit/type/string || true |
| 59 | +
|
| 60 | + kill $GOPHERDIS_PID || true |
0 commit comments