1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//! Helpers shared by the tests of the `build` modules.
use Path;
use Duration;
use crateError;
use cratefixtures;
use ;
/// A build budget the test tier can never legitimately hit.
///
/// Every build here is `true` or a one-line shell command, so anything
/// slower than a minute is a hang worth failing on rather than waiting
/// out. Distinct from the production default, which is an hour because a
/// cold build of a real workspace legitimately runs tens of minutes.
pub const TEST_BUILD_BUDGET: Duration = from_secs;
/// Runs a build with every knob at its default: sheep `"web"`, no
/// `as_user`, no passthrough, a fresh cache tempdir, and
/// `TEST_BUILD_BUDGET`.
///
/// Exists because this module's own `run` calls had started to drift the
/// way `fixtures.rs`'s module doc describes for `run_git` and
/// `head_of`: one nine-line block, copied a couple dozen times, one
/// budget or one cache dir away from its neighbor by accident rather
/// than intent. A test that needs a specific cache, user, passthrough or
/// budget still calls `run` directly instead of going through this.
pub async