diff --git a/.github/workflows/install-redis-modules/action.yml b/.github/workflows/install-redis-modules/action.yml deleted file mode 100644 index e4e9c9453a..0000000000 --- a/.github/workflows/install-redis-modules/action.yml +++ /dev/null @@ -1,69 +0,0 @@ -name: Install Redis Modules - -inputs: - redis-version: - description: "redis version of clusters" - required: true - type: string - - modules: - description: "required redis modules to install" - required: false - type: string - default: 'all' - options: - - "all" - - "search" - - "json" - - - -runs: - using: "composite" - steps: - - name: Cache RedisJSON Dependencies - if: inputs.modules == 'all' || inputs.modules == 'json' - id: cache-dependencies-redisjson - uses: actions/cache@v3 - with: - path: | - ./cmake - ./redisjson/bin - key: ${{ runner.os }}-${{ inputs.redis-version }}-redisjson - - - - name: Install CMake - if: steps.cache-dependencies-redisearch.outputs.cache-hit != 'true' || steps.cache-dependencies-redisjson.outputs.cache-hit != 'true' - shell: bash - run: | - set -x - sudo apt-get update - sudo apt-get install -y cmake - cp /usr/bin/cmake ./cmake - - - - name: Checkout RedisJSON Repository - if: steps.cache-dependencies-redisjson.outputs.cache-hit != 'true' && (inputs.modules == 'all' || inputs.modules == 'json') - uses: actions/checkout@v4 - with: - repository: "RedisJSON/RedisJSON" - path: "./redisjson" - ref: ${{ startsWith(inputs.redis-version, '6') && 'v2.6.0' || '' }} - submodules: recursive - - - name: Build RedisJSON - if: steps.cache-dependencies-redisjson.outputs.cache-hit != 'true' && (inputs.modules == 'all' || inputs.modules == 'json') - shell: bash - working-directory: ./redisjson - run: | - set -x - echo "Building RedisJSON..." - make - - - name: Copy redisjson.so - if: inputs.modules == 'all' || inputs.modules == 'json' - shell: bash - run: | - set -x - echo "Copying RedisJSON..." - cp $GITHUB_WORKSPACE/redisjson/bin/linux-x64-release/rejson.so $GITHUB_WORKSPACE/redisjson.so diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index 4394951c67..62bab729ea 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -61,11 +61,6 @@ jobs: target: "x86_64-unknown-linux-gnu" github-token: ${{ secrets.GITHUB_TOKEN }} - - name: Install Redis Modules - uses: ./.github/workflows/install-redis-modules - with: - redis-version: ${{ matrix.redis }} - - name: test run: npm test working-directory: ./node @@ -83,10 +78,6 @@ jobs: npm ci npm run build-and-test working-directory: ./node/hybrid-node-tests/ecmascript-test - - - name: test redis modules - run: npm run test-modules -- --load-module=$GITHUB_WORKSPACE/redisjson.so - working-directory: ./node - uses: ./.github/workflows/test-benchmark with: diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index a5a6cd31d5..915937a5f9 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -99,17 +99,12 @@ jobs: pip install -r ../benchmarks/python/requirements.txt python -m mypy .. - - name: Install Redis Modules - uses: ./.github/workflows/install-redis-modules - with: - redis-version: ${{ matrix.redis }} - - name: Test with pytest working-directory: ./python run: | source .env/bin/activate cd python/tests/ - pytest --asyncio-mode=auto --override-ini=addopts= --load-module=$GITHUB_WORKSPACE/redisjson.so + pytest --asyncio-mode=auto - uses: ./.github/workflows/test-benchmark with: diff --git a/node/package.json b/node/package.json index 581a5ce986..7cecbb624b 100644 --- a/node/package.json +++ b/node/package.json @@ -36,7 +36,6 @@ "build-test-utils": "cd ../utils && npm i && npm run build", "lint": "eslint -f unix \"src/**/*.{ts,tsx}\"", "prepack": "npmignore --auto", - "test-modules": "jest --verbose --runInBand 'tests/RedisModules.test.ts'", "prettier:check:ci": "./node_modules/.bin/prettier --check . --ignore-unknown '!**/*.{js,d.ts}'", "prettier:format": "./node_modules/.bin/prettier --write . --ignore-unknown '!**/*.{js,d.ts}'" }, diff --git a/node/tests/RedisModules.test.ts b/node/tests/RedisModules.test.ts deleted file mode 100644 index 67643885b0..0000000000 --- a/node/tests/RedisModules.test.ts +++ /dev/null @@ -1,99 +0,0 @@ -/** - * Copyright GLIDE-for-Redis Project Contributors - SPDX Identifier: Apache-2.0 - */ - -import { - afterAll, - afterEach, - beforeAll, - describe, - expect, - it, -} from "@jest/globals"; -import { - BaseClientConfiguration, - InfoOptions, - RedisClusterClient, - parseInfoResponse, -} from "../"; -import { RedisCluster } from "../../utils/TestUtils.js"; -import { runBaseTests } from "./SharedTests"; -import { flushallOnPort, getFirstResult } from "./TestUtilities"; - -type Context = { - client: RedisClusterClient; -}; - -const TIMEOUT = 10000; - -describe("RedisModules", () => { - let testsFailed = 0; - let cluster: RedisCluster; - beforeAll(async () => { - const args = process.argv.slice(2); - const loadModuleArgs = args.filter((arg) => - arg.startsWith("--load-module="), - ); - const loadModuleValues = loadModuleArgs.map((arg) => arg.split("=")[1]); - cluster = await RedisCluster.createCluster( - true, - 3, - 0, - loadModuleValues, - ); - }, 20000); - - afterEach(async () => { - await Promise.all(cluster.ports().map((port) => flushallOnPort(port))); - }); - - afterAll(async () => { - if (testsFailed === 0) { - await cluster.close(); - } - }); - - const getOptions = (ports: number[]): BaseClientConfiguration => { - return { - addresses: ports.map((port) => ({ - host: "localhost", - port, - })), - }; - }; - - runBaseTests({ - init: async (protocol, clientName) => { - const options = getOptions(cluster.ports()); - options.protocol = protocol; - options.clientName = clientName; - testsFailed += 1; - const client = await RedisClusterClient.createClient(options); - return { - context: { - client, - }, - client, - }; - }, - close: (context: Context, testSucceeded: boolean) => { - if (testSucceeded) { - testsFailed -= 1; - } - - context.client.close(); - }, - timeout: TIMEOUT, - }); - - it("simple json test", async () => { - const client = await RedisClusterClient.createClient( - getOptions(cluster.ports()), - ); - const info = parseInfoResponse( - getFirstResult(await client.info([InfoOptions.Modules])).toString(), - )["module"]; - expect(info).toEqual(expect.stringContaining("ReJSON")); - client.close(); - }); -});