informatikr / hedis

A Redis client library for Haskell.
http://hackage.haskell.org/package/hedis
BSD 3-Clause "New" or "Revised" License
327 stars 121 forks source link

My hedis-based spec test stumbles over "Network.Socket.connect: <socket: 16>: does not exist (Connection refused)" #148

Closed 573 closed 4 years ago

573 commented 4 years ago

Sorry if this is not an issue in hedis, but it occurred to me that it relates to hedis usage and maybe you might have pointers regarding the right direction:

So when I am building my codebase including spec tests (an hedis example forked from elsewhere) locally using redis-server everything works as expected. As soon as I push it to github where I set up basically the same build action as used locally the build stumbles over the spec test exactly as you might see here. Is there something I missed here, especially regarding the socket terminology?

I hope my question doesn't seem too dumb.

k-bx commented 4 years ago

Sorry, no idea really. You can see it works quite straight-forwardly with Travis in this repo https://github.com/informatikr/hedis/blob/master/.travis.yml

All I can recommend is to build a minimal repo with minimal amount of dependencies, install redis without Nix and see how it goes.

k-bx commented 4 years ago

Also maybe try putting host to 127.0.0.1, not localhost. Who knows..

573 commented 4 years ago

Seems to be related to nix-build purity. Socket access / external services aren't enabled by default, see i. e discussion here

573 commented 4 years ago

FYI The error related to nix-build being pure, but I was able doing the integration test against redis as you may see here: https://github.com/573/shorturls/tree/a34b28e98639607bd0590cd3ec76ef719ba2cc05