mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-11 18:35:46 +02:00
feat(test): Add integration test for the jedis and node-redis clients (#233)
* docs: Improve wording in issue reporting Signed-off-by: odedponcz <oded@poncz.com> * docs: Change contribution doc flow Signed-off-by: odedponcz <oded@poncz.com> * feat(tests): Add integration test with node-redis Signed-off-by: odedponcz <oded@poncz.com> * Rename integration test docker files Signed-off-by: odedponcz <oded@poncz.com>
This commit is contained in:
parent
a00c205b5b
commit
cf729f3fcb
3 changed files with 67 additions and 0 deletions
|
@ -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
|
||||
```
|
||||
|
|
17
tests/jedis.Dockerfile
Normal file
17
tests/jedis.Dockerfile
Normal file
|
@ -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"
|
||||
|
18
tests/node-redis.Dockerfile
Normal file
18
tests/node-redis.Dockerfile
Normal file
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue