Page
Library
Module
Module type
Parameter
Class
Class type
Source
Log.clear_error_context_queue
which clears the queue of messages that were skipped but that may still be printed in case of error.Test.current_test_seed_specification
which returns the value of the ~seed
argument of the current test.tezt.scheduler
. It is used internally to replace the scheduler which is used when running tests in parallel with --job-count
. The library is general and flexible enough to be used outside of Tezt however.options
to Runner.t
. It allows to pass additional options to SSH.--job-count N
with N >= 2
, the scheduler now aborts (with SIGTERM and then SIGINT) tests that reach their timeout. This means that even tests that are non-cooperative (do not yield with Lwt) can get killed when using --test-timeout
and/or --global-timeout
.Check.result
breaks the common pattern let result = ... in Check.(result = ...)
. Fix this by renaming the result
variable.--on-empty-test-list
. In particular, --on-empty-test-list ignore
and --on-empty-test-list warn
cause Tezt to exit with code 0 instead of 3 when the list of selected tests is empty.Check.result
to make comparable result types.Check.get_pp
, Check.get_equal
and Check.get_compare
to make it easier to make custom comparable types.Test.current_test_seed
to get the random seed for the test that is currently running.Log.Style
. It provides functions to set the style of timestamps and prefixes in log messages. In particular it allows to disable them.--log-timestamp
, --no-log-timestamp
, --log-prefix
, --no-log-prefix
, and their corresponding values Cli.Logs.timestamp
and Cli.Logs.prefix
.--job-count 2
(-j 2
) or more, Tezt now warns if a test has been running for more than 60 seconds. This delay can be modified or disabled with new command-line option --warn-after-timeout
.--job-count
can now also be specified using the TEZT_JOB_COUNT
environment variable.Process.kill
now sends SIGKILL instead of SIGTERM on Win32.Process.program_path
now uses where.exe
instead of sh
on Win32.Process
module now internally uses Lwt notifications instead of promises to handle process outputs. This makes it work with multiple threads.Process_common
and Echo
to the UNIX backend. Those modules are experimental; their interface may change in future releases and they are not documented in the generated ocamldoc. They are meant for users who want to implement custom versions of the Process
module.--help
.Cli.Selecting_tests.tsl_expression
which would not return the same result after the first time it was called.Cli
module has changed a lot: instead of being all together in a record with mutable fields, command-line argument values are now separate values and are grouped in thematically-related submodules. Types such as log_level
have also moved to those submodules. Those values are usually not used in user-code however, so this is only a breaking change for very niche cases. Functions Cli.get_*
are unchanged, although there is now a better way to define custom command-line arguments.true
and false
are now invalid tags.The JSON
module is now in its own library tezt.json
. This allows one to use the JSON
module of Tezt without linking with Tezt, and in particular without Tezt parsing the command-line.
tezt.core
depends on tezt.json
but does not include the JSON
module itself. If your code accessed Tezt_core.JSON
, you must replace Tezt_core.JSON
with JSON
and you should add tezt.json
as a dependency (especially if your dune-project
contains (implicit_transitive_deps false)
).
tezt
and tezt.js
, however, still include the JSON
module in their interface. If your code only accessed Tezt.JSON
or Tezt_js.JSON
, you have nothing to do.
--loop-count N
and --loop
now always limits the number of iterations to N. Before, --loop-count N --loop
would result in an unbounded number of iterations, while --loop --loop-count N
limited the number of iterations to N.--help
is now much prettier.Stdlib.Arg
. This means that you can now define custom command-line arguments directly using Clap
instead of using Cli.get_*
functions. Such custom command-line arguments do not need to be prefixed with -a
and will appear in --help
.--help
(search for "TSL").Version
with value Version.full
which contains the version number of Tezt.--version
to print the version number of Tezt on standard output and exit.--cleanup-timeout
to be able to specify the delay between SIGTERM and SIGKILL when cleaning up external processes after a test.Test.current_test_file
.Test.current_test_title
.Test.current_test_tags
and Test.current_test_has_tag
.Test.declare_clean_up_function
.--keep-going
was specified.Process
where terminating a process running on a remote runner would not behave the same as terminating a local process. More precisely, the remote process used to only receive SIGKILL. Now it receives SIGTERM then SIGKILL after the timeout delay, which is the behavior for local processes.EBADF
) errors when logging in at_exit
handlers if those at_exit
were declared at the toplevel of modules linked before the Log
module. A rare occurrence since one does not have access to the Log
module in such handlers without some reference hacks.--job
.?seed
argument can break calls to Test.register
which are written using the form Test.register ~__FILE__ ~title ~tags @@ fun () -> ...
. To fix this, either upgrade to OCaml 4.13.0 or later, add ?seed: None
, or replace @@
with parentheses.Test.SCHEDULER.response
changed. This change is very unlikely to impact you unless you wrote your own backend.--match
now applies to both test title and test filename.--starting-port
command-line argument. You can use -a starting-port=
instead.--job
that is empty now results in an error. This means that if you have more jobs than tests in your CI, your CI will fail.--skip
or --only
now results in an error. This makes those command-line arguments behave like other filters.~__FILE__
to Test.register
, instead of just the basename.?seed
to Test.register
and the --seed
command-line parameter to help control the determinism of randomness.--log-worker-ids
which adds worker ids to logs when --job-count
is more than 1.--not-match
to deselect tests with a title that matches a regular expression.--not-file
to deselect tests with a given filename.--time
can now be passed along with --from-record <record.json> --list
to pretty-print timings from previous executions.--file FILE
now selects all tests registered from a source file that ends with FILE
.--not-file FILE
to deselect tests registered from a source file that ends with FILE
.Cli
: added _opt
variants for functions that retrieve custom arguments.--job-count
. In the presence of --job-count N
and --log-file FILE
, test results are now written to FILE
, where as the logs from tests are written in a separate file per worker named BASENAME-WORKER_ID.EXT
, as detailed in --help
.--not-title
does not correspond to any known files.--not-title
.~output_file
of Regression.register
is now optional and has been renamed into ?file
. Previously, ~output_file
was automatically prefixed by the value given to --regression-dir
. Now, files are put in a directory named expected
next to the test itself, and the default filename is a sanitized version of the test title.--regression-dir
command-line parameter.tezt
Dune library was split into tezt.core
and tezt
. Library tezt.core
contains the parts that can run both on UNIX and using Node.js. It does not contain Test.run
though so it cannot be used on its own. Library tezt
is the UNIX backend. It also includes tezt.core
, so this is not a breaking change.tezt.js
is a partial backend for Node.js. Compared to tezt
, it does not contain modules Process
, Temp
and Runner
.--resume
(short-hand: -r
) and --resume-file
, which allow to resume a previous run. For instance, if the previous run stopped after a failed test, and if that previous run was itself ran with --resume
or --resume-file
, resume from this run to avoid running the tests that already succeeded again.--match
(short-hand: -m
) to select tests with a title that match a regular expression.?timeout
argument to Process.terminate
and Process.clean_up
. These functions send SIGTERM
to processes. If this timeout is reached without the process actually terminating, Process.terminate
also sends SIGKILL
.Diff
which allows to compare two sequences. It is used internally by the Regression
module to compare test outputs between runs.Main
with function Main.run
, which is the same as Test.run
. In practice you can still use Test.run
, which now delegates to Main.run
. But Test.run
is not available in tezt.core
, only in tezt
and tezt.js
. This is not a breaking change since existing applications would use tezt
, not tezt.core
directly.Base.project_root
which is the path to the root of the current dune project according to environment variable DUNE_SOURCEROOT
, falling back to the current directory if unavailable.Base.span
to split a list in two sublists given a predicate.Base.rexf
, a short-hand for rex @@ sf
.Check.file_exists
, Check.file_not_exists
, Check.directory_exists
and Check.directory_not_exists
.Check.is_true
and Check.is_false
.Check.json
and Check.json_u
, type definitions for JSON.t
and JSON.u
respectively.int32
in the JSON
module.JSON.merge_objects
, JSON.filter_map_object
and JSON.filter_object
.JSON.equal
and JSON.equal_u
, equality predicates on JSON.t
and JSON.u
respectively.Temp.set_pid
. The Temp
module no longer calls Unix.getpid
directly, this is done by Test.run
instead, which calls Temp.set_pid
. This allows backends where Unix.getpid
cannot be used, like JS.Test.run_with_scheduler
, and the Test.SCHEDULER
signature. Added Test.get_test_by_title
and Test.run_one
. Those functions are used internally to provide different backends (UNIX / JS), but users usually would not have any use for them.--record
became optional, with default values. New records may not be compatible with old versions of Tezt.Process_hooks
which contains the type definition for Process.hooks
.Temp.clean_up
no longer follows symbolic links, it just deletes the links themselves.--junit
which no longer worked when using -j
.--loop-count 0
which did not actually run zero loops.--on-unknown-regression-files delete
or --on-unknown-regression-files fail
.Temp
module.--help
.Tezt 2.0.0 was the first announced release and as such it had no changelog. Tezt 1.0.0 was released in opam but was not announced.