Disable empty Cargo test targets#21584
Conversation
Co-authored-by: Codex <noreply@openai.com>
|
We might need to write some sort of linter to enforce this, e.g., if you add a doctest to one of these crates then you might expect it to run in CI but it won't :/ |
|
|
|
Great work, boss. |
|
@charliemarsh-oai I'm supportive, but FYI, we have this script that is run as part of CI: https://github.com/openai/codex/blob/main/.github/scripts/verify_cargo_workspace_manifests.py#L19 to ensure that all So whatever behavior you want to enforce, can you please codify there? It would be nice to ensure we are setting FYI, |
|
@bolinfest -- Thanks! I know we run |
|
@charliemarsh-oai ah, thanks for the additional context: approving! |
Summary
cargo testhas entails both running standard Rust tests and doctests. It turns out that the doctest discovery is fairly slow, and it's a cost you pay even for crates that don't include any doctests.This PR disables doctests with
doctest = falsefor crates that lack any doctests.For the collection of crates below, this speeds up test execution by >4x.
E.g., before this PR:
And after:
For a single crate, with >2x speedup, before:
And after: