Skip to content

Running doc tests are slow due to being always being recompiled #2944

Open
@Marwes

Description

Originally spawned by an issue to rust-skeptic which has the same problem.

Testing my combine library which has 44 doc tests and 36 normal tests takes ~26 seconds with ~22 of those being spent in doc tests. From what I can tell this is because cargo recompiles these tests every time cargo test is run in addition to each test being compiled individually.

I am thinking this is for a good reason since it makes sure two doc tests cannot conflict with each other but it would be nice if it could be improved.

Metadata

Assignees

No one assigned

    Labels

    A-cachingArea: caching of dependencies, repositories, and build artifactsA-doctestsArea: rustdoc --testC-enhancementCategory: enhancementCommand-testPerformanceGotta go fast!S-blocked-externalStatus: ❌ blocked on something out of the direct control of the Cargo project, e.g., upstream fix

    Type

    No type

    Projects

    • Status

      No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions