From 16b7ab8af42199d7031a1743cd7fc3388fb762c9 Mon Sep 17 00:00:00 2001 From: Rick Carlino Date: Wed, 29 Jan 2020 16:02:07 -0600 Subject: [PATCH] Use `@tag :skip` instead of commenting things out --- farmbot_celery_script/coveralls.json | 3 +- farmbot_firmware/coveralls.json | 3 + .../test/farmbot_firmware/command_test.exs | 75 ++++++++++--------- 3 files changed, 43 insertions(+), 38 deletions(-) create mode 100644 farmbot_firmware/coveralls.json diff --git a/farmbot_celery_script/coveralls.json b/farmbot_celery_script/coveralls.json index fb304945..2b87e2de 100644 --- a/farmbot_celery_script/coveralls.json +++ b/farmbot_celery_script/coveralls.json @@ -1,5 +1,6 @@ { "skip_files": [ "lib/farmbot_celery_script/compiler/tools.ex" - ] + ], + "treat_no_relevant_lines_as_covered": true } diff --git a/farmbot_firmware/coveralls.json b/farmbot_firmware/coveralls.json new file mode 100644 index 00000000..01222b47 --- /dev/null +++ b/farmbot_firmware/coveralls.json @@ -0,0 +1,3 @@ +{ + "treat_no_relevant_lines_as_covered": true +} diff --git a/farmbot_firmware/test/farmbot_firmware/command_test.exs b/farmbot_firmware/test/farmbot_firmware/command_test.exs index 61eee36f..0a13007c 100644 --- a/farmbot_firmware/test/farmbot_firmware/command_test.exs +++ b/farmbot_firmware/test/farmbot_firmware/command_test.exs @@ -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