mirror of https://github.com/go-redis/redis.git
Test against Redis CE (#3191)
* Create workflow that tests go-redis against docker * Add docker compose file * Add docker compose file * Change command in docker compose * Load modules locally * test varios redis versions * add env var to test-redis-enterprise action * cleaning code * cleaning code
This commit is contained in:
parent
caa2592db7
commit
91dddc2e11
|
@ -43,3 +43,46 @@ jobs:
|
||||||
with:
|
with:
|
||||||
files: coverage.txt
|
files: coverage.txt
|
||||||
token: ${{ secrets.CODECOV_TOKEN }}
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
|
|
||||||
|
test-redis-ce:
|
||||||
|
name: test-redis-ce
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
redis_version:
|
||||||
|
- "8.0-M01"
|
||||||
|
- "7.4.1"
|
||||||
|
- "7.2.6"
|
||||||
|
- "6.2.16"
|
||||||
|
go-version:
|
||||||
|
- "1.19.x"
|
||||||
|
- "1.20.x"
|
||||||
|
- "1.21.x"
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Set up ${{ matrix.go-version }}
|
||||||
|
uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version: ${{ matrix.go-version }}
|
||||||
|
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
# Set up Docker Compose environment
|
||||||
|
- name: Set up Docker Compose environment
|
||||||
|
run: |
|
||||||
|
docker compose --profile all up -d
|
||||||
|
|
||||||
|
- name: Run tests
|
||||||
|
env:
|
||||||
|
USE_CONTAINERIZED_REDIS: "true"
|
||||||
|
RE_CLUSTER: "true"
|
||||||
|
run: |
|
||||||
|
go test \
|
||||||
|
--ginkgo.skip-file="ring_test.go" \
|
||||||
|
--ginkgo.skip-file="sentinel_test.go" \
|
||||||
|
--ginkgo.skip-file="osscluster_test.go" \
|
||||||
|
--ginkgo.skip-file="pubsub_test.go" \
|
||||||
|
--ginkgo.skip-file="gears_commands_test.go" \
|
||||||
|
--ginkgo.label-filter='!NonRedisEnterprise'
|
||||||
|
|
|
@ -47,6 +47,7 @@ jobs:
|
||||||
- name: Test
|
- name: Test
|
||||||
env:
|
env:
|
||||||
RE_CLUSTER: "1"
|
RE_CLUSTER: "1"
|
||||||
|
USE_CONTAINERIZED_REDIS: "1"
|
||||||
run: |
|
run: |
|
||||||
go test \
|
go test \
|
||||||
--ginkgo.skip-file="ring_test.go" \
|
--ginkgo.skip-file="ring_test.go" \
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
---
|
||||||
|
|
||||||
|
services:
|
||||||
|
|
||||||
|
redis-stanalone:
|
||||||
|
image: redislabs/client-libs-test:8.0-M02
|
||||||
|
container_name: redis-standalone
|
||||||
|
environment:
|
||||||
|
- REDIS_CLUSTER=no
|
||||||
|
- PORT=6379
|
||||||
|
- TLS_PORT=6666
|
||||||
|
command: --loadmodule /usr/local/lib/redis/modules/redisbloom.so --loadmodule /usr/local/lib/redis/modules/redisearch.so --loadmodule /usr/local/lib/redis/modules/redistimeseries.so --loadmodule /usr/local/lib/redis/modules/rejson.so
|
||||||
|
ports:
|
||||||
|
- 6379:6379
|
||||||
|
- 6380:6379
|
||||||
|
- 6666:6666 # TLS port
|
||||||
|
volumes:
|
||||||
|
- "./dockers/redis-standalone:/redis/work"
|
||||||
|
profiles:
|
||||||
|
- standalone
|
||||||
|
- all
|
|
@ -66,6 +66,7 @@ var cluster = &clusterScenario{
|
||||||
}
|
}
|
||||||
|
|
||||||
var RECluster = false
|
var RECluster = false
|
||||||
|
var USE_CONTAINERIZED_REDIS = false
|
||||||
|
|
||||||
func registerProcess(port string, p *redisProcess) {
|
func registerProcess(port string, p *redisProcess) {
|
||||||
if processes == nil {
|
if processes == nil {
|
||||||
|
@ -82,8 +83,8 @@ var _ = BeforeSuite(func() {
|
||||||
}
|
}
|
||||||
var err error
|
var err error
|
||||||
RECluster, _ = strconv.ParseBool(os.Getenv("RE_CLUSTER"))
|
RECluster, _ = strconv.ParseBool(os.Getenv("RE_CLUSTER"))
|
||||||
|
USE_CONTAINERIZED_REDIS, _ = strconv.ParseBool(os.Getenv("USE_CONTAINERIZED_REDIS"))
|
||||||
if !RECluster {
|
if !RECluster || !USE_CONTAINERIZED_REDIS {
|
||||||
|
|
||||||
redisMain, err = startRedis(redisPort)
|
redisMain, err = startRedis(redisPort)
|
||||||
Expect(err).NotTo(HaveOccurred())
|
Expect(err).NotTo(HaveOccurred())
|
||||||
|
|
Loading…
Reference in New Issue