Test that a release newer than a failed one is applied at launch (#59)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit was merged in pull request #68.
This commit is contained in:
1 parent
ab3c6964a5
commit
093078731e
1 file changed
+19
-1
@@ -517,7 +517,7 @@ fn an_altered_package_or_an_installer_that_cannot_start_leaves_the_installed_ver
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_package_downloaded_again_after_a_failed_installation_is_not_retried_at_launch() {
|
||||
fn a_failed_version_is_not_retried_at_launch_but_a_newer_release_is() {
|
||||
let key = key();
|
||||
let (url, downloads) = serve(vec![publish(&key, "stable", "1.1.0")], false);
|
||||
let dir = tempfile::tempdir().unwrap();
|
||||
@@ -547,4 +547,22 @@ fn a_package_downloaded_again_after_a_failed_installation_is_not_retried_at_laun
|
||||
assert_eq!(downloads.load(Ordering::SeqCst), 2);
|
||||
let next = launch(&mut never_started, &mut no_installer);
|
||||
assert!(loads_quietly(&next), "{next:?}");
|
||||
|
||||
// The next release gets its own attempt: the app never stays on the version in place.
|
||||
let newer = vec![
|
||||
publish(&key, "stable", "1.1.0"),
|
||||
publish(&key, "stable", "1.2.0"),
|
||||
publish(&key, "stable", "1.3.0"),
|
||||
];
|
||||
let (url, _) = serve(newer, false);
|
||||
let ready = download_update(&url, dir.path(), public, UpdateChannel::Stable, "1.0.0");
|
||||
assert_eq!(ready.unwrap().as_deref(), Some("1.3.0"));
|
||||
assert_eq!(kept(dir.path()), ["stable-1.3.0"]);
|
||||
let mut started = Vec::new();
|
||||
let newest = launch(&mut recording(&mut started, 43), &mut no_installer);
|
||||
assert!(applying(&newest), "{newest:?}");
|
||||
let package = dir
|
||||
.path()
|
||||
.join("stable-1.3.0/ArenaTracker-1.3.0-stable-full.nupkg");
|
||||
assert_eq!(started, [package]);
|
||||
}
|
||||
Reference in new issue
Block a user