rust-lang / rust-lang/rust

Tracking Issue for compiletest documentation

Open
#125,706 1 comment 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-compiletest A-docs A-testsuite C-tracking-issue E-help-wanted T-bootstrap T-compiler
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

Context

compiletest is the main test harness of rustc and other tools inside this repository, but there is a significant lack of documentation for it. We should write some documentation for compiletest. There are some documentation in rustc-dev-guide, but compiletest is a lot more complex than that.

Areas lacking documentation
  • High-level architecture and overview
  • Interaction between bootstrap <-> compiletest <-> tests
  • compiletest-as-a-binary: CLI interface options and docs
  • Filtering tests
  • How are test modes and test suites created, registered, built and run
    • When can tests be ignored? cached test results and their invalidation: dependency stamps
    • Some test mode / test suite tests can be run in parallel / concurrently:
      • Concurrency assumptions: what if the test modifies external state?
  • Test mode and test suite specific behavior, assumptions and quirks
    • UI tests: auxiliary crates and bins, compile-flags, compare modes, assumptions and conventions on stdout/stderr output, blessing
    • run-make and run-make-fulldeps tests: how the whole build pipeline is setup, concepts, how tests are built and executed, provided env vars, assumed dependencies
    • codegen tests: filecheck, revisions magic behavior
    • coverage tests: how to bless?
    • ui-fulldeps have some non-trivial behavior: e.g. https://github.com/rust-lang/rust/pull/126073#discussion_r1629843686
  • Error handling strategy/design and diagnostics
  • Interaction with CI
  • Test directive collection, parsing and validation
    • Which directives can be used in which test suites?
    • What do the directives even mean/do?
  • Test output normalization special syntax
    • e.g. const CWD: &str = "{{cwd}}";
  • Setting current_dir when running tests
Related issues
Unresolved questions
  • Where do we keep compiletest docs?
    • Maybe alongside the source? Maybe a mdBook? rustc-dev-guide?
    • Ideally we would like this easy to read and reference and improve.
  • How to we keep compiletest documentation update-to-date?
    • Periodic triage?
Documentation improvement history

TODO

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the existing rustc-dev-guide compiletest documentation and the related issues #125585, #125587, and #126092. Determine where the documentation should live and which listed areas to cover; done means a maintainable, readable compiletest reference addressing an agreed scope and update process.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
documentation, testing
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.