Skip to content

Commit a00fa8e

Browse files
committed
!
1 parent e213404 commit a00fa8e

4 files changed

Lines changed: 68 additions & 12 deletions

File tree

Cargo.lock

Lines changed: 53 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ members = [
2828
]
2929

3030
[workspace.package]
31-
version = "0.1.5"
31+
version = "0.1.6"
3232
edition = "2021"
3333
authors = ["RustAPI Contributors"]
3434
license = "MIT OR Apache-2.0"

crates/rustapi-extras/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ tokio = { workspace = true, features = ["macros", "rt-multi-thread"] }
5555
proptest = "1.4"
5656
rustapi-core = { workspace = true, features = ["test-utils"] }
5757
tempfile = "3.10"
58+
serial_test = "3.2"
5859

5960
[features]
6061
default = []

crates/rustapi-extras/src/config/mod.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,8 +385,10 @@ mod tests {
385385
use super::*;
386386
use proptest::prelude::*;
387387
use serde::Deserialize;
388+
use serial_test::serial;
388389

389390
#[test]
391+
#[serial]
390392
fn test_environment_detection_development() {
391393
// Clear any existing value
392394
std::env::remove_var("RUSTAPI_ENV");
@@ -398,6 +400,7 @@ mod tests {
398400
}
399401

400402
#[test]
403+
#[serial]
401404
fn test_environment_detection_production() {
402405
std::env::set_var("RUSTAPI_ENV", "production");
403406
let env = Environment::current();
@@ -415,6 +418,7 @@ mod tests {
415418
}
416419

417420
#[test]
421+
#[serial]
418422
fn test_environment_detection_custom() {
419423
std::env::set_var("RUSTAPI_ENV", "staging");
420424
let env = Environment::current();
@@ -458,6 +462,7 @@ mod tests {
458462
}
459463

460464
#[test]
465+
#[serial]
461466
fn test_env_or_with_default() {
462467
// Use a unique var name to avoid conflicts
463468
let var_name = "RUSTAPI_TEST_ENV_OR_12345";
@@ -475,6 +480,7 @@ mod tests {
475480
}
476481

477482
#[test]
483+
#[serial]
478484
fn test_env_parse() {
479485
let var_name = "RUSTAPI_TEST_PARSE_12345";
480486

@@ -501,6 +507,7 @@ mod tests {
501507
}
502508

503509
#[test]
510+
#[serial]
504511
fn test_config_from_env() {
505512
// Set up test environment variables with unique names
506513
std::env::set_var("UNIT_TEST_STRING", "hello");
@@ -522,6 +529,7 @@ mod tests {
522529
}
523530

524531
#[test]
532+
#[serial]
525533
fn test_config_from_env_missing_var() {
526534
// Ensure the variables don't exist (use unique names to avoid race conditions)
527535
std::env::remove_var("MISSING_VAR_TEST_STRING");
@@ -538,6 +546,7 @@ mod tests {
538546
}
539547

540548
#[test]
549+
#[serial]
541550
fn test_config_from_env_prefixed() {
542551
std::env::set_var("MYAPP_URL", "http://localhost");
543552
std::env::set_var("MYAPP_PORT", "3000");
@@ -558,6 +567,7 @@ mod tests {
558567
}
559568

560569
#[test]
570+
#[serial]
561571
fn test_config_deref() {
562572
std::env::set_var("DEREF_TEST_STRING", "deref_test");
563573
std::env::set_var("DEREF_TEST_NUMBER", "100");
@@ -580,6 +590,7 @@ mod tests {
580590
}
581591

582592
#[test]
593+
#[serial]
583594
fn test_config_into_inner() {
584595
std::env::set_var("INNER_TEST_STRING", "inner_test");
585596
std::env::set_var("INNER_TEST_NUMBER", "200");
@@ -605,6 +616,7 @@ mod tests {
605616
#![proptest_config(ProptestConfig::with_cases(100))]
606617

607618
#[test]
619+
#[serial]
608620
fn prop_config_deserialization(
609621
string_value in "[a-zA-Z0-9_]{1,50}",
610622
number_value in 0u32..10000u32,
@@ -665,6 +677,7 @@ mod tests {
665677
#![proptest_config(ProptestConfig::with_cases(100))]
666678

667679
#[test]
680+
#[serial]
668681
fn prop_config_optional_fields(
669682
required_value in "[a-zA-Z0-9]{1,30}",
670683
optional_present in prop::bool::ANY,

0 commit comments

Comments
 (0)