Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests to rustbuild #48913

Merged
merged 13 commits into from
Apr 4, 2018
Merged

Add tests to rustbuild #48913

merged 13 commits into from
Apr 4, 2018

Commits on Apr 3, 2018

  1. Stop accessing current_dir in bootstrap

    This ensures that the working directory of rustbuild has no effect on
    it's run; since tests will run with a different cwd this is required for
    consistent behavior.
    Mark-Simulacrum committed Apr 3, 2018
    Configuration menu
    Copy the full SHA
    84b5b34 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a5e56b6 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    e7342b8 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    cd33d3a View commit details
    Browse the repository at this point in the history
  5. Make test steps sortable

    Ensures that test cases will be somewhat easier to write.
    Mark-Simulacrum committed Apr 3, 2018
    Configuration menu
    Copy the full SHA
    fde70b0 View commit details
    Browse the repository at this point in the history
  6. Extract default Config into function

    Will permit creating Config in tests without having to parse a toml
    file.
    Mark-Simulacrum committed Apr 3, 2018
    Configuration menu
    Copy the full SHA
    8fd42ec View commit details
    Browse the repository at this point in the history
  7. Add tests to rustbuild

    In order to run tests, previous commits have cfg'd out various parts of
    rustbuild. Generally speaking, these are filesystem-related operations
    and process-spawning related parts. Then, rustbuild is run "as normal"
    and the various steps that where run are retrieved from the cache and
    checked against the expected results.
    
    Note that this means that the current implementation primarily tests
    "what" we build, but doesn't actually test that what we build *will*
    build. In other words, it doesn't do any form of dependency verification
    for any crate. This is possible to implement, but is considered future
    work.
    
    This implementation strives to cfg out as little code as possible; it
    also does not currently test anywhere near all of rustbuild. The current
    tests are also not checked for "correctness," rather, they simply
    represent what we do as of this commit, which may be wrong.
    
    Test cases are drawn from the old implementation of rustbuild, though
    the expected results may vary.
    Mark-Simulacrum committed Apr 3, 2018
    Configuration menu
    Copy the full SHA
    42fde21 View commit details
    Browse the repository at this point in the history
  8. Stub out less code

    Mark-Simulacrum committed Apr 3, 2018
    Configuration menu
    Copy the full SHA
    f4620a3 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    b0dbc7c View commit details
    Browse the repository at this point in the history
  10. Refactor to use a dry-run config instead of cfg(test)

    This ensures that each build will support the testing design of "dry
    running" builds. It's also checked that a dry run build is equivalent
    step-wise to a "wet" run build; the graphs we generate when running are
    directly compared node/node and edge/edge, both for order and contents.
    Mark-Simulacrum committed Apr 3, 2018
    Configuration menu
    Copy the full SHA
    a727447 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    545b92f View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    0ce5cf0 View commit details
    Browse the repository at this point in the history
  13. Stop checking that the graph produced by a dry run is equivalent

    This is too likely to cause spurious bounces on CI; what we run may be
    dependent on what ran successfully before hand (e.g. RLS features with
    Clippy), which makes this not tenable. There's no good way to ignore
    specifically these problematic steps so we'll just ignore everything for
    the time being. We still test that a dry run worked though so largely
    this is the same from a ensure-that-tests-work perspective.
    
    Eventually we'll want to undo this commit, though, to make our tests
    more accurate.
    Mark-Simulacrum committed Apr 3, 2018
    Configuration menu
    Copy the full SHA
    184d3bc View commit details
    Browse the repository at this point in the history