View Source Enfiladex.Suite (enfiladex v0.1.0)

Enfiladex is the drop-in Common Test wrapper for Elixir.

@enfiladex_strategy attribute can be set before each describe/2 call to one of the following values:

  • [] (empty list / no option)
    • The test cases in the group are run one after the other. If a test fails, the others after it in the list are run.
  • :shuffle
    • Runs the test in a random order. The random seed (the initialization value) used for the sequence will be printed in the HTML logs, of the form {A,B,C}. If a particular sequence of tests fails and you want to reproduce it, use that seed in the HTML logs and change the shuffle option to instead be {shuffle, {A,B,C}}. That way you can reproduce random runs in their precise order if you ever need to.
  • :parallel
    • The tests are run in different processes. Be careful because if you forget to export the init_per_group and end_per_group functions, Common Test will silently ignore this option.
  • :sequence
    • Doesn't necessarily mean that the tests are run in order, but rather that if a test fails in the group's list, then all the other subsequent tests are skipped. This option can be combined with shuffle if you want any random test failing to stop the ones after.
  • {:repeat, times}
    • Repeats the group Times times. You could thus run all test cases in the group in parallel 9 times in a row by using the group properties [parallel, {repeat, 9}]. Times can also have the value forever, although 'forever' is a bit of a lie as it can't defeat concepts such as hardware failure or heat death of the Universe (ahem).
  • {:repeat_until_any_fail, n}
    • Runs all the tests until one of them fails or they have been run N times. N can also be forever.
  • {:repeat_until_all_fail, n}
    • Same as above, but the tests may run until all cases fail.
  • {:repeat_until_any_succeed, n}
    • Same as before, except the tests may run until at least one case succeeds.
  • {:repeat_until_all_succeed, n}
    • I think you can guess this one by yourself now, but just in case, it's the same as before except that the test cases may run until they all succeed.

Common Test for Uncommon Tests

Summary

Functions

Link to this macro

describe(message, list)

View Source (macro)

Hello world.

Examples

iex> Enfiladex.hello()
:world
Link to this function

on_exit(name_or_ref \\ make_ref(), callback)

View Source
@spec on_exit(term(), (-> term())) :: :ok
Link to this macro

setup(context, block)

View Source (macro)
Link to this macro

setup_all(block)

View Source (macro)
Link to this macro

setup_all(context, block)

View Source (macro)
Link to this macro

test(message, var \\ quote do _ end, contents)

View Source (macro)