File tree Expand file tree Collapse file tree 4 files changed +12
-7
lines changed Expand file tree Collapse file tree 4 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ defmodule Elasticsearch.Executable do
2929 case System . cmd ( "lsof" , [ "-i" , ":#{ port_number } " ] ) do
3030 { "" , _ } ->
3131 wrap = Application . app_dir ( :elasticsearch ) <> "/priv/bin/wrap"
32- port = Port . open ( { :spawn , "#{ wrap } #{ executable } --port #{ port_number } " } , [ ] )
32+ port = Port . open ( { :spawn , "#{ wrap } #{ executable } -E http.port= #{ port_number } " } , [ ] )
3333 { :os_pid , os_pid } = Port . info ( port , :os_pid )
3434 IO . puts ( "[info] Running #{ name } with PID #{ os_pid } on port #{ port_number } " )
3535 { :ok , port }
Original file line number Diff line number Diff line change 1414#
1515# http://erlang.2086793.n4.nabble.com/closing-a-port-doesn-t-kill-the-connected-process-td2119170.html
1616
17- $1 > /dev/null 2>&1 &
17+ $@ > /dev/null 2>&1 &
1818last_pid=$!
1919while read line ; do
2020 :
Original file line number Diff line number Diff line change @@ -3,12 +3,14 @@ defmodule Elasticsearch.Test.Cluster do
33
44 use Elasticsearch.Cluster
55
6- def init ( _config ) do
6+ def init ( config ) do
7+ url = Map . get ( config , :url , "http://localhost:9200" )
8+
79 { :ok ,
810 % {
911 api: Elasticsearch.API.HTTP ,
1012 json_library: Poison ,
11- url: "http://localhost:9200" ,
13+ url: url ,
1214 username: "username" ,
1315 password: "password" ,
1416 indexes: % {
Original file line number Diff line number Diff line change 11ExUnit . start ( )
22Elasticsearch.Test.Repo . start_link ( )
33
4+ port_number = 9200
5+ url = "http://localhost:#{ port_number } "
6+
47unless System . get_env ( "CI" ) do
58 Elasticsearch.Executable . start_link (
69 "Elasticsearch" ,
710 "./vendor/elasticsearch/bin/elasticsearch" ,
8- 9200
11+ port_number
912 )
1013end
1114
12- { :ok , _ } = Elasticsearch.Test.Cluster . start_link ( )
13- { :ok , _ } = Elasticsearch . wait_for_boot ( Elasticsearch.Test.Cluster , 15 )
15+ { :ok , _ } = Elasticsearch.Test.Cluster . start_link ( % { url: url } )
16+ { :ok , _ } = Elasticsearch . wait_for_boot ( Elasticsearch.Test.Cluster , 30 )
You can’t perform that action at this time.
0 commit comments