diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-27 17:32:05 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-27 18:14:24 +0900 |
| commit | 0d6cd1b3b5783c03dd8520ac65e9156d476a7a64 (patch) | |
| tree | 376267afe6cc4accfb0ab066d9cd540b71df1c5d /crates/shirabe/tests/factory_test.rs | |
| parent | e98823e599eb375b30037cc714710e3309d927d1 (diff) | |
| download | php-shirabe-0d6cd1b3b5783c03dd8520ac65e9156d476a7a64.tar.gz php-shirabe-0d6cd1b3b5783c03dd8520ac65e9156d476a7a64.tar.zst php-shirabe-0d6cd1b3b5783c03dd8520ac65e9156d476a7a64.zip | |
test: serialize env-var-dependent tests
Several tests read process-global env vars and set/clear them via
TearDown but were not #[serial], so parallel execution could race.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/tests/factory_test.rs')
| -rw-r--r-- | crates/shirabe/tests/factory_test.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/crates/shirabe/tests/factory_test.rs b/crates/shirabe/tests/factory_test.rs index 04d407b..bb26b09 100644 --- a/crates/shirabe/tests/factory_test.rs +++ b/crates/shirabe/tests/factory_test.rs @@ -1,5 +1,6 @@ //! ref: composer/tests/Composer/Test/FactoryTest.php +use serial_test::serial; use shirabe::factory::Factory; use shirabe::util::platform::Platform; @@ -16,6 +17,7 @@ impl Drop for TearDown { } #[test] +#[serial] #[ignore = "requires PHPUnit-style mocks: an IOInterface mock verifying writeError is called exactly once with the exact warning, plus a Config mock stubbing get('disable-tls')=>true; no such mock/expectation infrastructure (e.g. mockall) exists"] fn test_default_values_are_as_expected() { let _tear_down = TearDown; @@ -24,7 +26,7 @@ fn test_default_values_are_as_expected() { } #[test] -#[ignore = "depends on COMPOSER being unset, but sibling tests set it and race it on the process-global env under parallel execution"] +#[serial] fn test_get_composer_json_path() { let _tear_down = TearDown; @@ -32,7 +34,7 @@ fn test_get_composer_json_path() { } #[test] -#[ignore = "mutates the global COMPOSER env and races the from_env case under parallel execution"] +#[serial] fn test_get_composer_json_path_fails_if_dir() { let _tear_down = TearDown; @@ -49,6 +51,7 @@ fn test_get_composer_json_path_fails_if_dir() { } #[test] +#[serial] fn test_get_composer_json_path_from_env() { let _tear_down = TearDown; |
