Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/utils/vcs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1517,6 +1517,7 @@ mod tests {
}

#[test]
#[serial(github_env)]
fn test_get_github_pr_number() {
std::env::set_var("GITHUB_EVENT_NAME", "pull_request");
std::env::set_var("GITHUB_REF", "refs/pull/123/merge");
Expand All @@ -1534,6 +1535,7 @@ mod tests {
}

#[test]
#[serial(github_env)]
fn test_get_github_base_ref() {
std::env::set_var("GITHUB_EVENT_NAME", "pull_request");
std::env::set_var("GITHUB_BASE_REF", "main");
Expand Down Expand Up @@ -1658,7 +1660,7 @@ mod tests {
}

#[test]
#[serial(github_event_path)]
#[serial(github_env)]
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Test Grouping Issue Causes Interference

Changing the #[serial] attribute from github_event_path to github_env groups tests manipulating GITHUB_EVENT_PATH with tests that use other GITHUB_* environment variables. This removes the logical separation for tests relying on GITHUB_EVENT_PATH, potentially causing interference.

Additional Locations (1)

Fix in Cursor Fix in Web

fn test_find_head_with_github_event_path() {
use std::fs;

Expand Down Expand Up @@ -1738,7 +1740,7 @@ mod tests {
}

#[test]
#[serial(github_event_path)]
#[serial(github_env)]
fn test_find_base_sha() {
use std::fs;

Expand Down