Skip to content

Commit ed0cf3c

Browse files
authored
Merge pull request #12 from OneNoted/release-0-6-0-prep
Release 0 6 0 prep
2 parents a2c96ee + 704873d commit ed0cf3c

3 files changed

Lines changed: 54 additions & 15 deletions

File tree

.github/workflows/release-assets.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
"${prefix}/bin/blueprint-compiler" --version
5050
5151
- name: Build debug app for smoke
52-
run: cargo build -p taskers --bin taskers --bin taskers-gtk
52+
run: cargo build -p taskers --bin taskers --bin taskers-gtk --bin taskersctl --bin taskers-terminald
5353

5454
- name: Run headless app smoke
5555
run: |

crates/taskers-app/src/main.rs

Lines changed: 52 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,14 @@ struct RuntimePathOverrides {
116116
terminal_socket_path: PathBuf,
117117
}
118118

119+
fn should_skip_terminal_sidecar_in_smoke(path_overrides: Option<&RuntimePathOverrides>) -> bool {
120+
path_overrides.is_some()
121+
&& matches!(
122+
std::env::var("TASKERS_TERMINAL_BACKEND").ok().as_deref(),
123+
Some("mock")
124+
)
125+
}
126+
119127
enum HostAutomationCommand {
120128
Browser(BrowserControlCommand),
121129
Screenshot(ScreenshotCommand),
@@ -1355,19 +1363,26 @@ fn resolve_runtime_bootstrap(
13551363
shell_launch
13561364
.env
13571365
.insert("TASKERS_SOCKET".into(), socket_path.display().to_string());
1358-
let terminal_session_client = match ensure_terminal_session_daemon(&terminal_socket_path) {
1359-
Ok(()) => {
1360-
shell_launch.env.insert(
1361-
"TASKERS_TERMINAL_SOCKET".into(),
1362-
terminal_socket_path.display().to_string(),
1363-
);
1364-
Some(TerminalSessionClient::new(terminal_socket_path))
1365-
}
1366-
Err(error) => {
1367-
startup_notes.push(format!(
1368-
"terminal session sidecar unavailable; terminals will start fresh shells and will not survive Taskers restart ({error})"
1369-
));
1370-
None
1366+
let terminal_session_client = if should_skip_terminal_sidecar_in_smoke(path_overrides) {
1367+
startup_notes.push(
1368+
"Smoke mode with mock terminal backend skips the terminal session sidecar.".into(),
1369+
);
1370+
None
1371+
} else {
1372+
match ensure_terminal_session_daemon(&terminal_socket_path) {
1373+
Ok(()) => {
1374+
shell_launch.env.insert(
1375+
"TASKERS_TERMINAL_SOCKET".into(),
1376+
terminal_socket_path.display().to_string(),
1377+
);
1378+
Some(TerminalSessionClient::new(terminal_socket_path))
1379+
}
1380+
Err(error) => {
1381+
startup_notes.push(format!(
1382+
"terminal session sidecar unavailable; terminals will start fresh shells and will not survive Taskers restart ({error})"
1383+
));
1384+
None
1385+
}
13711386
}
13721387
};
13731388
let terminal_persistence = if terminal_session_client.is_some() {
@@ -2456,7 +2471,10 @@ fn looks_like_dev_install(path: &Path) -> bool {
24562471

24572472
#[cfg(test)]
24582473
mod startup_tests {
2459-
use super::{looks_like_dev_install, should_defer_initial_sync, smoke_runtime_path_overrides};
2474+
use super::{
2475+
RuntimePathOverrides, looks_like_dev_install, should_defer_initial_sync,
2476+
should_skip_terminal_sidecar_in_smoke, smoke_runtime_path_overrides,
2477+
};
24602478
use std::path::Path;
24612479

24622480
#[test]
@@ -2504,4 +2522,24 @@ mod startup_tests {
25042522
.starts_with(&overrides.root_dir)
25052523
);
25062524
}
2525+
2526+
#[test]
2527+
fn smoke_with_mock_backend_skips_terminal_sidecar() {
2528+
let overrides = RuntimePathOverrides {
2529+
root_dir: Path::new("/tmp/taskers-smoke").to_path_buf(),
2530+
session_path: Path::new("/tmp/taskers-smoke/session.json").to_path_buf(),
2531+
socket_path: Path::new("/tmp/taskers-smoke/control.sock").to_path_buf(),
2532+
terminal_socket_path: Path::new("/tmp/taskers-smoke/terminal.sock").to_path_buf(),
2533+
};
2534+
2535+
unsafe { std::env::set_var("TASKERS_TERMINAL_BACKEND", "mock") };
2536+
assert!(should_skip_terminal_sidecar_in_smoke(Some(&overrides)));
2537+
unsafe { std::env::set_var("TASKERS_TERMINAL_BACKEND", "ghostty") };
2538+
assert!(!should_skip_terminal_sidecar_in_smoke(Some(&overrides)));
2539+
unsafe { std::env::remove_var("TASKERS_TERMINAL_BACKEND") };
2540+
assert!(!should_skip_terminal_sidecar_in_smoke(Some(&overrides)));
2541+
unsafe { std::env::set_var("TASKERS_TERMINAL_BACKEND", "mock") };
2542+
assert!(!should_skip_terminal_sidecar_in_smoke(None));
2543+
unsafe { std::env::remove_var("TASKERS_TERMINAL_BACKEND") };
2544+
}
25072545
}

scripts/headless-smoke.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@ timeout "${TIMEOUT_SECONDS:-20}" \
1111
LIBGL_ALWAYS_SOFTWARE=1 \
1212
GTK_USE_PORTAL=0 \
1313
NO_AT_BRIDGE=1 \
14+
WEBKIT_DISABLE_SANDBOX_THIS_IS_DANGEROUS=1 \
1415
xvfb-run -a \
1516
"$@"

0 commit comments

Comments
 (0)