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

Reduce the number of git clones in the test framework #1686

Merged
merged 5 commits into from
May 22, 2019

Commits on May 1, 2019

  1. Reduce the number of git clones in the test framework

    The test framework spends a lot of I/O and allocations initializing and
    cloning git repositories, even though most tests do not enqueue a
    background job to modify the index.  A `TestApp::full()` method is
    added which initializes the `TestApp` with an index, background job
    runner, and playback proxy.
    
    It is also now possible to enqueue multiple crate publishes before
    running a batch of background jobs.  A `Drop` impl on `TestAppInner`
    ensures that all pending migrations are run and that no jobs have been
    queued unless `TestApp::full()` was used.
    
    Unlike the `enqueue_publish` helper the `yank` and `unyank` methods
    automatically run migrations out of convenience since otherwise the
    database is not updated.  This can be changed in the future if a test
    cares about controlling exactly when the jobs are run.
    
    Finally, the initial commit for each remaining upstream index is now
    made directly against the bare repo, rather than doing a clone and
    push.
    jtgeibel committed May 1, 2019
    Configuration menu
    Copy the full SHA
    f4532ee View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1878e98 View commit details
    Browse the repository at this point in the history
  3. Only initialize an outgoing client if the test is in capture mode

    There is no reason to initialize this client when in playback mode.
    jtgeibel committed May 1, 2019
    Configuration menu
    Copy the full SHA
    119b622 View commit details
    Browse the repository at this point in the history
  4. Switch to no proxy by default for tests

    The remaining 12 tests that call `app()` directly do not need a proxy.
    jtgeibel committed May 1, 2019
    Configuration menu
    Copy the full SHA
    3fd1bfb View commit details
    Browse the repository at this point in the history
  5. Avoid initializing the playback proxy for a few remaining tests

    This list was obtained by temporarily causing playback to panic if
    there was no `http-data` file when the proxy is started.
    
    The only remaining test that starts a proxy server which goes unused is
    `krate::yank_not_owner`, however this test does need an index.  If more
    tests fall into this category over time we can switch to a full builder
    API for orchestrating a `TestApp` but that doesn't seem necessary yet.
    jtgeibel committed May 1, 2019
    Configuration menu
    Copy the full SHA
    85ee13e View commit details
    Browse the repository at this point in the history