basho / basho_bench

A load-generation and testing tool for basically whatever you can write a returning Erlang function for.
Apache License 2.0
311 stars 197 forks source link

basho_bench tests directory seems to be ignored [JIRA: TOOLS-100] #178

Closed l1x closed 9 years ago

l1x commented 9 years ago

I have installed basho_bench the first time using RPM (previously i used it the source only). I was running into this issue:

$ basho_bench -d tests /etc/basho_bench/http.config
escript: exception error: no match of right hand side value {error,eacces}
  in function  basho_bench:test_dir/2 (src/basho_bench.erl, line 178)
  in call from basho_bench:main/1 (src/basho_bench.erl, line 47)
  in call from escript:run/2 (escript.erl, line 747)
  in call from escript:start/1 (escript.erl, line 277)
  in call from init:start_it/1
  in call from init:start_em/1

I was wondering what is going ton and after poking around I have seen https://github.com/basho/basho_bench/issues/56.

I have tried it with sudo.

[vagrant@localhost ~]$ sudo basho_bench -d tests /etc/basho_bench/http.config
16:45:47.105 [debug] Lager installed handler {lager_file_backend,
                            "/usr/lib64/basho_bench/lib/basho_bench-0.10.0/ebin/tests/20150408_164547/error.log"} into lager_event
16:45:47.105 [debug] Lager installed handler {lager_file_backend,
                            "/usr/lib64/basho_bench/lib/basho_bench-0.10.0/ebin/tests/20150408_164547/console.log"} into lager_event

I guess the following function prefixes the parameter that was passed in with -d with the CWD that is the "/usr/lib64/basho_bench/lib/basho_bench-0.10.0/ebin" in my case if the path is not a full path.

https://github.com/basho/basho_bench/blob/0.10.0/src/basho_bench.erl#L172

It would be nice to make it explicit that the path has to be absolute and relative paths will fail if the user has no access to the CWD of the basho_bench binary.

What do you guys think?

slfritchie commented 9 years ago

@l1x What do you think about https://github.com/basho/basho_bench/compare/bug/gh178?expand=1 ?

l1x commented 9 years ago

@slfritchie i guess I am trying to understand the intentions here. Currently the function behaves like this:

I guess the code should not silently do that or it should be called out. It seems this is a real issue (even though a low priority one) because I am not the first guy who ran into this.

What you are your thoughts?

slfritchie commented 9 years ago

The intent of the diff is to use pattern matching to create a more useful error message when something goes wrong: the path of the file with the I/O error is included in any badmatch error reporting.

slfritchie commented 9 years ago

I just merged #185 and will close this issue. If there's a serious problem, or if there's a PR to alter the behavior further, please reopen.

Basho-JIRA commented 8 years ago

Ummm, this GH issue was closed on May 19, 2015. Closing in JIRA.

_[posted via JIRA by Scott Fritchie]_