Skip to content

Commit c69c799

Browse files
committed
Put self update test servers in test root
This was an unintended change a few merges back. The self update test server should be homed with the rest of the test mutable state, for now.
1 parent a42a1b2 commit c69c799

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/mock/clitools.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ pub struct Config {
5353
pub rustup_update_root: Option<String>,
5454
/// This is cwd for the test
5555
pub workdir: RefCell<PathBuf>,
56+
/// This is the test root for keeping stuff together
57+
pub test_root_dir: PathBuf,
5658
}
5759

5860
// Describes all the features of the mock dist server.
@@ -221,6 +223,7 @@ pub fn setup_test_state(test_dist_dir: tempfile::TempDir) -> (tempfile::TempDir,
221223
homedir,
222224
rustup_update_root: None,
223225
workdir: RefCell::new(workdir),
226+
test_root_dir: test_dir.path().to_path_buf(),
224227
};
225228

226229
let build_path = exe_dir.join(format!("rustup-init{EXE_SUFFIX}"));
@@ -292,9 +295,10 @@ fn create_local_update_server(self_dist: &Path, exedir: &Path, version: &str) ->
292295
pub fn self_update_setup(f: &dyn Fn(&mut Config, &Path), version: &str) {
293296
test(Scenario::SimpleV2, &|config| {
294297
// Create a mock self-update server
298+
295299
let self_dist_tmp = tempfile::Builder::new()
296300
.prefix("self_dist")
297-
.tempdir()
301+
.tempdir_in(&config.test_root_dir)
298302
.unwrap();
299303
let self_dist = self_dist_tmp.path();
300304

0 commit comments

Comments
 (0)