wooga / eredis

Erlang Redis client
MIT License
628 stars 280 forks source link

eunit tests fail #89

Closed aidecoe closed 8 years ago

aidecoe commented 8 years ago

I may do something wrong or maybe there are some prerequisites. I am running it on Erlang 18.3.

$ rebar -v eunit
==> eredis (eunit)
INFO:  sh info:
    cwd: ".../eredis"
    cmd: cp -R src/basho_bench_driver_eredis.erl src/basho_bench_driver_erldis.erl src/eredis_client.erl src/eredis_sub_client.erl src/eredis_sub.erl src/eredis.erl src/eredis_parser.erl test/eredis_sub_tests.erl test/eredis_tests.erl test/eredis_parser_tests.erl ".eunit"
Compiled src/eredis_parser.erl
Compiled src/eredis.erl
Compiled src/basho_bench_driver_erldis.erl
Compiled src/basho_bench_driver_eredis.erl
Compiled src/eredis_sub.erl
Compiled src/eredis_client.erl
Compiled src/eredis_sub_client.erl
Compiled test/eredis_sub_tests.erl
Compiled test/eredis_tests.erl
Compiled test/eredis_parser_tests.erl
INFO:  Cover compiling .../eredis
======================== EUnit ========================
module 'basho_bench_driver_erldis'
module 'eredis_sub_client'
module 'eredis_sub'
  module 'eredis_sub_tests'
    eredis_sub_tests: pubsub_test...*skipped*
undefined
*unexpected termination of test process*
::{connection_error,{connection_error,econnrefused}}

=======================================================
  Failed: 0.  Skipped: 0.  Passed: 0.
One or more tests were cancelled.
Cover analysis: .../eredis/.eunit/index.html
ERROR: One or more eunit tests failed.
ERROR: eunit failed while processing .../eredis: rebar_abort
csbzy commented 8 years ago

Just look at the error :{connection_error,{connection_error,econnrefused}} The error appears when it connect to redis.Have you had start redis with 127.0.0.1:6379

aidecoe commented 8 years ago

No. I have blindly expected unit test would mock real redis server... With real redis server everything pass. It would be good to mention in README that real instance is required for unit tests. Thanks!