Skip to content

Commit e5fe6c1

Browse files
committed
test(self-update): isolate Programs display version check
1 parent df6f8da commit e5fe6c1

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

tests/suite/cli_self_upd.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -481,19 +481,23 @@ async fn update_overwrites_programs_display_version() {
481481
const PLACEHOLDER_VERSION: &str = "9.999.99";
482482
let version = env!("CARGO_PKG_VERSION");
483483

484-
let cx = SelfUpdateTestContext::new(TEST_VERSION).await;
485-
let _guard = RegistryGuard::new(&USER_RUSTUP_VERSION).unwrap();
484+
let mut cx = SelfUpdateTestContext::new(TEST_VERSION).await;
485+
let guard = RegistryGuard::new([&USER_PATH, &USER_RUSTUP_VERSION]).unwrap();
486+
cx.config.set_registry_uuid(guard.uuid());
486487
cx.config
487488
.expect(["rustup-init", "-y", "--no-modify-path"])
488489
.await
489490
.is_ok();
490491

491492
USER_RUSTUP_VERSION
492-
.set(Some(&Value::from(PLACEHOLDER_VERSION)))
493+
.set(Some(&Value::from(PLACEHOLDER_VERSION)), Some(guard.uuid()))
493494
.unwrap();
494495
cx.config.expect(["rustup", "self", "update"]).await.is_ok();
495496
assert_eq!(
496-
USER_RUSTUP_VERSION.get().unwrap().unwrap(),
497+
USER_RUSTUP_VERSION
498+
.get(Some(guard.uuid()))
499+
.unwrap()
500+
.unwrap(),
497501
Value::from(version)
498502
);
499503
}

0 commit comments

Comments
 (0)