Attribute Macro test

Source
#[test]
Expand description

This attribute wraps any existing test attribute (e.g. tokio::test or test) to configure tracing

Example:

#[lance_test_macros::test(tokio::test)]
async fn test_something() {
 ...
}

By default this wrapper will do nothing. To then get tracing output, set the LANCE_TRACING environment variable to your desired level (e.g. “debug”).

Example:

LANCE_TRACING=debug cargo test dataset::tests::test_create_dataset

A .json file will be generated in the current directory that can be loaded into chrome://tracing or the perfetto UI.

Note: if multiple tests are wrapped and you enable the environment variable then you will get a separate .json file for each test that is run. So generally you only want to set the environment variable when running a single test at a time.