File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11use std:: fs;
22use wkey:: model:: { Item , Note , Shortcut } ;
33
4+ fn should_skip_on_github_actions ( ) -> bool {
5+ std:: env:: var_os ( "GITHUB_ACTIONS" ) . is_some ( )
6+ }
7+
48#[ test]
59fn search_items_returns_selected_item_key_from_fzf_output ( ) {
10+ if should_skip_on_github_actions ( ) {
11+ return ;
12+ }
13+
614 let temp = tempfile:: tempdir ( ) . unwrap ( ) ;
715 let fake_fzf = temp. path ( ) . join ( "fake-fzf" ) ;
816 fs:: write (
@@ -30,6 +38,10 @@ fn search_items_returns_selected_item_key_from_fzf_output() {
3038
3139#[ test]
3240fn search_items_invokes_fzf_with_top_aligned_layout ( ) {
41+ if should_skip_on_github_actions ( ) {
42+ return ;
43+ }
44+
3345 let temp = tempfile:: tempdir ( ) . unwrap ( ) ;
3446 let fake_fzf = temp. path ( ) . join ( "fake-fzf" ) ;
3547 let args_file = temp. path ( ) . join ( "args.txt" ) ;
@@ -63,6 +75,10 @@ fn search_items_invokes_fzf_with_top_aligned_layout() {
6375
6476#[ test]
6577fn search_items_with_fallback_does_not_invoke_fallback_on_cancel ( ) {
78+ if should_skip_on_github_actions ( ) {
79+ return ;
80+ }
81+
6682 let temp = tempfile:: tempdir ( ) . unwrap ( ) ;
6783 let fake_fzf = temp. path ( ) . join ( "fake-fzf" ) ;
6884 fs:: write ( & fake_fzf, "#!/bin/sh\n exit 130\n " ) . unwrap ( ) ;
Original file line number Diff line number Diff line change @@ -7,8 +7,16 @@ fn shell_quote(value: &str) -> String {
77 format ! ( "'{}'" , value. replace( '\'' , "'\\ ''" ) )
88}
99
10+ fn should_skip_on_github_actions ( ) -> bool {
11+ std:: env:: var_os ( "GITHUB_ACTIONS" ) . is_some ( )
12+ }
13+
1014#[ test]
1115fn search_only_prints_selected_item_desc_without_opening_main_tui ( ) {
16+ if should_skip_on_github_actions ( ) {
17+ return ;
18+ }
19+
1220 let temp = tempfile:: tempdir ( ) . unwrap ( ) ;
1321 let config_dir = temp. path ( ) . join ( "config" ) ;
1422 let fake_bin_dir = temp. path ( ) . join ( "bin" ) ;
@@ -61,6 +69,10 @@ tip = { desc = "Remember this" }
6169
6270#[ test]
6371fn search_only_also_pipes_selected_desc_to_pipeout_command ( ) {
72+ if should_skip_on_github_actions ( ) {
73+ return ;
74+ }
75+
6476 let temp = tempfile:: tempdir ( ) . unwrap ( ) ;
6577 let config_dir = temp. path ( ) . join ( "config" ) ;
6678 let fake_bin_dir = temp. path ( ) . join ( "bin" ) ;
You can’t perform that action at this time.
0 commit comments