[erlang-questions] Application dependencies in Common Test?

Mikael Karlsson karlsson.rm@REDACTED
Tue May 28 22:23:43 CEST 2019


Tue 28 May 2019  17:34 Roger Lipscombe <roger@REDACTED> wrote:
>
> We run a bunch of system tests using Common Test, orchestrating
> (currently) 9 Erlang nodes, 4 golang processes, and 4 NodeJS
> processes.
>
..
>
> We run the tests by invoking ct_run, something like this (trimmed for size):
>
>         ct_run -pa _build/dev/lib/*/ebin \
>                 -include $(abspath include) \
>                 -dir $(SUITES_DIR) \
>                 -ct_hooks $(CT_HOOKS) \
>                 -erl_args \
>                 -config sys.config \
>                 -s system_tests
>
> In order to start the dependencies (hackney, cowboy, etc.), we use "-s
> system_tests" (as above), where system_tests:start/0 looks like this:
>
>     start() -> {ok, _} = application:ensure_all_started(system_tests).
>
> ...and we have system_tests.app list our dependencies.
>
...
> Is there a better way to do this?
>
...
> Thanks,
> Roger.

If it doesn't take to much time to start and configure the
dependencies maybe an option would be to add them in init_per_suite
(and teardown in end_per_suite). And/or in the ct_hooks themselves.
Probably more code duplication but the dependencies would be
configured closer to the separate tests. The ct_hooks seem also to be
installable from the suite (suite/0 and init_per_suite/1) if that
helps.

Best Regards
Mikael



More information about the erlang-questions mailing list