mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 10:58:28 +00:00
Allow profiling tests with tracing instrumentation (#2957)
To get more insights into test performance, allow instrumenting tests
with tracing-durations-export.
Usage:
```shell
# A single test
TRACING_DURATIONS_TEST_ROOT=$(pwd)/target/test-traces cargo test --features tracing-durations-export --test pip_install_scenarios no_binary -- --exact
# All tests
TRACING_DURATIONS_TEST_ROOT=$(pwd)/target/test-traces cargo nextest run --features tracing-durations-export
```
Then we can e.g. look at
`target/test-traces/pip_install_scenarios::no_binary.svg` and see the
builds it performs:

This commit is contained in:
parent
c4472ebbb9
commit
15f0be8f04
7 changed files with 63 additions and 24 deletions
|
@ -1063,7 +1063,7 @@ impl<'a, T: BuildContext> SourceDistributionBuilder<'a, T> {
|
|||
/// Build a source distribution, storing the built wheel in the cache.
|
||||
///
|
||||
/// Returns the un-normalized disk filename, the parsed, normalized filename and the metadata
|
||||
#[instrument(skip_all, fields(dist))]
|
||||
#[instrument(skip_all, fields(dist = %source))]
|
||||
async fn build_distribution(
|
||||
&self,
|
||||
source: &BuildableSource<'_>,
|
||||
|
@ -1116,7 +1116,7 @@ impl<'a, T: BuildContext> SourceDistributionBuilder<'a, T> {
|
|||
}
|
||||
|
||||
/// Build the metadata for a source distribution.
|
||||
#[instrument(skip_all, fields(dist))]
|
||||
#[instrument(skip_all, fields(dist = %source))]
|
||||
async fn build_metadata(
|
||||
&self,
|
||||
source: &BuildableSource<'_>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue