aboutsummaryrefslogtreecommitdiffstats
path: root/zellij-server/src/plugins/unit/plugin_tests.rs
diff options
context:
space:
mode:
authorAram Drevekenin <aram@poor.dev>2023-08-24 13:36:24 +0200
committerGitHub <noreply@github.com>2023-08-24 13:36:24 +0200
commitbc628abc1266cdc0dbce4f19a89727527a3e39a8 (patch)
tree6a0fcac6ec35c71a237bca0128a57a5b40afb0e3 /zellij-server/src/plugins/unit/plugin_tests.rs
parentdocs(changelog): permission system (diff)
downloadsl0ppij-bc628abc1266cdc0dbce4f19a89727527a3e39a8.tar.gz
sl0ppij-bc628abc1266cdc0dbce4f19a89727527a3e39a8.tar.xz
sl0ppij-bc628abc1266cdc0dbce4f19a89727527a3e39a8.zip
feat(sessions): add a session manager to switch between sessions, tabs and panes and create new ones (#2721)
* write/read session metadata to disk for all sessions * switch session client side * fix tests * various adjustments * fix full screen focus bug in tiled panes * fix tests * fix permission sorting issue * cleanups * add session manager * fix tests * various cleanups * style(fmt): rustfmt * clear screen before switching sessions * I hate you clippy * truncate controls line to width * version session cache * attempt to fix plugin tests * style(fmt): rustfmt * another attempt to fix the tests in the ci
Diffstat (limited to 'zellij-server/src/plugins/unit/plugin_tests.rs')
-rw-r--r--zellij-server/src/plugins/unit/plugin_tests.rs67
1 files changed, 66 insertions, 1 deletions
diff --git a/zellij-server/src/plugins/unit/plugin_tests.rs b/zellij-server/src/plugins/unit/plugin_tests.rs
index e995a07b..222b14c6 100644
--- a/zellij-server/src/plugins/unit/plugin_tests.rs
+++ b/zellij-server/src/plugins/unit/plugin_tests.rs
@@ -539,6 +539,7 @@ pub fn load_new_plugin_from_hd() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -609,6 +610,7 @@ pub fn plugin_workers() {
// we send a SystemClipboardFailure to trigger the custom handler in the fixture plugin that
// will send a message to the worker and in turn back to the plugin to be rendered, so we know
// that this cycle is working
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -682,6 +684,7 @@ pub fn plugin_workers_persist_state() {
// we do this a second time so that the worker will log the first message on its own state and
// then send us the "received 2 messages" indication we check for below, letting us know it
// managed to persist its own state and act upon it
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -820,6 +823,7 @@ pub fn switch_to_mode_plugin_command() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -887,6 +891,7 @@ pub fn switch_to_mode_plugin_command_permission_denied() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -954,6 +959,7 @@ pub fn new_tabs_with_layout_plugin_command() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -1035,6 +1041,7 @@ pub fn new_tab_plugin_command() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -1102,6 +1109,7 @@ pub fn go_to_next_tab_plugin_command() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -1168,6 +1176,7 @@ pub fn go_to_previous_tab_plugin_command() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -1234,6 +1243,7 @@ pub fn resize_focused_pane_plugin_command() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -1300,6 +1310,7 @@ pub fn resize_focused_pane_with_direction_plugin_command() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -1366,6 +1377,7 @@ pub fn focus_next_pane_plugin_command() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -1432,6 +1444,7 @@ pub fn focus_previous_pane_plugin_command() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -1498,6 +1511,7 @@ pub fn move_focus_plugin_command() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -1564,6 +1578,7 @@ pub fn move_focus_or_tab_plugin_command() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -1630,6 +1645,7 @@ pub fn edit_scrollback_plugin_command() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -1696,6 +1712,7 @@ pub fn write_plugin_command() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -1762,6 +1779,7 @@ pub fn write_chars_plugin_command() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -1828,6 +1846,7 @@ pub fn toggle_tab_plugin_command() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -1894,6 +1913,7 @@ pub fn move_pane_plugin_command() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -1960,6 +1980,7 @@ pub fn move_pane_with_direction_plugin_command() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -2027,7 +2048,7 @@ pub fn clear_screen_plugin_command() {
client_id,
size,
));
- std::thread::sleep(std::time::Duration::from_millis(100));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -2095,6 +2116,7 @@ pub fn scroll_up_plugin_command() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -2161,6 +2183,7 @@ pub fn scroll_down_plugin_command() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -2227,6 +2250,7 @@ pub fn scroll_to_top_plugin_command() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -2293,6 +2317,7 @@ pub fn scroll_to_bottom_plugin_command() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -2359,6 +2384,7 @@ pub fn page_scroll_up_plugin_command() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -2425,6 +2451,7 @@ pub fn page_scroll_down_plugin_command() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -2491,6 +2518,7 @@ pub fn toggle_focus_fullscreen_plugin_command() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -2557,6 +2585,7 @@ pub fn toggle_pane_frames_plugin_command() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -2623,6 +2652,7 @@ pub fn toggle_pane_embed_or_eject_plugin_command() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -2689,6 +2719,7 @@ pub fn undo_rename_pane_plugin_command() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -2755,6 +2786,7 @@ pub fn close_focus_plugin_command() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -2821,6 +2853,7 @@ pub fn toggle_active_tab_sync_plugin_command() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -2887,6 +2920,7 @@ pub fn close_focused_tab_plugin_command() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -2953,6 +2987,7 @@ pub fn undo_rename_tab_plugin_command() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -3019,6 +3054,7 @@ pub fn previous_swap_layout_plugin_command() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -3085,6 +3121,7 @@ pub fn next_swap_layout_plugin_command() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -3151,6 +3188,7 @@ pub fn go_to_tab_name_plugin_command() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -3217,6 +3255,7 @@ pub fn focus_or_create_tab_plugin_command() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -3283,6 +3322,7 @@ pub fn go_to_tab() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -3349,6 +3389,7 @@ pub fn start_or_reload_plugin() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -3422,6 +3463,7 @@ pub fn quit_zellij_plugin_command() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -3495,6 +3537,7 @@ pub fn detach_plugin_command() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -3568,6 +3611,7 @@ pub fn open_file_floating_plugin_command() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -3641,6 +3685,7 @@ pub fn open_file_plugin_command() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -3715,6 +3760,7 @@ pub fn open_file_with_line_plugin_command() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -3788,6 +3834,7 @@ pub fn open_file_with_line_floating_plugin_command() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -3861,6 +3908,7 @@ pub fn open_terminal_plugin_command() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -3934,6 +3982,7 @@ pub fn open_terminal_floating_plugin_command() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -4007,6 +4056,7 @@ pub fn open_command_pane_plugin_command() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -4080,6 +4130,7 @@ pub fn open_command_pane_floating_plugin_command() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -4146,6 +4197,7 @@ pub fn switch_to_tab_plugin_command() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -4207,6 +4259,7 @@ pub fn hide_self_plugin_command() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -4268,6 +4321,7 @@ pub fn show_self_plugin_command() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -4334,6 +4388,7 @@ pub fn close_terminal_pane_plugin_command() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -4400,6 +4455,7 @@ pub fn close_plugin_pane_plugin_command() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -4466,6 +4522,7 @@ pub fn focus_terminal_pane_plugin_command() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -4532,6 +4589,7 @@ pub fn focus_plugin_pane_plugin_command() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -4598,6 +4656,7 @@ pub fn rename_terminal_pane_plugin_command() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -4664,6 +4723,7 @@ pub fn rename_plugin_pane_plugin_command() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -4730,6 +4790,7 @@ pub fn rename_tab_plugin_command() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -4805,6 +4866,7 @@ pub fn send_configuration_to_plugins() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -4868,6 +4930,7 @@ pub fn request_plugin_permissions() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -4955,6 +5018,7 @@ pub fn granted_permission_request_result() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),
@@ -5040,6 +5104,7 @@ pub fn denied_permission_request_result() {
client_id,
size,
));
+ std::thread::sleep(std::time::Duration::from_millis(500));
let _ = plugin_thread_sender.send(PluginInstruction::Update(vec![(
None,
Some(client_id),