Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a exeflags kwarg to the get_connect_cmd() function #14

Open
wants to merge 1 commit into
base: dpa/using
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/elastic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,7 @@ function elastic_worker(cookie, addr="127.0.0.1", port=9009; stdout_to_master=tr
Distributed.start_worker(c, cookie)
end

function get_connect_cmd(em::ElasticManager; absolute_exename=true, same_project=true)

function get_connect_cmd(em::ElasticManager; absolute_exename=true, same_project=true, exeflags::Tuple=())
ip = string(em.sockname[1])
port = convert(Int,em.sockname[2])
cookie = Distributed.cluster_cookie()
Expand All @@ -157,6 +156,7 @@ function get_connect_cmd(em::ElasticManager; absolute_exename=true, same_project

join([
exename,
exeflags...,
project...,
"-e 'import ElasticClusterManager; ElasticClusterManager.elastic_worker(\"$cookie\",\"$ip\",$port)'"
]," ")
Expand Down
3 changes: 2 additions & 1 deletion test/elastic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
@test em isa ElasticManager

# launch worker
old_cmd = ElasticClusterManager.get_connect_cmd(em)
exeflags = ("--code-coverage=user",)
old_cmd = ElasticClusterManager.get_connect_cmd(em; exeflags=exeflags)
new_cmd = `$(old_cmd) --coverage=user`
# run(`sh -c $(new_cmd)`) # comment out this line when you are finished debugging
run(`sh -c $(new_cmd)`; wait=false) # uncomment this line when you are finished debugging
Expand Down
Loading