Skip to content

Commit

Permalink
Add a exeflags kwarg to the get_connect_cmd() function
Browse files Browse the repository at this point in the history
  • Loading branch information
DilumAluthge committed Feb 19, 2025
1 parent b0a1fa8 commit f2bb252
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
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

0 comments on commit f2bb252

Please sign in to comment.