diff --git a/tests/README.md b/tests/README.md index 6aa09f8..938d68f 100644 --- a/tests/README.md +++ b/tests/README.md @@ -8,3 +8,35 @@ You can override the location of the binary using `DRAGONFLY_HOME` environment v to run pytest, run: `pytest -xv pytest` + + +# Integration tests +To simplify running integration test each package should have its own Dockerfile. The Dockerfile should contain everything needed in order to test the package against Drafongly. Docker can assume Dragonfly is running on localhost:6379. +To run the test: +``` +docker build -t [test-name] -f [test-dockerfile-name] . +docker run --network=host [test-name] +``` + +## Node-Redis +Integration test for node-redis client. +Build: +``` +docker build -t node-redis-test -f ./node-redis.Dockerfile . +``` +Run: +``` +docker run --network=host node-redis-test +``` + + +## Jedis +Integration test for the Jedis client. +Build: +``` +docker build -t jedis-test -f ./jedis.Dockerfile . +``` +Run: +``` +docker run --network=host jedis-test +``` diff --git a/tests/jedis.Dockerfile b/tests/jedis.Dockerfile new file mode 100644 index 0000000..146d5d7 --- /dev/null +++ b/tests/jedis.Dockerfile @@ -0,0 +1,17 @@ +# syntax=docker/dockerfile:1 + +FROM maven:3.8.6-jdk-11 +ENV NODE_ENV=development + +WORKDIR /app +# Clone jedis dragonfly fork +RUN git clone -b dragonfly https://github.com/dragonflydb/jedis.git + +WORKDIR /app/jedis + +# Build the client and tests +RUN mvn test -DskipTests + +# Run selected tests +CMD mvn surefire:test -Dtest="AllKindOfValuesCommandsTest,BitCommandsTest,ControlCommandsTest,ControlCommandsTest,HashesCommandsTest,ListCommandsTest,ScriptingCommandsTest,ScriptingCommandsTest,SetCommandsTest,SetCommandsTest,SetCommandsTest,TransactionCommandsTest,ClientCommandsTest,PublishSubscribeCommandsTest,SortedSetCommandsTest,SortingCommandsTest,StreamsCommandsTest" + diff --git a/tests/node-redis.Dockerfile b/tests/node-redis.Dockerfile new file mode 100644 index 0000000..f580aff --- /dev/null +++ b/tests/node-redis.Dockerfile @@ -0,0 +1,18 @@ +# syntax=docker/dockerfile:1 + +FROM node:18.7.0 +ENV NODE_ENV=development + +WORKDIR /app +# Clone node-redis dragonfly fork +RUN git clone -b dragonfly https://github.com/dragonflydb/node-redis.git + +WORKDIR /app/node-redis + +RUN npm install + +RUN npm run build -w ./packages/client + +RUN npm run build -w ./packages/test-utils + +CMD npm run test -w ./packages/client -- --redis-version=2.8