Skip to content

Commit 9797a46

Browse files
author
José Valim
committed
Only run tests if epmd is available, closes #9167
1 parent 418c277 commit 9797a46

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

lib/elixir/test/elixir/node_test.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ defmodule NodeTest do
55

66
doctest Node
77

8-
@tag :unix
8+
@tag :epmd
99
test "start/3 and stop/0" do
1010
assert Node.stop() == {:error, :not_found}
1111
assert {:ok, _} = Node.start(:hello, :shortnames, 15000)

lib/elixir/test/elixir/test_helper.exs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,11 @@ defmodule CodeFormatterHelpers do
8484
end
8585

8686
assert_timeout = String.to_integer(System.get_env("ELIXIR_ASSERT_TIMEOUT") || "500")
87-
exclude = if PathHelpers.windows?(), do: [unix: true], else: [windows: true]
87+
epmd_exclude = if match?({_, 0}, System.cmd("epmd", ["-daemon"])), do: [], else: [epmd: true]
88+
os_exclude = if PathHelpers.windows?(), do: [unix: true], else: [windows: true]
8889

8990
ExUnit.start(
9091
trace: "--trace" in System.argv(),
9192
assert_receive_timeout: assert_timeout,
92-
exclude: exclude
93+
exclude: epmd_exclude ++ os_exclude
9394
)

lib/mix/test/mix/tasks/release_test.exs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ defmodule Mix.Tasks.ReleaseTest do
265265
end)
266266
end
267267

268+
@tag :epmd
268269
test "executes rpc instructions" do
269270
in_fixture("release_test", fn ->
270271
config = [releases: [permanent1: [include_erts: false]]]

lib/mix/test/test_helper.exs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ Application.put_env(:mix, :colors, enabled: false)
55
Logger.remove_backend(:console)
66
Application.put_env(:logger, :backends, [])
77

8-
exclude = if match?({:win32, _}, :os.type()), do: [unix: true], else: [windows: true]
9-
ExUnit.start(trace: "--trace" in System.argv(), exclude: exclude)
8+
os_exclude = if match?({:win32, _}, :os.type()), do: [unix: true], else: [windows: true]
9+
epmd_exclude = if match?({_, 0}, System.cmd("epmd", ["-daemon"])), do: [], else: [epmd: true]
10+
ExUnit.start(trace: "--trace" in System.argv(), exclude: epmd_exclude ++ os_exclude)
1011

1112
unless {1, 7, 4} <= Mix.SCM.Git.git_version() do
1213
IO.puts(:stderr, "Skipping tests with git sparse checkouts...")

0 commit comments

Comments
 (0)