/ct_containers

A poor mans erlang port of the great java testcontainers.org library

Primary LanguageErlangApache License 2.0Apache-2.0

ct_containers

A simplified erlang port of testcontainers.

Usage

ct_containers can either be used as a common test hook or by manually starting containers in test fixtures.

ct_hook:

suite() ->
    [{timetrap, {minutes, 5}},
     {ct_hooks,
      [{ct_containers_hook,
        [#{lifecycle_per => suite,
           containers =>
               [#{name => httpbin,
                  image => "kennethreitz/httpbin:latest",
                  options =>
                      [{ports, [{80, tcp}]},
                       {wait_strategy,
                        ct_containers_wait:regex(".*Listening at*.")},
                       {timeout, 60000},
                       {network, {some_network, "some_alias"}}]}]}]}]}].