We also do a similar setup in firenest test suite:
https://github.com/phoenixframework/firenest/blob/master/test/shared/test.ex



*José Valimwww.plataformatec.com.br
<http://www.plataformatec.com.br/>Founder and Director of R&D*

On Wed, Feb 14, 2018 at 10:29 PM, Paul Schoenfelder <
paulschoenfel...@gmail.com> wrote:

> Have you tried simply running `Application.load(:app)` or
> `Application.ensure_all_started(:app)`? That should work. If not, it
> probably means the code path is not configured correctly and you'll need to
> make sure the code starting the nodes passes in `-pa
> _build/<env>/lib/*/ebin`. As for why the Mix project isn't loaded, I
> suspect that has to do with the fact that Mix is being bypassed during
> startup, and so whatever it does internally isn't happening - that's fine,
> and expected in this context, but I'm not sure if there is a sane way to
> initialize Mix post-start. The way releases boot is very similar, and
> applications are explicitly loaded/started in dependency order after the VM
> is initialized.
>
> Paul
>
> On Wed, Feb 14, 2018 at 2:31 PM, pragdave <pragd...@gmail.com> wrote:
>
>> I’ve trying to create a kind of runner for a set of components, where
>> each component runs on a separate node, and each component is an
>> independent application.
>>
>> I’ve stolen code from the swarm cluster tests, and I’m successfully
>> creating nodes which seem to contain the Elixir runtime.
>>
>> As I initialize each node, I make it File.cd into the application’s
>> directory.
>>
>> However, inside the node, it can’t find the mix.exs file, and so I can’t
>> load the app and its dependencies.
>>
>> Here we are after doing a user switch into the slave node:
>>
>> iex(wombat@127.0.0.1)5> *ls*
>> .git           .gitignore     README.md      _build         assets         
>> config
>> deps           lib            *mix.exs*        mix.lock       test
>> iex(wombat@127.0.0.1)6> *Mix.Project.get*
>> nil
>>
>> It feels like I’m making this too difficult: there must be an easier way
>> to kick off applications. If not, any ideas on my directory issue?
>>
>> Cheers
>>
>> Dave
>> ​
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "elixir-lang-core" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to elixir-lang-core+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/elixir-lang-core/a744b3ae-3189-4f26-8371-c471f0914866%
>> 40googlegroups.com
>> <https://groups.google.com/d/msgid/elixir-lang-core/a744b3ae-3189-4f26-8371-c471f0914866%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "elixir-lang-core" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to elixir-lang-core+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/elixir-lang-core/CAK%3D%2B-TvLmkHtHKvg-DfpRbTH1fdTp9LRJ4ured4SncB%
> 3Dos_bUw%40mail.gmail.com
> <https://groups.google.com/d/msgid/elixir-lang-core/CAK%3D%2B-TvLmkHtHKvg-DfpRbTH1fdTp9LRJ4ured4SncB%3Dos_bUw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elixir-lang-core+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4KQs0cN8FD5Z4OmoSsByVJUM%2Bvj5s_5tezpk7t25vNLHg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to