test(host): make two host tests portable to Windows
android / android (push) Failing after 23s
ci / web (push) Failing after 10s
ci / docs-site (push) Failing after 0s
ci / bench (push) Failing after 0s
deb / build-publish (push) Failing after 0s
decky / build-publish (push) Failing after 0s
docker / build-push (--build-arg FEDORA_VERSION=44, ci, ci/fedora-rpm.Dockerfile, punktfunk-fedora44-rpm) (push) Failing after 1s
docker / build-push (ci, ci/fedora-rpm.Dockerfile, punktfunk-fedora-rpm) (push) Failing after 1s
docker / build-push (ci, ci/rust-ci.Dockerfile, punktfunk-rust-ci) (push) Failing after 0s
docker / build-push (docs-site, docs-site/Dockerfile, punktfunk-docs) (push) Failing after 0s
docker / deploy-docs (push) Has been skipped
flatpak / build-publish (push) Failing after 1s
rpm / build-publish (bazzite, punktfunk-fedora-rpm) (push) Failing after 0s
docker / build-push (., web/Dockerfile, punktfunk-web) (push) Failing after 0s
rpm / build-publish (fedora-44, punktfunk-fedora44-rpm) (push) Failing after 1s
apple / swift (push) Successful in 53s
ci / rust (push) Failing after 1m47s
android / android (push) Failing after 23s
ci / web (push) Failing after 10s
ci / docs-site (push) Failing after 0s
ci / bench (push) Failing after 0s
deb / build-publish (push) Failing after 0s
decky / build-publish (push) Failing after 0s
docker / build-push (--build-arg FEDORA_VERSION=44, ci, ci/fedora-rpm.Dockerfile, punktfunk-fedora44-rpm) (push) Failing after 1s
docker / build-push (ci, ci/fedora-rpm.Dockerfile, punktfunk-fedora-rpm) (push) Failing after 1s
docker / build-push (ci, ci/rust-ci.Dockerfile, punktfunk-rust-ci) (push) Failing after 0s
docker / build-push (docs-site, docs-site/Dockerfile, punktfunk-docs) (push) Failing after 0s
docker / deploy-docs (push) Has been skipped
flatpak / build-publish (push) Failing after 1s
rpm / build-publish (bazzite, punktfunk-fedora-rpm) (push) Failing after 0s
docker / build-push (., web/Dockerfile, punktfunk-web) (push) Failing after 0s
rpm / build-publish (fedora-44, punktfunk-fedora44-rpm) (push) Failing after 1s
apple / swift (push) Successful in 53s
ci / rust (push) Failing after 1m47s
The Windows host test suite hit two pre-existing portability failures (the autonomous Windows bring-up never ran `cargo test` on the VM): - `vdisplay::detect_active_session_*` asserted a non-empty XDG runtime dir — a Linux concept with no Windows equivalent. Gate just that assertion to Linux (keep the call so the fn stays used → no dead_code). - `mgmt::openapi_document_is_complete_and_checked_in` did a byte compare against the checked-in spec, which git may check out CRLF on Windows while serde_json emits LF. Compare content with `\r` stripped. Host suite now 73/73 on x86_64-pc-windows-msvc; Linux unchanged (78 ok). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1588,9 +1588,11 @@ mod tests {
|
|||||||
);
|
);
|
||||||
|
|
||||||
let checked_in = include_str!("../../../docs/api/openapi.json");
|
let checked_in = include_str!("../../../docs/api/openapi.json");
|
||||||
|
// Compare content, not line-ending style: the generated `json` is LF (serde_json), but git
|
||||||
|
// may check the file out CRLF on Windows.
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
json.trim(),
|
json.trim().replace('\r', ""),
|
||||||
checked_in.trim(),
|
checked_in.trim().replace('\r', ""),
|
||||||
"docs/api/openapi.json is stale — regenerate with: \
|
"docs/api/openapi.json is stale — regenerate with: \
|
||||||
cargo run -p punktfunk-host -- openapi > docs/api/openapi.json"
|
cargo run -p punktfunk-host -- openapi > docs/api/openapi.json"
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -638,6 +638,8 @@ mod tests {
|
|||||||
// A pure probe of /proc + the runtime dir: it must not panic and must return promptly on
|
// A pure probe of /proc + the runtime dir: it must not panic and must return promptly on
|
||||||
// any box (CI has no graphical session → ActiveKind::None, with the runtime-dir anchor).
|
// any box (CI has no graphical session → ActiveKind::None, with the runtime-dir anchor).
|
||||||
let a = detect_active_session();
|
let a = detect_active_session();
|
||||||
|
// The runtime-dir anchor is a Linux (XDG) concept; Windows has no equivalent.
|
||||||
|
#[cfg(target_os = "linux")]
|
||||||
assert!(!a.env.xdg_runtime_dir.is_empty());
|
assert!(!a.env.xdg_runtime_dir.is_empty());
|
||||||
// Wayland sockets are only resolved for the Wayland-protocol desktops.
|
// Wayland sockets are only resolved for the Wayland-protocol desktops.
|
||||||
if matches!(
|
if matches!(
|
||||||
|
|||||||
Reference in New Issue
Block a user