Skip to content

Commit 4a12f00

Browse files
authored
Merge pull request #2 from greasycat/dev
test(search): skip fzf integration tests on GitHub Actions
2 parents 6969a48 + 2edb0c2 commit 4a12f00

2 files changed

Lines changed: 28 additions & 0 deletions

File tree

tests/search_fzf.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
use std::fs;
22
use 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]
59
fn 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]
3240
fn 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]
6577
fn 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\nexit 130\n").unwrap();

tests/search_only_cli.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff 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]
1115
fn 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]
6371
fn 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");

0 commit comments

Comments
 (0)