mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-10-06 19:46:00 +08:00
Fix PATH test on Windows
This commit is contained in:
parent
385fcfb0a2
commit
b5e8cd9b00
1 changed files with 8 additions and 6 deletions
|
@ -999,9 +999,8 @@ defmodule LivebookWeb.SessionLiveTest do
|
||||||
_ -> ":"
|
_ -> ":"
|
||||||
end
|
end
|
||||||
|
|
||||||
os_path = System.get_env("PATH", "")
|
initial_os_path = System.get_env("PATH", "")
|
||||||
old_expected_path = ~s/\e[32m"#{os_path}"\e[0m/
|
expected_path = initial_os_path <> separator <> tmp_dir
|
||||||
expected_path = ~s/\e[32m"#{os_path}#{separator}#{tmp_dir}"\e[0m/
|
|
||||||
|
|
||||||
attrs = params_for(:env_var, name: "PATH", value: tmp_dir)
|
attrs = params_for(:env_var, name: "PATH", value: tmp_dir)
|
||||||
Settings.set_env_var(attrs)
|
Settings.set_env_var(attrs)
|
||||||
|
@ -1011,14 +1010,17 @@ defmodule LivebookWeb.SessionLiveTest do
|
||||||
|
|
||||||
section_id = insert_section(session.pid)
|
section_id = insert_section(session.pid)
|
||||||
|
|
||||||
cell_id = insert_text_cell(session.pid, section_id, :code, ~s{System.get_env("PATH")})
|
cell_id =
|
||||||
|
insert_text_cell(session.pid, section_id, :code, ~s{System.get_env("PATH") |> IO.write()})
|
||||||
|
|
||||||
view
|
view
|
||||||
|> element(~s{[data-el-session]})
|
|> element(~s{[data-el-session]})
|
||||||
|> render_hook("queue_cell_evaluation", %{"cell_id" => cell_id})
|
|> render_hook("queue_cell_evaluation", %{"cell_id" => cell_id})
|
||||||
|
|
||||||
assert_receive {:operation,
|
assert_receive {:operation,
|
||||||
{:add_cell_evaluation_response, _, ^cell_id, {:text, ^expected_path}, _}}
|
{:add_cell_evaluation_output, _, ^cell_id, {:stdout, ^expected_path}}}
|
||||||
|
|
||||||
|
assert_receive {:operation, {:add_cell_evaluation_response, _, ^cell_id, _, _}}
|
||||||
|
|
||||||
Settings.unset_env_var("PATH")
|
Settings.unset_env_var("PATH")
|
||||||
|
|
||||||
|
@ -1027,7 +1029,7 @@ defmodule LivebookWeb.SessionLiveTest do
|
||||||
|> render_hook("queue_cell_evaluation", %{"cell_id" => cell_id})
|
|> render_hook("queue_cell_evaluation", %{"cell_id" => cell_id})
|
||||||
|
|
||||||
assert_receive {:operation,
|
assert_receive {:operation,
|
||||||
{:add_cell_evaluation_response, _, ^cell_id, {:text, ^old_expected_path}, _}}
|
{:add_cell_evaluation_output, _, ^cell_id, {:stdout, ^initial_os_path}}}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue