mirror of
https://github.com/storytold/craft-launcher.git
synced 2026-12-02 20:22:35 -05:00
fix(ci): run the Developer Build install tests only where Nightly installs are staged (#1761)
#1706 added thirteen tests that start a Nightly install. On FreeBSD the install stops at validate_profile ("No nightly isolation contract is staged for this Unix platform") before any descriptor request, so the scheduled FreeBSD job fails them. Gate them, and the two helpers only they use, to Linux, macOS and Windows as #1610 did for the earlier Nightly tests. Production behaviour is unchanged.
This commit is contained in:
1 parent
2e8ffbf869
commit
ac772a8c0e
1 file changed
+15
@@ -125,6 +125,7 @@ fn selection(backend: &NativeBackend, run: u64) -> (String, Vec<u8>, Release) {
|
||||
);
|
||||
(descriptor_url, body, release)
|
||||
}
|
||||
#[cfg(any(target_os = "linux", target_os = "macos", target_os = "windows"))] // A Nightly install plan is staged only there.
|
||||
#[test]
|
||||
fn install_verifies_only_the_exact_selected_build_before_requesting_its_payload() {
|
||||
let (_temp, mut backend, requests) = setup();
|
||||
@@ -154,6 +155,7 @@ fn install_verifies_only_the_exact_selected_build_before_requesting_its_payload(
|
||||
);
|
||||
println!("selected install: getartcraft.com=0, api.github.com=0, github.com=2 (selected descriptor + selected payload), other apps=0");
|
||||
}
|
||||
#[cfg(any(target_os = "linux", target_os = "macos", target_os = "windows"))] // A Nightly install plan is staged only there.
|
||||
#[test]
|
||||
fn missing_changed_or_invalid_descriptor_never_requests_payload_or_installs() {
|
||||
for reply in [None, Some(b"changed descriptor".to_vec()), Some(b"{}".to_vec())] {
|
||||
@@ -168,6 +170,7 @@ fn missing_changed_or_invalid_descriptor_never_requests_payload_or_installs() {
|
||||
println!("failed selected verification: github.com=1 (descriptor), api.github.com=0, payloads=0, installs=0");
|
||||
}
|
||||
}
|
||||
#[cfg(any(target_os = "linux", target_os = "macos", target_os = "windows"))] // A Nightly install plan is staged only there.
|
||||
#[test]
|
||||
fn changed_selection_queued_install_and_off_then_on_never_substitute_a_build() {
|
||||
for revoke_consent in [false, true] {
|
||||
@@ -266,6 +269,7 @@ fn stale_listing_is_displayable_but_cannot_start_an_install() {
|
||||
);
|
||||
}
|
||||
|
||||
#[cfg(any(target_os = "linux", target_os = "macos", target_os = "windows"))] // A Nightly install plan is staged only there.
|
||||
#[test]
|
||||
fn descriptor_response_observes_opt_out_and_server_retry_before_any_payload() {
|
||||
for withdraw in [true, false] {
|
||||
@@ -428,6 +432,7 @@ fn catalog_selection_keeps_flatpak_first_settings_and_exact_queued_package_ident
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(target_os = "linux", target_os = "macos", target_os = "windows"))] // A Nightly install plan is staged only there.
|
||||
#[test]
|
||||
fn review_inflight_delayed_descriptor_for_a_cannot_invalidate_newly_published_b_or_attach_its_backoff() {
|
||||
for server_error in [false, true] {
|
||||
@@ -467,6 +472,7 @@ fn review_inflight_delayed_descriptor_for_a_cannot_invalidate_newly_published_b_
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(target_os = "linux", target_os = "macos", target_os = "windows"))] // A Nightly install plan is staged only there.
|
||||
#[test]
|
||||
fn review_inflight_cancel_during_descriptor_response_is_job_local_and_keeps_the_catalog_offer_eligible() {
|
||||
for server_error in [false, true] {
|
||||
@@ -584,6 +590,7 @@ fn review_catalog_publication_updates_ready_reports_and_preserves_an_unchanged_p
|
||||
assert!(backend.download_size(app().id).is_none());
|
||||
}
|
||||
|
||||
#[cfg(any(target_os = "linux", target_os = "macos", target_os = "windows"))] // A Nightly install plan is staged only there.
|
||||
#[test]
|
||||
fn review_descriptor_deadline_does_not_block_artcraft_refresh_or_get_cleared_by_it() {
|
||||
let (_temp, mut backend, requests) = setup();
|
||||
@@ -882,6 +889,7 @@ fn review_integration_refused_install_click_is_typed_and_starts_no_download() {
|
||||
assert!(requests.lock().unwrap().is_empty());
|
||||
}
|
||||
|
||||
#[cfg(any(target_os = "linux", target_os = "macos", target_os = "windows"))] // Used only by tests that stage a Nightly install.
|
||||
fn app_events<'a>(events: &'a [Event]) -> impl DoubleEndedIterator<Item = &'a Event> + 'a {
|
||||
events.iter().filter(|event| match event {
|
||||
Event::Installable { app: id, .. } | Event::Latest { app: id, .. } | Event::NightlyStatus { app: id, .. } => id == app().id,
|
||||
@@ -890,6 +898,7 @@ fn app_events<'a>(events: &'a [Event]) -> impl DoubleEndedIterator<Item = &'a Ev
|
||||
})
|
||||
}
|
||||
|
||||
#[cfg(any(target_os = "linux", target_os = "macos", target_os = "windows"))] // A Nightly install plan is staged only there.
|
||||
#[test]
|
||||
fn review_followup_install_rechecks_the_selection_after_its_download_turn() {
|
||||
let (_temp, mut backend, requests) = setup();
|
||||
@@ -917,6 +926,7 @@ fn review_followup_install_rechecks_the_selection_after_its_download_turn() {
|
||||
Event::NightlyJobFinished { operation: NightlyOperation::Install, result: Err(why), .. } if why.contains("changed"))));
|
||||
}
|
||||
|
||||
#[cfg(any(target_os = "linux", target_os = "macos", target_os = "windows"))] // A Nightly install plan is staged only there.
|
||||
#[test]
|
||||
fn review_followup_descriptor_failure_updates_the_build_status_without_a_catalog_failure() {
|
||||
let (_temp, mut backend, requests) = setup();
|
||||
@@ -941,6 +951,7 @@ fn review_followup_descriptor_failure_updates_the_build_status_without_a_catalog
|
||||
);
|
||||
}
|
||||
|
||||
#[cfg(any(target_os = "linux", target_os = "macos", target_os = "windows"))] // A Nightly install plan is staged only there.
|
||||
#[test]
|
||||
fn review_followup_verification_wait_is_a_time_hold_not_package_ineligibility() {
|
||||
let (_temp, mut backend, requests) = setup();
|
||||
@@ -1079,6 +1090,7 @@ fn review_followup_expired_uninstalled_offer_is_revalidated_before_its_cadence()
|
||||
assert!(backend.shared.nightly_state.lock().unwrap().record(&key).attempted_at.is_some_and(|at| at > checked));
|
||||
}
|
||||
|
||||
#[cfg(any(target_os = "linux", target_os = "macos", target_os = "windows"))] // Used only by tests that stage a Nightly install.
|
||||
fn last_for_app(events: &[Event]) -> (Option<bool>, Option<artcraft_launcher_core::protocol::NightlyStatus>) {
|
||||
let installable = app_events(events).rev().find_map(|event| match event {
|
||||
Event::Installable { installable, .. } => Some(*installable),
|
||||
@@ -1154,6 +1166,7 @@ fn manual_check_clears_earlier_catalog_hold_when_fetch_succeeds() {
|
||||
assert_eq!(finished, Some(None), "a successful manual check must clear an earlier catalog hold: {events:?}");
|
||||
}
|
||||
|
||||
#[cfg(any(target_os = "linux", target_os = "macos", target_os = "windows"))] // A Nightly install plan is staged only there.
|
||||
#[test]
|
||||
fn review_followup_install_offer_must_be_the_build_the_card_showed() {
|
||||
let (_temp, mut backend, requests) = setup();
|
||||
@@ -1210,6 +1223,7 @@ fn review_followup_install_offer_must_be_the_build_the_card_showed() {
|
||||
assert!(backend.shared.events.lock().unwrap().iter().all(|event| !matches!(event, Event::NightlyJobRefused { .. })));
|
||||
}
|
||||
|
||||
#[cfg(any(target_os = "linux", target_os = "macos", target_os = "windows"))] // A Nightly install plan is staged only there.
|
||||
#[test]
|
||||
fn review_followup_server_retry_after_keeps_the_current_offer_and_the_next_click_verifies_again() {
|
||||
let (_temp, mut backend, requests) = setup();
|
||||
@@ -1242,6 +1256,7 @@ fn review_followup_server_retry_after_keeps_the_current_offer_and_the_next_click
|
||||
assert_eq!(*requests.lock().unwrap(), [descriptor_url.clone(), descriptor_url], "the next click verifies the descriptor again");
|
||||
}
|
||||
|
||||
#[cfg(any(target_os = "linux", target_os = "macos", target_os = "windows"))] // A Nightly install plan is staged only there.
|
||||
#[test]
|
||||
fn review_followup_other_verification_failures_and_storage_failure_stay_blocked() {
|
||||
for case in ["malformed", "storage", "expired"] {
|
||||
|
||||
Reference in new issue
Block a user