Skip to content

Commit

Permalink
Merge branch 'master' into jatin/add-custom-attrs
Browse files Browse the repository at this point in the history
  • Loading branch information
urdarinda authored Dec 16, 2024
2 parents dffbe61 + 91dddc2 commit b04e7ba
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 5 deletions.
47 changes: 45 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,50 @@ jobs:
run: make test

- name: Upload to Codecov
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
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'
1 change: 1 addition & 0 deletions .github/workflows/test-redis-enterprise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ jobs:
- name: Test
env:
RE_CLUSTER: "1"
USE_CONTAINERIZED_REDIS: "1"
run: |
go test \
--ginkgo.skip-file="ring_test.go" \
Expand Down
21 changes: 21 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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
5 changes: 3 additions & 2 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ var cluster = &clusterScenario{
}

var RECluster = false
var USE_CONTAINERIZED_REDIS = false

func registerProcess(port string, p *redisProcess) {
if processes == nil {
Expand All @@ -82,8 +83,8 @@ var _ = BeforeSuite(func() {
}
var err error
RECluster, _ = strconv.ParseBool(os.Getenv("RE_CLUSTER"))

if !RECluster {
USE_CONTAINERIZED_REDIS, _ = strconv.ParseBool(os.Getenv("USE_CONTAINERIZED_REDIS"))
if !RECluster || !USE_CONTAINERIZED_REDIS {

redisMain, err = startRedis(redisPort)
Expect(err).NotTo(HaveOccurred())
Expand Down
2 changes: 1 addition & 1 deletion search_commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -1775,7 +1775,7 @@ func FTSearchQuery(query string, options *FTSearchOptions) SearchQuery {
}
}
if options.SortByWithCount {
queryArgs = append(queryArgs, "WITHCOUT")
queryArgs = append(queryArgs, "WITHCOUNT")
}
}
if options.LimitOffset >= 0 && options.Limit > 0 {
Expand Down
4 changes: 4 additions & 0 deletions search_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ var _ = Describe("RediSearch commands Resp 2", Label("search"), func() {
Expect(res2.Docs[1].ID).To(BeEquivalentTo("doc2"))
Expect(res2.Docs[0].ID).To(BeEquivalentTo("doc3"))

res3, err := client.FTSearchWithArgs(ctx, "num", "foo", &redis.FTSearchOptions{NoContent: true, SortBy: []redis.FTSearchSortBy{sortBy2}, SortByWithCount: true}).Result()
Expect(err).NotTo(HaveOccurred())
Expect(res3.Total).To(BeEquivalentTo(int64(0)))

})

It("should FTCreate and FTSearch example", Label("search", "ftcreate", "ftsearch"), func() {
Expand Down

0 comments on commit b04e7ba

Please sign in to comment.