# Running eunit tests in a separate node?

**URL:** <https://erlangforums.com/t/running-eunit-tests-in-a-separate-node/5466>\
**Category:** Questions / Help\
**Tags:** eunit\
**Created:** [February 28, 2026, 5:21pm UTC](https://erlangforums.com/t/running-eunit-tests-in-a-separate-node/5466 "2026-02-28T17:21:30Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![rlipscombe](https://erlangforums.com/user_avatar/erlangforums.com/rlipscombe/32/459_2.png) [@rlipscombe](https://erlangforums.com/u/rlipscombe)\
**Post date:** [February 28, 2026, 5:26pm UTC](https://erlangforums.com/t/running-eunit-tests-in-a-separate-node/5466/2 "2026-02-28T17:26:46Z")

</div>

Got it, but it’s ugly, because of [Eunit: {node, ... instantiator broken in OTP-28.x](https://erlangforums.com/t/eunit-node-instantiator-broken-in-otp-28-x/5465) , and because of the need to copy the code search path:

```erlang
-module(node_test).
-include_lib("eunit/include/eunit.hrl").

node_spawn_test_() ->
    {node, 'foo', fun({Pid, _}) ->
        Node = get_peer_node(Pid),
        erpc:call(Node, code, set_path, [code:get_path()]),

        {spawn, Node, [
            {setup, fun remote_setup/0, [
                fun remote/0
            ]}
        ]}
    end}.

get_peer_node(Pid) ->
    gen_server:call(Pid, get_node).

remote_setup() ->
    ?assertEqual(moo, node()).

remote() ->
    ?assertEqual(moo, node()).

```

---

_[View the full topic](https://erlangforums.com/t/running-eunit-tests-in-a-separate-node/5466)._
