feat(e2e): add test mode infrastructure with BTERMINAL_TEST env isolation
Rust: watcher.rs/fs_watcher.rs skip watchers in test mode, is_test_mode Tauri command. Frontend: wake-scheduler disable, App.svelte test mode detection. AppConfig centralization in bterminal-core (OnceLock pattern for path overrides).
This commit is contained in:
parent
d1a4d9f220
commit
4097253921
18 changed files with 346 additions and 29 deletions
|
|
@ -37,6 +37,12 @@ impl FileWatcherManager {
|
|||
pane_id: &str,
|
||||
path: &str,
|
||||
) -> Result<String, String> {
|
||||
// In test mode, skip file watching to avoid inotify noise and flaky events
|
||||
if std::env::var("BTERMINAL_TEST").map_or(false, |v| v == "1") {
|
||||
return std::fs::read_to_string(path)
|
||||
.map_err(|e| format!("Failed to read file: {e}"));
|
||||
}
|
||||
|
||||
let file_path = PathBuf::from(path);
|
||||
if !file_path.exists() {
|
||||
return Err(format!("File not found: {path}"));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue