Properly testing an OTP application after initialization
Paulo F. Oliveira
paulo.ferraz.oliveira@REDACTED
Sun Sep 13 21:07:05 CEST 2020
Hi.
On Sun, 13 Sep 2020 at 18:18, Lincoln Bryant <comradek@REDACTED> wrote:
> Hello list,
>
> I'm writing an OTP application that has many things I would like to
> test _after_ my application has started. The way I'm currently testing
> is to wrap eunit in a utility function that I invoke in the shell,
> which then goes through and does all sorts of stateful things against
> my gen_servers and reports back. This seems to work okay, but seems
> incompatible with e.g. 'rebar3 eunit' and generally seems like it may
> not be the intended way to use the tool.
>
> 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?
>
Have you tried using fixtures (
http://erlang.org/doc/apps/eunit/chapter.html#Fixtures)?
Here's some information with input from Richard Carlsson:
http://erlang.2086793.n4.nabble.com/Eunit-fixtures-can-someone-show-an-example-td2112144.html
.
> Thanks much,
> Lincoln
>
Cheers.
- Paulo F. Oliveira
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20200913/4a5cf928/attachment.htm>
More information about the erlang-questions
mailing list