Skip to content

Create a tool which suggests tests to run based on modified files #97339

Open
@jyn514

Description

@jyn514

@digama0 came up with an excellent idea: it should be possible to, given the files modified since your git checkout last branched from master, generate suggestions for the tests you should run (i.e. those most likely to fail because of your changes). Some examples:

  • library/std/src/lib.rs => x test --stage 0 tidy library/std
  • compiler/rustc_data_structures => x check && x test --stage 0 tidy compiler/rustc_data_structures && x test --stage 1 src/test/ui src/test/run-make
  • src/librustdoc/src/lib.rs => x test --stage 1 tidy rustdoc

You can determine the files modified with git diff --name-only $(git merge-base HEAD origin/master).

This tool doesn't necessarily need to live in tree - it could just be some crate in a public git repo that people install, and we can move it in-tree later if it's useful. I was imagining it could be called suggest-tests or something like that.

@rustbot label +E-medium +E-mentor +E-help-wanted +A-testsuite +A-contributor-roadblock

This issue has been assigned to @Ezrashaw via this comment.

Metadata

Metadata

Assignees

Labels

A-contributor-roadblockArea: Makes things more difficult for new or seasoned contributors to RustA-testsuiteArea: The testsuite used to check the correctness of rustcE-help-wantedCall for participation: Help is requested to fix this issue.E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions