Skip to content

Commit 0569175

Browse files
committed
test: run sequentially to avoid race condition
1 parent 8a07063 commit 0569175

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/commands/init.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ use colored::*;
88
use std::path::Path;
99
use walkdir::WalkDir;
1010

11+
#[cfg(test)]
12+
use serial_test::serial;
13+
1114
/// Init command for creating config from discovered repositories
1215
pub struct InitCommand {
1316
pub output: String,
@@ -160,6 +163,7 @@ mod tests {
160163
use tempfile::TempDir;
161164

162165
#[tokio::test]
166+
#[serial]
163167
async fn test_init_command_no_repositories_found() {
164168
let temp_dir = TempDir::new().unwrap();
165169
let original_dir = std::env::current_dir().unwrap();
@@ -242,6 +246,7 @@ mod tests {
242246
}
243247

244248
#[tokio::test]
249+
#[serial]
245250
async fn test_init_command_supplement_with_existing_config() {
246251
let temp_dir = TempDir::new().unwrap();
247252
let output_path = temp_dir.path().join("existing-config.yaml");
@@ -291,6 +296,7 @@ mod tests {
291296
}
292297

293298
#[tokio::test]
299+
#[serial]
294300
async fn test_init_command_supplement_without_existing_config() {
295301
let temp_dir = TempDir::new().unwrap();
296302
let output_path = temp_dir.path().join("new-config.yaml");

0 commit comments

Comments
 (0)