Commit Graph
1577 Commits
Author SHA1 Message Date
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
andremaker a5bdf8a881 Mention that receive/1 and ExUnit.Assertions.assert_receive/4 consumes/removes messages (#14743) 2025-09-03 08:38:32 +02:00
José Valim 848fc1d6df Raise if message in AssertionError is not a binary
Closes #14695.
2025-08-31 10:04:37 +02:00
Eksperimental dd45d9666f Use backticks around literals in documentation (#14733) 2025-08-30 19:28:10 +02:00
Eksperimental 9ae79d1385 Format numbers with underscores to improve readability (#14735) 2025-08-30 19:25:48 +02:00
Eksperimental 927f91c9fe Fix order in ExUnit results when listing pinned variables (#14723)
The pinned variables were returned in a random order (often reversed):

     test/ex_unit_pinned_variables_order_test.exs:23
     match (=) failed
     The following variables were pinned:
       var_d = "four"
       var_c = "three"
       var_b = "two"
       var_a = "one"
     code:  assert %{a: ^var_d, b: ^var_c, c: ^var_b, d: ^var_a} = build(var_a, var_b, var_c, var_d)
     left:  %{a: ^var_d, b: ^var_c, c: ^var_b, d: ^var_a}
     right: %{a: "one", b: "two", c: "three", d: "four"}
     stacktrace:
       test/ex_unit_pinned_variables_order_test.exs:29: (test)

This fix sorts them alphabetically.

This bug was introduced in 884e93391e when the pinned vars were now accumulated in a map (instead
of a list).

A repo replicating the issue can be found here:
- https://github.com/eksperimental-debug/elixir_debug/tree/ex-unit-pinned-variables-order
- https://github.com/eksperimental-debug/elixir_debug/blob/ex-unit-pinned-variables-order/ex_unit_pinned_variables_order/test/ex_unit_pinned_variables_order_test.exs
2025-08-27 08:06:14 +02:00
Eksperimental f93919f54a ExUnit: Raise explaining what failed on invalid tags (#14707) 2025-08-08 08:43:30 +02:00
Jean Klingler 67042e8770 Stop propagating generated on macro arguments (#14696)
* Stop propagating generated on macro arguments

* Explicitly mark assert as generated
2025-08-07 05:54:41 +09:00
José Valim 8bdd277b0e Improve ExUnit docs 2025-07-26 11:06:37 +02:00
Noah Betzen 677e1ec8b1 Add mix test --dry-run flag (#14499) 2025-07-11 09:49:47 +02:00
Eksperimental 352f2723a9 Use backticks around literals in documentation (#14633) 2025-07-10 09:36:20 +02:00
Łukasz Samson e3f7759fde Replace keyword with concrete keyword lists in specs (#14611) 2025-06-30 17:24:28 +02:00
José Valim 09dcbf7566 Introduce deprecations scheduled for Elixir v1.20 2025-06-07 21:55:06 +02:00
José Valim 51e160e6f8 Add OTP 28 to CI (#14510) 2025-05-21 13:48:13 +02:00
Matt Enlow c3d33410ec Parameterize violates the "never run concurrently" async docs (#14492) 2025-05-13 12:37:26 +02:00
José Valim 87dd05e5fd Preserve files with no line filter on mix test
Before this patch, if you invoked:

    mix test test/foo_test.exs:13 test/bar_test.exs

We would include a location filter only for foo_test.exs
and no tests in bar_test.exs would run. We now ensure
that the full location of files with line filters are
included as tags, as long as any file is included.

Closes #14445.
2025-04-25 15:33:43 +02:00
Rudolf Manusadzhian 7b8bcb98be Add missing parameters field to ExUnit.Test struct type (#14446) 2025-04-22 14:18:23 +02:00
José Valim 920a6a0a42 Consistenly apply timeouts across suites (#14444)
Closes #14443.
2025-04-18 12:11:12 +02:00
Rudolf Manusadzhian 7e6e7008f9 Add group to the test context (#14440) 2025-04-17 09:39:44 +02:00
Jonatan Männchen f3e8ceb5aa Implement Test Coverage Reporting (#14343) 2025-04-07 22:37:01 +02:00
Andrea LeopardiandJosé Valim 441cf7d2f1 Add warning to the docs for start_link_supervised!/2 (#14374)
Co-authored-by: José Valim <jose.valim@dashbit.co>
2025-03-28 10:07:21 +01:00
Andrea Leopardi 7b71138da2 Add Mermaid graph about ExUnit processes (#14372) 2025-03-27 21:37:28 +01:00
Steffen Deusch b08eea70e5 Prevent exits from leaking in ExUnit.CaptureServer (#14348)
When a process that traps exits used ExUnit's log capture functionality,
it would receive stray exits from the Tasks started inside it that could
lead to issues if not handled.
2025-03-19 16:51:28 +01:00