Re: Properly testing an OTP application after initialization

Nicolas Martyanoff <[email protected]>
Newsgroups gmane.comp.lang.erlang.general
Message-ID <20200913172831.GA1460@valhala>
On 2020-09-13 12:17, Lincoln Bryant wrote:
> Now that I want to start wiring the testing framework up to my CI
> tool, I am wondering if I should do something like start my
> application, connect a shell to it, run my tests, and shut down? or
> should I take a step back entirely and consider using something like
> Common Test instead?

You could start your application before the tests and stop it after. EUnit
supports fixtures[1] to do just that.

If you use them, you do not need to do anything with a shell and tests can be
run in a fully automated way.

[1] https://erlang.org/doc/apps/eunit/chapter.html#Fixtures

-- 
Nicolas Martyanoff
http://snowsyn.net
[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.