@@ -207,20 +207,63 @@ make test
2072071 . ` src/test_utils/git/mod.rs ` - GitOperations trait and exports
2082082 . ` src/test_utils/git/docker.rs ` - DockerGit implementation (local development)
2092093 . ` src/test_utils/git/native.rs ` - NativeGit implementation (CI testing)
210- 4 . ` src/config.rs ` - Environment detection via ` ZERV_CI ` variable
211- 5 . ` src/test_utils/mod.rs ` - ` should_use_native_git() ` helper function
210+ 4 . ` src/config.rs ` - Centralized environment variable loading via ` ZERV_TEST_NATIVE_GIT ` and ` ZERV_TEST_DOCKER `
211+ 5 . ` src/test_utils/mod.rs ` - ` should_use_native_git() ` and ` should_run_docker_tests() ` helper functions
212+
213+ ## Environment Variable Matrix
214+
215+ | Scenario | ` ZERV_TEST_NATIVE_GIT ` | ` ZERV_TEST_DOCKER ` | Git Implementation | Docker Tests | Result |
216+ | ---------------- | ---------------------- | ------------------ | ------------------ | ------------ | ------------------ |
217+ | Local Easy | ` false ` | ` false ` | Docker Git | Skipped | Coverage with gaps |
218+ | Local Full | ` false ` | ` true ` | Docker Git | Run | Full coverage |
219+ | CI Linux | ` true ` | ` true ` | Native Git | Run | Platform coverage |
220+ | CI macOS/Windows | ` true ` | ` false ` | Native Git | Skipped | Platform coverage |
221+
222+ ## Centralized Configuration
223+
224+ ** All environment variable loading centralized in ` src/config.rs ` :**
225+
226+ ``` rust
227+ #[derive(Debug , Clone , Default )]
228+ pub struct ZervConfig {
229+ pub test_native_git : bool , // ZERV_TEST_NATIVE_GIT
230+ pub test_docker : bool , // ZERV_TEST_DOCKER
231+ }
232+
233+ impl ZervConfig {
234+ pub fn load () -> Result <Self , Box <dyn std :: error :: Error >> {
235+ let test_native_git = Self :: parse_bool_env (" ZERV_TEST_NATIVE_GIT" )? ;
236+ let test_docker = Self :: parse_bool_env (" ZERV_TEST_DOCKER" )? ;
237+ Ok (ZervConfig { test_native_git , test_docker })
238+ }
239+
240+ fn parse_bool_env (var_name : & str ) -> Result <bool , Box <dyn std :: error :: Error >> {
241+ match env :: var (var_name ) {
242+ Ok (val ) => Ok (val == " true" || val == " 1" ),
243+ Err (_ ) => Ok (false ),
244+ }
245+ }
246+ }
247+ ```
248+
249+ ** Key Behavior Changes:**
250+
251+ - Docker tests ** fail** with clear error messages when ` ZERV_TEST_DOCKER=true ` but Docker unavailable
252+ - Policy enforcement: If Docker is available, tests must be enabled
253+ - Proper test separation between Docker-dependent and Docker-independent tests
212254
213255## Current Testing Verification
214256
215257``` bash
216258# Local test (uses DockerGit for isolation)
217- make test
259+ make test_easy # Docker tests skipped
260+ make test # Docker tests enabled
218261
219262# Test validation works
220263cargo test test_docker_validation --lib
221264
222- # Check specific git tests (Docker tests only run on Linux)
223- cargo test git --include-ignored
265+ # Check specific git tests
266+ cargo test git
224267
225268# Verify multi-platform CI passes
226269git push # Check GitHub Actions on Linux, macOS, Windows
@@ -237,7 +280,7 @@ git push # Check GitHub Actions on Linux, macOS, Windows
237280** Local Safety Maintained** :
238281
239282- ✅ ** Docker Isolation** : Protects personal git config during local development
240- - ✅ ** Environment Detection** : Automatic switching via ` ZERV_CI =true`
283+ - ✅ ** Environment Detection** : Automatic switching via ` ZERV_TEST_NATIVE_GIT =true`
241284- ✅ ** Consistent API** : Same ` GitOperations ` trait for both implementations
242285
243286## Architecture Evolution
0 commit comments