Node-redis: run tests against remote redis server

Created on 9 Feb 2018  路  7Comments  路  Source: NodeRedis/node-redis

Is it possible to run npm test against the remote redis server?
Also, is it possible to run it against the redis docker image ?

Thanks.

Feature Request

Most helpful comment

I might have time the coming weeks to rework the way the tests use the Redis server.
Probably something along these lines:

  • Optional Docker configuration to avoid local dependency on redis-server
  • ENV variable to indicate use of Docker or local Redis server (defaults to local Redis server)
  • Perhaps two new npm scripts: npm run test-local and npm run test-docker to make it obvious which server it uses

Any ideas or suggestions @BridgeAR?

All 7 comments

I am very much confused about this question. I might misunderstand what you want to do but if you want to trigger npm test on the redis server address with a client command, that is not possible. You would want to use something like ssh to communicate with other servers. That aside: the Redis server has nothing to do with npm.

@BridgeAR, so the node_redis test suite (invoked via npm test) relies on Redis existing on the same machine as where the node_redis test suite runs?

Could there be any issues when using this module to interact with a Redis on a different architecture? e.g. I have my Node.js application running on s390x, but the Redis is on a remote x64 server.

Ahh, now I understand. Hm, right now the test suite is hardcoded to the default local server. It would be great to change that but right now it is not possible to run the tests against a different machine.

This sounds like a feature request for the test suite, @BridgeAR do you want to reopen this issue or should I raise a new one?

I might have time the coming weeks to rework the way the tests use the Redis server.
Probably something along these lines:

  • Optional Docker configuration to avoid local dependency on redis-server
  • ENV variable to indicate use of Docker or local Redis server (defaults to local Redis server)
  • Perhaps two new npm scripts: npm run test-local and npm run test-docker to make it obvious which server it uses

Any ideas or suggestions @BridgeAR?

@dirkbonhomme would it be possible for npm test to fall back to docker if there isn't a local redis-server (but there is docker)?

@gibfahn definitely sounds possible:

  1. Use local Redis if available
  2. Fall back to Docker if available
  3. Stop and display clear error message with instructions
Was this page helpful?
0 / 5 - 0 ratings

Related issues

shmendo picture shmendo  路  6Comments

lemon707 picture lemon707  路  3Comments

ghost picture ghost  路  3Comments

id0Sch picture id0Sch  路  4Comments

Mickael-van-der-Beek picture Mickael-van-der-Beek  路  6Comments