Skip to content

Fix Range/RecordRangeID.String() bugs #833

Fix Range/RecordRangeID.String() bugs

Fix Range/RecordRangeID.String() bugs #833

Workflow file for this run

name: test
on:
push:
tags:
- v*
branches:
- main
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
test:
strategy:
fail-fast: false
matrix:
include:
# v3.0.1 with Go 1.25.0
- surrealdb-version: 'v3.0.1'
go-version: '1.25.0'
connection-type: 'ws'
surrealdb-url: 'ws://localhost:8000/rpc'
- surrealdb-version: 'v3.0.1'
go-version: '1.25.0'
connection-type: 'http'
surrealdb-url: 'http://localhost:8000'
# v2.6.0 with Go 1.25.0, http
- surrealdb-version: 'v2.6.0'
go-version: '1.25.0'
connection-type: 'http'
surrealdb-url: 'http://localhost:8000'
# v2.6.0 with Go 1.25.0, http, fxamackercbor (legacy)
- surrealdb-version: 'v2.6.0'
go-version: '1.25.0'
connection-type: 'http'
surrealdb-url: 'http://localhost:8000'
surrealdb-cbor-impl: 'fxamackercbor'
# v2.6.0 with Go 1.25.0, gorilla/websocket
- surrealdb-version: 'v2.6.0'
go-version: '1.25.0'
connection-type: 'ws'
surrealdb-url: 'ws://localhost:8000/rpc'
# v2.6.0 with Go 1.25.0, gorilla/websocket, fxamackercbor (legacy)
- surrealdb-version: 'v2.6.0'
go-version: '1.25.0'
connection-type: 'ws'
surrealdb-url: 'ws://localhost:8000/rpc'
surrealdb-cbor-impl: 'fxamackercbor'
# v2.6.0 with Go 1.25.0, gorilla/websocket, reconnection
- surrealdb-version: 'v2.6.0'
go-version: '1.25.0'
connection-type: 'ws'
surrealdb-url: 'ws://localhost:8000/rpc'
surrealdb-reconnection-check-interval: '1s'
# v2.6.0 with Go 1.25.0, gws
- surrealdb-version: 'v2.6.0'
go-version: '1.25.0'
connection-type: 'ws'
surrealdb-url: 'ws://localhost:8000/rpc'
surrealdb-connection-impl: 'gws'
# v2.6.0 with Go 1.25.0, gws, reconnection
- surrealdb-version: 'v2.6.0'
go-version: '1.25.0'
connection-type: 'ws'
surrealdb-url: 'ws://localhost:8000/rpc'
surrealdb-connection-impl: 'gws'
surrealdb-reconnection-check-interval: '1s'
# v2.6.0 with Go 1.25.0, explicit surrealcbor
- surrealdb-version: 'v2.6.0'
go-version: '1.25.0'
connection-type: 'ws'
surrealdb-url: 'ws://localhost:8000/rpc'
surrealdb-cbor-impl: 'surrealcbor'
# v2.6.0 with Go 1.24.6
- surrealdb-version: 'v2.6.0'
go-version: '1.24.6'
connection-type: 'ws'
surrealdb-url: 'ws://localhost:8000/rpc'
- surrealdb-version: 'v2.6.0'
go-version: '1.24.6'
connection-type: 'http'
surrealdb-url: 'http://localhost:8000'
permissions:
contents: read
pull-requests: read
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: ${{ matrix.go-version }}
check-latest: true
cache-dependency-path: go.sum
- name: Start SurrealDB
run: |
docker run -d --name surrealdb -p 8000:8000 surrealdb/surrealdb:${{ matrix.surrealdb-version }} start --user root --pass root
# Wait for SurrealDB to be ready
for i in {1..30}; do
if curl -f http://localhost:8000/health 2>/dev/null; then
echo "SurrealDB is ready"
break
fi
echo "Waiting for SurrealDB to start... ($i/30)"
sleep 2
done
- name: Test ${{ matrix.connection-type }} connection
run: go test -v -cover -race ./...
env:
SURREALDB_URL: ${{ matrix.surrealdb-url }}
SURREALDB_CONNECTION_IMPL: ${{ matrix.surrealdb-connection-impl }}
SURREALDB_CBOR_IMPL: ${{ matrix.surrealdb-cbor-impl }}
SURREALDB_RECONNECTION_CHECK_INTERVAL: ${{ matrix.surrealdb-reconnection-check-interval }}
surrealnote-e2e:
name: SurrealNote E2E Tests
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: 'stable'
check-latest: true
cache-dependency-path: contrib/surrealnote/go.sum
# Start SurrealDB
- name: Start SurrealDB
run: |
docker run -d --name surrealdb -p 8000:8000 surrealdb/surrealdb:v2.6.0 start --user root --pass root
# Wait for SurrealDB to be ready
for i in {1..30}; do
if curl -f http://localhost:8000/health 2>/dev/null; then
echo "SurrealDB is ready"
break
fi
echo "Waiting for SurrealDB to start... ($i/30)"
sleep 2
done
# Run E2E migration test using Makefile
- name: Run SurrealNote E2E Migration Test
run: |
cd contrib/surrealnote
# The Makefile will handle PostgreSQL start/stop automatically
go test -v -race -timeout 10m -run TestE2E_migrationFlow ./...
env:
SURREALDB_URL: ws://localhost:8000/rpc
# Clean up containers
- name: Clean up containers
if: always()
run: |
cd contrib/surrealnote
make postgres-remove || true
docker stop surrealdb || true
docker rm surrealdb || true
surrealcbor-timezone:
name: surrealcbor timezone tests (TZ=${{ matrix.timezone }})
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
fail-fast: false
matrix:
timezone: [UTC, Asia/Jerusalem]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: 'stable'
check-latest: true
cache-dependency-path: go.sum
- name: Run datetime decode tests
run: |
go test -v -race ./surrealcbor/... \
-run 'TestDecode_(array|map)_withAllSupportedTypes|TestDecode_map_structwithAllSupportedTypes'
env:
TZ: ${{ matrix.timezone }}