Running `make test` with a specified seed

33 views
Skip to first unread message

eksperimental

unread,
Oct 19, 2018, 10:06:55 PM10/19/18
to elixir-l...@googlegroups.com
I'm trying to replicate some tests failing in CI,
and I would like to pass a specified seed,
what is the correct way of doing it other than hardcoding it in the source code as I have been
doing up to now.
Thank you

José Valim

unread,
Oct 20, 2018, 3:56:47 AM10/20/18
to elixir-l...@googlegroups.com
The simplest way to do this is by changing Elixir's test_helper.exs files to read the seed from the environemnt variable.


José Valim
Skype: jv.ptec
Founder and Director of R&D


--
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-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/20181020090639.3d881d02.eksperimental%40autistici.org.
For more options, visit https://groups.google.com/d/optout.

eksperimental

unread,
Dec 31, 2018, 8:21:44 AM12/31/18
to elixir-l...@googlegroups.com
On Sat, 20 Oct 2018 09:56:31 +0200
José Valim <jose....@plataformatec.com.br> wrote:

> The simplest way to do this is by changing Elixir's test_helper.exs files
> to read the seed from the environemnt variable.

Sorry, I forgot to answer.
Great advice,
I ended up doing

ExUnit.start(
trace: "--trace" in System.argv(),
assert_receive_timeout: assert_timeout,
exclude: exclude,
seed: System.get_env("EX_UNIT_SEED") |> String.to_integer() || 0
)

In case it's useful to somebody
Reply all
Reply to author
Forward
0 new messages