Skip to content

Commit a54c8b4

Browse files
authored
Kd/fix redis unit test (#24650)
Replaces #24641 Currently, unit tests fail when run locally (unless users have minio instance running). This PR only requires redis unit tests if in CI. - Only run redis unit tests when `CI` env variable is set - Add minio as a service in unit tests actions
1 parent 36ed6bd commit a54c8b4

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

.github/workflows/pull-db_test.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,16 @@ jobs:
110110
- "143:143"
111111
- "587:587"
112112
- "993:993"
113+
redis:
114+
image: redis
115+
# Set health checks to wait until redis has started
116+
options: >-
117+
--health-cmd "redis-cli ping"
118+
--health-interval 5s
119+
--health-timeout 3s
120+
--health-retries 10
121+
ports:
122+
- 6379:6379
113123
steps:
114124
- name: checkout
115125
uses: actions/checkout@v3

modules/queue/base_redis_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func TestBaseRedis(t *testing.T) {
5656
}()
5757
if !waitRedisReady("redis://127.0.0.1:6379/0", 0) {
5858
redisServer = redisServerCmd(t)
59-
if redisServer == nil && os.Getenv("CI") != "" {
59+
if redisServer == nil && os.Getenv("CI") == "" {
6060
t.Skip("redis-server not found")
6161
return
6262
}

0 commit comments

Comments
 (0)