Use `@tag :skip` instead of commenting things out

pull/1130/head
Rick Carlino 2020-01-29 16:02:07 -06:00
parent 3a788d86f7
commit 16b7ab8af4
3 changed files with 43 additions and 38 deletions

View File

@ -1,5 +1,6 @@
{
"skip_files": [
"lib/farmbot_celery_script/compiler/tools.ex"
]
],
"treat_no_relevant_lines_as_covered": true
}

View File

@ -0,0 +1,3 @@
{
"treat_no_relevant_lines_as_covered": true
}

View File

@ -16,55 +16,56 @@ defmodule FarmbotFirmware.CommandTest do
@subject.command(pid, cmd)
end
@tag :skip
test "various command()s" do
# assert {:ok, nil} == try_command({:command_emergency_lock, []})
assert {:ok, nil} == try_command({:command_emergency_lock, []})
assert {:ok, "1"} == try_command({:pin_mode_write, [p: 13, m: 1]})
# assert {:ok, "1"} == try_command({"1", {:position_write_zero, [:x]}})
assert {:ok, "1"} == try_command({"1", {:position_write_zero, [:x]}})
# assert {:ok, "23"} ==
# try_command(
# {"23", {:parameter_write, [movement_invert_2_endpoints_y: 1.0]}}
# )
assert {:ok, "23"} ==
try_command(
{"23", {:parameter_write, [movement_invert_2_endpoints_y: 1.0]}}
)
# assert {:ok, "24"} ==
# try_command(
# {"24", {:parameter_write, [movement_stop_at_home_x: 0.0]}}
# )
assert {:ok, "24"} ==
try_command(
{"24", {:parameter_write, [movement_stop_at_home_x: 0.0]}}
)
# assert {:ok, "40"} == try_command({"40", {:pin_write, [p: 13, v: 0, m: 0]}})
# assert {:ok, "49"} == try_command({"49", {:pin_mode_write, [p: 13, m: 1]}})
# assert {:ok, "55"} == try_command({"55", {:pin_mode_write, [p: 13, m: 1]}})
# assert {:ok, "59"} == try_command({"59", {:pin_mode_write, [p: 13, m: 1]}})
assert {:ok, "40"} == try_command({"40", {:pin_write, [p: 13, v: 0, m: 0]}})
assert {:ok, "49"} == try_command({"49", {:pin_mode_write, [p: 13, m: 1]}})
assert {:ok, "55"} == try_command({"55", {:pin_mode_write, [p: 13, m: 1]}})
assert {:ok, "59"} == try_command({"59", {:pin_mode_write, [p: 13, m: 1]}})
# assert {:ok, "94"} ==
# try_command({"94", {:parameter_write, [movement_home_up_y: 1.0]}})
assert {:ok, "94"} ==
try_command({"94", {:parameter_write, [movement_home_up_y: 1.0]}})
# assert {:ok, "94"} == try_command({"94", {:pin_write, [p: 13, v: 1, m: 0]}})
assert {:ok, "94"} == try_command({"94", {:pin_write, [p: 13, v: 1, m: 0]}})
# assert {:ok, "98"} ==
# try_command({"98", {:parameter_write, [movement_home_up_y: 0.0]}})
assert {:ok, "98"} ==
try_command({"98", {:parameter_write, [movement_home_up_y: 0.0]}})
# assert {:ok, "99"} ==
# try_command(
# {"99", {:parameter_write, [movement_stop_at_home_x: 1.0]}}
# )
assert {:ok, "99"} ==
try_command(
{"99", {:parameter_write, [movement_stop_at_home_x: 1.0]}}
)
# assert {:ok, nil} == try_command({nil, {:command_emergency_lock, []}})
# assert {:ok, nil} == try_command({nil, {:command_emergency_lock, []}})
assert {:ok, nil} == try_command({nil, {:command_emergency_lock, []}})
assert {:ok, nil} == try_command({nil, {:command_emergency_lock, []}})
# assert {:ok, nil} ==
# try_command(
# {nil,
# {:command_movement,
# [x: 0.0, y: 0.0, z: 0.0, a: 400.0, b: 400.0, c: 400.0]}}
# )
assert {:ok, nil} ==
try_command(
{nil,
{:command_movement,
[x: 0.0, y: 0.0, z: 0.0, a: 400.0, b: 400.0, c: 400.0]}}
)
# assert {:ok, nil} ==
# try_command(
# {nil,
# {:command_movement,
# [x: 0.0, y: 0.0, z: 10.0, a: 400.0, b: 400.0, c: 400.0]}}
# )
assert {:ok, nil} ==
try_command(
{nil,
{:command_movement,
[x: 0.0, y: 0.0, z: 10.0, a: 400.0, b: 400.0, c: 400.0]}}
)
end
test "command(), error with tag" do