Commit Graph
1599 Commits
Author SHA1 Message Date
Jechol Lee 360ed75d17 Mix test parameters into the per-test :rand seed (#15869)
ExUnit seeds each test process with {phash2(module), phash2(name), seed}.
parameterize re-runs the module per parameter set without changing the
test name, so every parameter set of a test started from the same :rand
state and drew the same random sequence.

Hash the parameters together with the name when they are present. Tests
without parameters keep their previous seed, so existing --seed
reproductions are unaffected.

Assisted-by: Claude Code:claude-fable-5-1

Signed-off-by: Jechol Lee <mr.jechol@gmail.com>
2026-09-08 13:11:39 +02:00
Tobias Pfeiffer 936078255d Do not overlap sibling failures in parameterized tests failures manifest
Fixes #15820
2026-09-02 21:22:03 +02:00
Kuba Migdał 4d242a8c3d Sanitize ExUnit formatters against invalid UTF-8 (#15821) 2026-09-01 15:05:16 +02:00
Barna Kovacs 6a44ab621a Remove unused parameters in Myers list diff (#15822) 2026-09-01 00:59:35 +02:00
Tiago Moraes dbd2fadba1 Simplify CaptureLog formatter test (#15810) 2026-08-30 19:06:32 +02:00
José Valim 3389f84059 Fix more warnings during test suite runs 2026-08-25 13:53:28 +02:00
Alexander Gubarev e20ca7e788 Clarify ExUnit --slowest-modules switch header (#15660) 2026-07-23 18:36:26 +02:00
Alexander Gubarev f08dff3536 Fix ExUnit.RunnerStats.increment_failure_counter/2 spec (#15659) 2026-07-23 18:20:47 +02:00
José Valim 5d2ac0ca69 Make monitored test check more reliable 2026-07-23 09:00:30 +02:00
Alexander Gubarev f16d8d290f Fix ExUnit configure_opts swapped doc defaults (#15634) 2026-07-18 21:50:55 +02:00
Alexander Gubarev 6689fc1ff4 Fix ExUnit.EventManager calling Supervisor on DynamicSupervisor (#15633) 2026-07-18 17:36:11 +02:00
Alexander Gubarev 51ac6a5c0f Fix refute_in_delta boundary logic and negative delta (#15623) 2026-07-16 19:09:17 +02:00
Alexander Gubarev f2ad598ca3 Fix ExUnit StringIO processes leak when named device capture failed (#15621) 2026-07-16 17:29:21 +02:00
Alexander Gubarev 1bfa86baf3 Fix ExUnit doc wordings and func links (#15618) 2026-07-16 15:08:49 +02:00
Jean Klingler bec8d39796 Add :migrate_atom_interpolations option to formatter (#15531) 2026-07-02 08:04:25 +09:00
José Valim 46c461e617 Expand defguard per guard and expression
Closes #15450.
Closes #15284.
2026-06-24 13:07:43 +02:00
José Valim afedada0d1 Clarify state is the failed state 2026-06-18 09:15:38 +02:00
José Valim 1ac9007bae Fix race condition in test 2026-06-17 10:53:12 +02:00
Jean Klingler 83e9b66e65 Add to_unsafe_atom/1 and soft-deprecate to_atom/1 (#15494) 2026-06-16 20:50:11 +09:00
Henrik Tudborg 56bc730a2a Avoid using Keyword.pop/2 in ExUnit.Diff.struct_module/2 (#15489)
`struct_module` is being called for both structs and maps.
`diff_quoted_struct` uses the return of `struct_module` to determine
when to call `diff_quoted_struct` or `diff_map`.
2026-06-16 11:10:58 +02:00
Steffen Deusch 1cb62b731c Add trace helper to ExUnit.Assertions (#15432) 2026-06-08 14:17:55 +02:00
Łukasz Samson 92de556716 Fix spec of ex_unit capture_log options (#15417)
Passing `formatter: nil` was never supported and crashes.
2026-05-23 21:03:22 +02:00
Evadne Wu b58e843528 Scope ExUnit diff width tests (#15396) 2026-05-16 01:27:33 +02:00
José Valim aae39c87dc Fix warnings 2026-05-12 14:49:36 +02:00
José Valim b8a9dc60a5 Explicitly raise instead of calling assert(false) 2026-04-25 17:47:25 +02:00
Gary Rennie 5b97e9c132 Show remaining runs when using --repeat-until-failure (#15270)
The --repeat-until-failure can be very useful for finding flaky tests,
however sometimes it is hard to gauge how long it has left to run before
it can be considered successful.

This commit adds a small output showing the number of remaining runs
when the `--repeat-until-failure` flag is used.

It looks like:

```
Running ExUnit with seed: 382462, max_cases: 32, remaining_runs: 3
Excluding tags: [windows: true]

.......
Finished in 0.02 seconds (0.00s async, 0.02s sync)

Result: 7 passed
Running ExUnit with seed: 422319, max_cases: 32, remaining_runs: 2
Excluding tags: [windows: true]

.......
Finished in 0.00 seconds (0.00s async, 0.00s sync)
```
2026-04-15 09:46:55 +02:00
José Valim c1256f161c Clarify shut down order in ExUnit, closes #15236 2026-04-05 09:46:06 +02:00
José Valim 03b9fde67a Allow test names longer than 255 characters 2026-03-29 09:13:46 +02:00
José Valim a24d3ff221 Avoid false positives when diffing bitstrings, closes #15204 2026-03-25 08:20:05 +01:00
José Valim 2e7a49d426 Abort diffing on binary patterns, closes #15191 2026-03-13 18:25:07 +01:00
José Valim a064a00601 Fix CI and improve ExUnit results 2026-03-11 11:19:51 +01:00
Andrea Leopardi 352bc46c8e Improve ExUnit failure/success output (#15168) 2026-03-11 08:27:58 +01:00
Jean Klingler 2817a70680 Remove mentions to OTP27+ versions from docs, comments and tests (#15165)
* Remove mentions of "since OTP27+"

* Remove test code for OTP26-
2026-03-10 15:39:03 +09:00
José Valim 0ea809e720 Check redundant clauses for definitions (#15124) 2026-03-02 17:19:51 +01:00
Eksperimental 677afeced3 Improve typespecs for t:ExUnit.configure_opts/0 (#15117)
`:exclude`/`:include` can be:
- an atom
- a list of atoms and keyword elements
2026-02-27 08:48:20 +01:00
Eksperimental 2292f3bcb6 Improve docs for Filters in ExUnit (:exclude and :include configuration) (#15118) 2026-02-27 08:47:54 +01:00
Michał Łępicki 6d5f43318c Allow specifying SEED when running tests (#15111)
this is helpful when reproducing flaky test failures
2026-02-25 09:12:15 +01:00
Andrea Leopardi 5abc024203 Fix doc link in ExUnit.Formatter 2026-01-05 08:52:08 +01:00
José Valim c35f651309 Analyze conditional orelse and when 2026-01-03 13:38:38 +01:00
José Valim f1bbb2cd32 Infer types from guards and do post-inference on stdlib (#15032)
We now infer types from guards although we don't
yet infer conditional types (such as on `or`).
2026-01-02 19:48:45 +01:00
Andrea Leopardi b79b08d819 Fix spec for t:ExUnit.Callbacks.child_spec_overrides/2 (#15006) 2025-12-09 08:14:05 -05:00
Łukasz Samson 0055f2fe53 Fix ex_unit formatter crash when find_diff returns nil (#14939) 2025-11-21 05:33:48 -08:00
José Valim 47aab3b37c Ensure parallel matches in assert propagate type information, closes #14921 2025-11-18 15:19:57 -08:00
Austin Ziegler 5732283ada Add :formatter to ExUnit.CaptureLog options (#14914)
Mostly modified `:log_capture_on` handler for ExUnit.CaptureServer to
respect a `:formatter` option instead `Logger.default_formatter/1`.

Updates were made to documentation and tests to reflect this change.
2025-11-17 12:34:31 -08:00
José Valim 6f26bb0b05 Simplify format stacktrace handling 2025-11-13 13:10:44 +01:00
Łukasz Samson ee469e56e6 Fix crash when format_kind_reason is executed with TestModule (#14901)
Closes #14900.
2025-11-13 13:05:09 +01:00
José Valim 7eb5b3ae17 Reset ansi escapes before newlines in Logger
Closes #14855
Closes #14841
2025-10-24 12:19:14 +02:00
José Valim 977efeac99 Do not crash on empty test unit groups, closes #14754 2025-10-07 11:12:33 +02:00
José Valim c6d3e48474 Fix regression on direct raise of ExUnit.AssertionError 2025-10-04 21:40:52 +02:00
Nathan Long 95265ba1c2 ExUnit sets a process label for each test (#14758) 2025-09-09 21:53:07 +02:00