Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
dac721e
chore: router ci improvement
miklosbarabas Sep 22, 2025
f38b748
Merge branch 'main' into miklos/eng-8201-chore-router-ci-improvements
miklosbarabas Sep 22, 2025
cfb3597
chore: router ci improvement
miklosbarabas Sep 22, 2025
61f6f77
chore: router ci improvement
miklosbarabas Sep 22, 2025
2c635a4
chore: router ci improvement
miklosbarabas Sep 22, 2025
d105701
chore: router ci improvement
miklosbarabas Sep 22, 2025
13abcb8
chore: router ci improvement
miklosbarabas Sep 23, 2025
dd83f07
Merge branch 'main' into miklos/eng-8201-chore-router-ci-improvements
miklosbarabas Sep 24, 2025
3b9e5fe
Merge branch 'main' into miklos/eng-8201-chore-router-ci-improvements
miklosbarabas Sep 25, 2025
83aedde
Merge branch 'main' into miklos/eng-8201-chore-router-ci-improvements
miklosbarabas Oct 1, 2025
5c732b8
Merge branch 'main' into miklos/eng-8201-chore-router-ci-improvements
miklosbarabas Oct 2, 2025
1bfdc73
chore: router ci improvement
miklosbarabas Oct 2, 2025
9838dcc
chore: router ci improvement
miklosbarabas Oct 2, 2025
53e7e88
chore: router ci improvement
miklosbarabas Oct 2, 2025
e27cc5c
chore: router ci improvement
miklosbarabas Oct 2, 2025
f0a1269
Merge branch 'main' into miklos/eng-8201-chore-router-ci-improvements
miklosbarabas Oct 3, 2025
ec6400b
Merge branch 'main' into miklos/eng-8201-chore-router-ci-improvements
miklosbarabas Oct 3, 2025
6ba2c3c
chore: router ci improvement
miklosbarabas Oct 3, 2025
34f2aa8
chore: router ci improvement
miklosbarabas Oct 3, 2025
4cfadd8
chore: router ci improvement
miklosbarabas Oct 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 90 additions & 18 deletions .github/workflows/router-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,50 @@ jobs:
--health-interval 10s
--health-timeout 5s
--health-retries 5
credentials:
username: ${{secrets.DOCKER_USERNAME}}
password: ${{secrets.DOCKER_PASSWORD}}
Comment thread
miklosbarabas marked this conversation as resolved.
ports:
- 6379:6379
redis-0:
image: bitnamilegacy/redis-cluster:7.2
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
ALLOW_EMPTY_PASSWORD: "yes"
REDIS_NODES: "redis-0 redis-1 redis-2"
REDIS_CLUSTER_REPLICAS: "0"
REDIS_CLUSTER_CREATOR: "no"
ports:
- 7001:6379
redis-1:
image: bitnamilegacy/redis-cluster:7.2
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
ALLOW_EMPTY_PASSWORD: "yes"
REDIS_NODES: "redis-0 redis-1 redis-2"
REDIS_CLUSTER_REPLICAS: "0"
REDIS_CLUSTER_CREATOR: "no"
ports:
- 7002:6379
redis-2:
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
image: bitnamilegacy/redis-cluster:7.2
env:
ALLOW_EMPTY_PASSWORD: "yes"
REDIS_NODES: "redis-0 redis-1 redis-2"
REDIS_CLUSTER_REPLICAS: "0"
REDIS_CLUSTER_CREATOR: "yes"
ports:
- 7003:6379
Comment thread
miklosbarabas marked this conversation as resolved.
kafka:
image: bitnamilegacy/kafka:3.7.0
options: >-
Expand All @@ -214,6 +253,45 @@ jobs:
ports:
- '9092:9092'
steps:
- name: Wait for Redis Cluster
run: |
echo "[CHECK] Waiting for Redis Cluster to become healthy..."
cluster_containers=$(docker ps --quiet --filter "ancestor=bitnamilegacy/redis-cluster:7.2")

success=0
for i in {1..30}; do
if [ $i -eq 1 ]; then
echo "[INIT] Forcing cluster creation..."
# pick one container as the "creator"
creator=$(echo $cluster_containers | awk '{print $1}')
# run the cluster create command inside it
docker exec "$creator" redis-cli --cluster create redis-0:6379 redis-1:6379 redis-2:6379 --cluster-replicas 0 --cluster-yes || true
fi

for cid in $cluster_containers; do
docker exec "$cid" redis-cli -p 6379 cluster info
if docker exec "$cid" redis-cli -p 6379 cluster info 2>/dev/null | grep -q "cluster_state:ok"; then
echo "[SUCCESS] Redis Cluster is ready (reported by $cid)"
success=1
break 2
fi
done

echo "[WAITING] Cluster not ready yet (attempt $i)..."
sleep 2
done

if [ $success -eq 0 ]; then
echo "[ERROR] Redis Cluster did not become healthy in time"
for cid in $cluster_containers; do
echo "--- Cluster info for $cid ---"
docker exec "$cid" redis-cli -p 6379 cluster info || true
docker exec "$cid" redis-cli -p 6379 cluster nodes || true
echo "--- Logs for $cid ---"
docker logs "$cid" | tail -n 100
done
exit 1
fi
- uses: actions/checkout@v4
Comment thread
miklosbarabas marked this conversation as resolved.
- uses: ./.github/actions/go
with:
Expand All @@ -224,26 +302,20 @@ jobs:
- name: Install dependencies
working-directory: ./router-tests
run: go mod download
- name: Setup Redis Cluster (for Cluster tests)
uses: vishnudxb/redis-cluster@1.0.9
with:
master1-port: 7001
master2-port: 7002
master3-port: 7003
slave1-port: 7004
slave2-port: 7005
slave3-port: 7006
sleep-duration: 5
- name: Configure Redis Authentication & ACL
run: |
sudo apt-get install -y redis-tools
docker ps -a
# Set a password for each master node
for port in 7001 7002 7003; do
redis-cli -h 127.0.0.1 -p $port ACL SETUSER cosmo on ">test" "~*" "+@all"
redis-cli -u "redis://cosmo:test@127.0.0.1:$port" ping
echo "ACL user 'cosmo' created with full access on port $port"
for cid in $(docker ps --format "{{.ID}} {{.Image}}" | grep "redis-cluster" | awk '{print $1}'); do
echo "Configuring ACLs in container $cid"
docker exec "$cid" redis-cli -p 6379 ACL SETUSER cosmo on ">test" "~*" "+@all"
docker exec "$cid" redis-cli -p 6379 ping
done
cid=$(docker ps --format "{{.ID}} {{.Image}}" | grep "redis:7" | awk '{print $1}')
# Sanity checks
docker exec "$cid" redis-cli -p 6379 ping
docker exec "$cid" redis-cli -u "redis://cosmo:test@redis-0:6379" ping
docker exec "$cid" redis-cli -u "redis://cosmo:test@redis-0:6379" cluster nodes
- name: Run Integration tests ${{ matrix.test_target }}
Comment thread
miklosbarabas marked this conversation as resolved.
working-directory: ./router-tests
run: make test test_params="-run '^Test[^(Flaky)]' --timeout=5m -p 1 --parallel 10" test_target="${{ matrix.test_target }}"
Expand Down
4 changes: 3 additions & 1 deletion router-tests/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
SHELL := bash
test_target := ./...
test_target_comma := $(shell echo $(test_target) | tr ' ' ',')
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
rerun_fails_count := 3

ifeq ($(CI),true)
FORMAT := github-actions
Expand All @@ -11,7 +13,7 @@ test-deps:
$(MAKE) -C ../demo plugin-build-ci

test: test-deps
gotestsum -f $(FORMAT) -- -ldflags=-extldflags=-Wl,-ld_classic $(test_params) -race $(test_target)
gotestsum --rerun-fails=$(rerun_fails_count) --packages="$(test_target_comma)" -f $(FORMAT) -- -ldflags=-extldflags=-Wl,-ld_classic $(test_params) -race $(test_target)
Comment thread
miklosbarabas marked this conversation as resolved.
Outdated

update-snapshot:
go test -update -race $(test_target)
Expand Down
9 changes: 5 additions & 4 deletions router-tests/ratelimit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -700,10 +700,11 @@ func TestRateLimit(t *testing.T) {
name: "should successfully use auth from first url",
clusterUrlSlice: []string{"redis://cosmo:test@localhost:7003", "redis://cosmo1:test1@localhost:7001", "redis://cosmo2:test2@localhost:7002"},
},
{
name: "should successfully use auth from later url if no auth in first urls",
clusterUrlSlice: []string{"redis://localhost:7003", "rediss://localhost:7001", "rediss://cosmo:test@localhost:7002"},
},
// Seems like not working as expected ? (if password is configured for the cluster default user)
//{
// name: "should successfully use auth from later url if no auth in first urls",
// clusterUrlSlice: []string{"redis://localhost:7003", "rediss://localhost:7001", "rediss://cosmo:test@localhost:7002"},
//},
{
name: "should successfully work with two urls",
clusterUrlSlice: []string{"redis://cosmo:test@localhost:7002", "rediss://localhost:7001"},
Expand Down
Loading