Skip to content

Commit a876ce8

Browse files
runningcodeclaude
andauthored
test: Add #[serial] to GitHub env var tests (#2832)
## Summary - Add `#[serial(github_env)]` to `test_get_github_pr_number` - Add `#[serial(github_env)]` to `test_get_github_base_ref` - Rename serial key from `github_event_path` to `github_env` for all tests These tests manipulate GitHub environment variables (`GITHUB_EVENT_PATH`, `GITHUB_EVENT_NAME`, `GITHUB_REF`, `GITHUB_BASE_REF`) and should not run in parallel with other tests that use the same environment variables to avoid race conditions. The serial key has been renamed from `github_event_path` to `github_env` to better reflect that it encompasses all GitHub environment variables, not just `GITHUB_EVENT_PATH`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <noreply@anthropic.com>
1 parent 1fd856c commit a876ce8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/utils/vcs.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1517,6 +1517,7 @@ mod tests {
15171517
}
15181518

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

15361537
#[test]
1538+
#[serial(github_env)]
15371539
fn test_get_github_base_ref() {
15381540
std::env::set_var("GITHUB_EVENT_NAME", "pull_request");
15391541
std::env::set_var("GITHUB_BASE_REF", "main");
@@ -1658,7 +1660,7 @@ mod tests {
16581660
}
16591661

16601662
#[test]
1661-
#[serial(github_event_path)]
1663+
#[serial(github_env)]
16621664
fn test_find_head_with_github_event_path() {
16631665
use std::fs;
16641666

@@ -1738,7 +1740,7 @@ mod tests {
17381740
}
17391741

17401742
#[test]
1741-
#[serial(github_event_path)]
1743+
#[serial(github_env)]
17421744
fn test_find_base_sha() {
17431745
use std::fs;
17441746

0 commit comments

Comments
 (0)