Skip to content
Run tests

Run tests

The mtracer run command allows you to execute the tests passed as arguments or, if none are provided, all the tests present in the working directory.
The tests are executed sequentially to prevent the configurations of one from interfering with those of the others.

Command execution

mtracer run [test1.mt.yaml] [test2] ... [flags]

You can specify tests with or without the .mt.yaml extension; in both cases, Mtracer will correctly recognize the file.

Furthermore, if no test is specified, all tests present in the current working directory and its subdirectories will be executed.

Flags

The mtracer run command supports the following flags:

  • --count or -c: allows you to specify the number of times to run the tests. If not specified, the tests will be executed only once.
  • --export-to or -e: allows the export of test results in different formats simultaneously by repeating the same flag with a different value. Supported formats are: json, markdown or md and junit.
    Example: mtracer run test1.mt.yaml -e json -e md will export the results in JSON and Markdown formats.
  • --analytics or -a: allows the export of trace and span statistics generated by the executed tests. Multiple export formats can be specified simultaneously by repeating the same flag with a different value. Supported formats are: json and html. You can learn more about this feature on the Exporting statistics page.
  • --dir or -d: allows you to specify the working directory. If not specified, the working directory will be the one from which the command is executed.
  • --verbose or -V: enables detailed output to provide more in-depth information about the test execution.
  • --quiet or -q: disables the output of the executed tests’ results, showing only any errors or warnings.
It is important to know that the paths defined within the tests must be relative to the location of the test file itself, and not to the working directory specified with the --dir flag or where the command is executed.