Skip to content

Rust adapter: select tests by crate dependency #59

Closed

Description

@adityankale190895

Part of the Rust (Cargo) adapter: #62.

Select tests at the crate level: a change inside crate a should run the tests of a and of every workspace crate that depends on a, and nothing else.

Scope

  • Use cargo metadata --format-version 1 (with dependencies) to read path dependencies between workspace members, including dev-dependencies.
  • Emit edges so that each crate's test files depend on the source files of the crates they build on (directly or transitively).
  • Changes to a member's Cargo.toml affect that crate and its dependents. A change to the workspace Cargo.toml or Cargo.lock runs everything for now.

Must fall back (blocker)

  • A build.rs in the changed crate, since it can read arbitrary files.
  • include!, include_str! or include_bytes! pointing outside the crate.
  • Feature-dependent code (#[cfg(feature = ...)]) isn't a blocker by itself, but say in the PR how it's handled.

Done when

  • Fixtures cover: change in a leaf crate, change in a crate others depend on, an unrelated crate, a build.rs change that falls back, and a Cargo.lock change that falls back.

File-level selection inside a crate (mod/use) is a later step; crate level already saves most of the time in workspaces.

Safety rule: when the adapter is unsure, it adds a blockers entry so DiffCI runs the full suite. An empty graph must never look like "nothing affected".


New to DiffCI? Read the adapter guide and CONTRIBUTING.md. Sign off commits with git commit -s. Comment here to claim it, and ask questions on the issue at any point.

Activity

  1. added
    enhancement
    help wanted
    on Oct 29, 2026
  2. FredApps commented on Nov 10, 2026

    @FredApps
    Contributor

    I'll take this after the #58 mapping foundation. The implementation uses Cargo's resolved crate dependencies, including dev-dependencies and an all-features metadata union, with conservative full-run blockers for build scripts, procedural macros, unresolved inputs and external/computed includes.

  3. adityankale190895 commented on Nov 16, 2026

    @adityankale190895
    MemberAuthor

    Done in #92 (squash-merged as b079713): Rust tests are now selected through Cargo crate dependencies, including the follow-up fix for paths built in code that climb out of a crate. Remaining Rust work is tracked in #62.

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

    adapterenhancementhelp wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions