Skip to content

x.py check should check tests by default #87846

@kornelski

Description

@kornelski
Contributor

It's possible to have errors in files such as: library/std/src/collections/hash/map/tests.rs and library/alloc/tests/lib.rs, and have ./x.py check pass.

I would expect x.py check to be equivalent of cargo check --all and check every file that CI checks. Otherwise, I run x.py check, push code to a PR, and only find later that I have a typo or such.

Activity

Mark-Simulacrum

Mark-Simulacrum commented on Aug 7, 2021

@Mark-Simulacrum
Member

We don't check tests by default, but you can pass --all-targets (x.py check --all-targets) to check tests. I believe this is consistent with cargo check behavior?

One reason we don't check tests by default is that causes duplicate error messages for the 'base' crate typically which are annoying (and most changes don't actually need them). If Cargo handled that and didn't show duplicate messages, I imagine we could change the default as well.

kornelski

kornelski commented on Aug 7, 2021

@kornelski
ContributorAuthor

Oh, you're right. So my mistake was assuming that cargo check is more thorough than it is (my text editor invokes it for me, even for tests, so I didn't realize the command doesn't do everything itself).

ehuss

ehuss commented on Aug 7, 2021

@ehuss
Contributor

If Cargo handled that and didn't show duplicate messages

Just FYI, 1.55 now deduplicates messages.

Mark-Simulacrum

Mark-Simulacrum commented on Aug 8, 2021

@Mark-Simulacrum
Member

Oh, great news @ehuss -- in that case I'm going to go ahead and reopen this as it seems likely to make sense to check tests (by default, and likely without an option to disable that). Should be a pretty simple adjustment to bootstrap.

changed the title [-]`x.py check` does not check tests[/-] [+]`x.py check` should check tests by default[/+] on Aug 13, 2021
added 2 commits that reference this issue on Aug 16, 2021
d843de5
fe71be7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @ehuss@kornelski@Mark-Simulacrum

      Issue actions

        `x.py check` should check tests by default · Issue #87846 · rust-lang/rust