Unify release selection across clients
ci / test (push) Canceled after 0s
ci / fuzz-smoke (push) Canceled after 0s
ci / macos-client (macos-aarch64, macos-14) (push) Canceled after 0s
ci / macos-client (macos-x86_64, macos-13) (push) Canceled after 0s
ci / windows-client (push) Canceled after 0s
ci / package-release (linux-x86_64, ubuntu-latest, , , ) (push) Canceled after 0s
ci / package-release (macos-aarch64, macos-14, , , ) (push) Canceled after 0s
ci / package-release (macos-x86_64, macos-13, , , ) (push) Canceled after 0s
ci / package-release (windows-aarch64, windows-latest, aarch64, windows, aarch64-pc-windows-msvc) (push) Canceled after 0s
ci / package-release (windows-x86_64, windows-latest, , , ) (push) Canceled after 0s
ci / remote-bench (push) Canceled after 0s
ci / publish-gitea-release (push) Canceled after 0s

This commit is contained in:
DuProcess
2026-07-17 18:58:58 -04:00
parent 89b81d73b1
commit 7f8d5711ea
7 changed files with 641 additions and 439 deletions
+26 -23
View File
@@ -94,6 +94,8 @@ fn release_gates_test_all_targets() {
assert!(windows_client.contains("runs-on: windows-latest"));
assert!(windows_client.contains("name: Test Windows client"));
assert!(windows_client.contains("name: PowerShell syntax check"));
assert!(windows_client.contains("name: Windows installer runtime test"));
assert!(windows_client.contains("run: scripts/test-install-windows.ps1"));
assert!(windows_client.contains("shell: pwsh"));
assert!(
windows_client
@@ -138,28 +140,24 @@ fn one_dot_zero_gates_default_to_full_length_soaks() {
}
#[test]
fn installers_skip_stale_latest_release_prebuilts() {
fn installers_resolve_the_repository_declared_release_without_stable_redirects() {
let install = include_str!("../install.sh");
assert!(install.contains("latest_release_is_stale"));
assert!(install.contains("current_source_version"));
assert!(install.contains("latest release $latest is older than source $current"));
assert!(install.contains("version_prerelease"));
assert!(install.contains("prerelease_less_than"));
assert!(
install.contains("if latest_release_is_stale; then"),
"unix installer must skip stale latest before downloading a prebuilt"
);
assert!(install.contains("release_source_ref"));
assert!(install.contains("printf 'v%s\\n' \"${current#v}\""));
assert!(install.contains("DOSH_BINARY_EXACT=1"));
assert!(!install.contains("/releases/latest"));
assert!(install.contains("resolved_source_ref=\"$(release_source_ref || true)\""));
assert!(install.contains("checkout -q --detach FETCH_HEAD"));
let ps1 = include_str!("../install.ps1");
assert!(ps1.contains("Latest-ReleaseIsStale"));
assert!(ps1.contains("Current-SourceVersion"));
assert!(ps1.contains("latest release $latestVersion is older than source $current"));
assert!(ps1.contains("Version-Prerelease"));
assert!(ps1.contains("Compare-Prerelease"));
assert!(
ps1.contains("if (Latest-ReleaseIsStale)"),
"windows installer must skip stale latest before downloading a prebuilt"
);
assert!(ps1.contains("Source-ReleaseRef"));
assert!(ps1.contains("\"v$($current.TrimStart('v'))\""));
assert!(ps1.contains("DOSH_BINARY_EXACT"));
assert!(!ps1.contains("/releases/latest"));
assert!(ps1.contains("$script:ResolvedSourceRef = Source-ReleaseRef"));
assert!(ps1.contains("checkout -q --detach FETCH_HEAD"));
}
#[test]
@@ -198,15 +196,16 @@ fn windows_installer_reuses_persistent_source_update_cache() {
assert!(ps1.contains("$full -eq $localAppData -or $full -eq $localAppDataDosh"));
assert!(ps1.contains("$sourceCache = Assert-SafeUpdateCache $UpdateCache"));
assert!(ps1.contains(
"$fetchArgs = @(\"-C\", $sourceCache, \"fetch\", \"--depth\", \"1\", \"origin\", \"main\")"
"$fetchArgs = @(\"-C\", $sourceCache, \"fetch\", \"--depth\", \"1\", \"origin\", $sourceRef)"
));
assert!(ps1.contains("$fetchArgs = @(\"-C\", $sourceCache, \"fetch\", \"-q\", \"--depth\", \"1\", \"origin\", \"main\")"));
assert!(ps1.contains("$fetchArgs = @(\"-C\", $sourceCache, \"fetch\", \"-q\", \"--depth\", \"1\", \"origin\", $sourceRef)"));
assert!(ps1.contains("git @fetchArgs"));
assert!(ps1.contains("git -C $sourceCache checkout -q -B main FETCH_HEAD"));
assert!(ps1.contains("git -C $sourceCache checkout -q --detach FETCH_HEAD"));
assert!(ps1.contains(
"$cloneArgs = @(\"clone\", \"--depth\", \"1\", \"--branch\", \"main\", $Repo, $sourceCache)"
"$cloneArgs = @(\"clone\", \"--depth\", \"1\", \"--branch\", $sourceRef, $Repo, $sourceCache)"
));
assert!(ps1.contains("$cloneArgs = @(\"clone\", \"-q\", \"--depth\", \"1\", \"--branch\", \"main\", $Repo, $sourceCache)"));
assert!(ps1.contains("$cloneArgs = @(\"clone\", \"-q\", \"--depth\", \"1\", \"--branch\", $sourceRef, $Repo, $sourceCache)"));
assert!(ps1.contains("git @cloneArgs | Out-Null"));
assert!(
!ps1.contains("git clone --depth 1 $Repo $tmp"),
@@ -218,8 +217,12 @@ fn windows_installer_reuses_persistent_source_update_cache() {
fn windows_quiet_source_updates_silence_git_like_unix() {
let install = include_str!("../install.sh");
let ps1 = include_str!("../install.ps1");
assert!(install.contains("git -C \"$update_cache\" fetch -q --depth 1 origin main"));
assert!(install.contains("git clone -q --depth 1 --branch main \"$repo\" \"$update_cache\""));
assert!(install.contains("git -C \"$update_cache\" fetch -q --depth 1 origin \"$source_ref\""));
assert!(
install.contains(
"git clone -q --depth 1 --branch \"$source_ref\" \"$repo\" \"$update_cache\""
)
);
assert!(ps1.contains("if ($Quiet)"));
assert!(ps1.contains("\"fetch\", \"-q\", \"--depth\""));
assert!(ps1.contains("\"clone\", \"-q\", \"--depth\""));