voelin-platform: don't show a test notification on a developer's desktop

notify_returns checks that a notification fails cleanly without a
notification service, but where a session bus and a notification daemon
exist it sent a real urgent "Poke: from a test" notification on every
test run. Skip it there, as the portal capture test already does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
selikhovandClaude Opus 5.5 committed 2026-10-03 11:57:32 +03:00
1 parent 6292d16fef
commit 809be73e96
1 file changed
+8
+8
View File
@@ -66,8 +66,16 @@ mod tests {
use super::*;
/// Without a notification service this must fail, not hang or panic.
/// Skipped where a session bus exists: on a desktop the notification
/// would really show.
#[tokio::test]
async fn notify_returns() {
let runtime_bus = std::env::var_os("XDG_RUNTIME_DIR")
.is_some_and(|d| std::path::Path::new(&d).join("bus").exists());
if std::env::var_os("DBUS_SESSION_BUS_ADDRESS").is_some() || runtime_bus {
eprintln!("skipped: a D-Bus session bus is configured");
return;
}
let n = Notification { urgent: true, ..Notification::new("Poke", "from a test") };
let result = tokio::time::timeout(Duration::from_secs(10), notify(&n)).await;
assert!(result.is_ok(), "notify hung");