Skip to content

Commit

Permalink
ci: Skip tests in GitHub Actions environment
Browse files Browse the repository at this point in the history
  • Loading branch information
yzzting committed Sep 2, 2024
1 parent 68c5ea9 commit 3c8a8f8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/test_llm_openai.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ use tempfile::tempdir;

#[test]
fn test_openai_request_by_no_config() {
if env::var("GITHUB_ACTIONS").is_ok() {
eprintln!("Skipping test in GitHub Actions environment");
return;
}
let temp_dir = tempdir().unwrap();
let prompt_dir = temp_dir.path().join("prompt.toml");
let file_path = temp_dir.path();
Expand All @@ -28,6 +32,10 @@ fn test_openai_request_by_no_config() {

#[test]
fn test_openai_request() {
if env::var("GITHUB_ACTIONS").is_ok() {
eprintln!("Skipping test in GitHub Actions environment");
return;
}
let home_dir = env::var("HOME").expect("Error getting home directory");
let config_dir = format!("{}/.config/commit_crafter", home_dir);
let prompt_dir = format!("{}/.config/commit_crafter/prompt.toml", home_dir);
Expand Down

0 comments on commit 3c8a8f8

Please sign in to comment.