Skip to content
Permalink
Browse files

Only run tests if epmd is available, closes #9167

  • Loading branch information...
josevalim committed Jul 10, 2019
1 parent 418c277 commit 9797a466fc6cc9afcc30b35010dec4dd642c410a
@@ -5,7 +5,7 @@ defmodule NodeTest do

doctest Node

@tag :unix
@tag :epmd
test "start/3 and stop/0" do
assert Node.stop() == {:error, :not_found}
assert {:ok, _} = Node.start(:hello, :shortnames, 15000)
@@ -84,10 +84,11 @@ defmodule CodeFormatterHelpers do
end

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

ExUnit.start(
trace: "--trace" in System.argv(),
assert_receive_timeout: assert_timeout,
exclude: exclude
exclude: epmd_exclude ++ os_exclude
)
@@ -265,6 +265,7 @@ defmodule Mix.Tasks.ReleaseTest do
end)
end

@tag :epmd
test "executes rpc instructions" do
in_fixture("release_test", fn ->
config = [releases: [permanent1: [include_erts: false]]]
@@ -5,8 +5,9 @@ Application.put_env(:mix, :colors, enabled: false)
Logger.remove_backend(:console)
Application.put_env(:logger, :backends, [])

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

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

0 comments on commit 9797a46

Please sign in to comment.
You can’t perform that action at this time.