Skip to content

Commit 067d584

Browse files
committed
!squash notes test-coverage.md
1 parent 2b58ee5 commit 067d584

File tree

1 file changed

+52
-52
lines changed

1 file changed

+52
-52
lines changed

notes/test-coverage.md

+52-52
Original file line numberDiff line numberDiff line change
@@ -7,78 +7,78 @@ This document provides a comprehensive checklist of test coverage for the VCSPul
77
### 1. Configuration Management (config.py, _internal/config_reader.py)
88

99
#### Common Cases:
10-
- [ ] **Config File Loading:** Loading valid YAML/JSON files from common locations
11-
- [ ] Home directory (~/.vcspull.yaml, ~/.vcspull.json)
12-
- [ ] XDG config directory
13-
- [ ] Project-specific config files
14-
- [ ] **Directory Expansion:** Resolving paths with tilde (~) and environment variables
15-
- [ ] **Basic Configuration Format:** Standard repository declarations with required fields
16-
- [ ] **Multiple Repositories:** Configurations with multiple repositories in different paths
17-
- [ ] **Filtering Repositories:** Basic pattern matching for repository names
18-
- [ ] **Repository Extraction:** Converting raw configs to normalized formats
10+
- [x] **Config File Loading:** Loading valid YAML/JSON files from common locations *(tests/test_config_file.py: test_dict_equals_yaml, test_find_config_files)*
11+
- [x] Home directory (~/.vcspull.yaml, ~/.vcspull.json) *(tests/test_config_file.py: test_find_config_include_home_config_files)*
12+
- [x] XDG config directory *(tests/test_utils.py: test_vcspull_configdir_xdg_config_dir)*
13+
- [x] Project-specific config files *(tests/test_config_file.py: test_in_dir)*
14+
- [x] **Directory Expansion:** Resolving paths with tilde (~) and environment variables *(tests/test_config_file.py: test_expandenv_and_homevars, test_expand_shell_command_after)*
15+
- [x] **Basic Configuration Format:** Standard repository declarations with required fields *(tests/test_config.py: test_simple_format)*
16+
- [x] **Multiple Repositories:** Configurations with multiple repositories in different paths *(tests/test_config_file.py: test_dict_equals_yaml)*
17+
- [x] **Filtering Repositories:** Basic pattern matching for repository names *(tests/test_repo.py: test_filter_name, test_filter_dir, test_filter_vcs)*
18+
- [x] **Repository Extraction:** Converting raw configs to normalized formats *(tests/test_repo.py: test_to_dictlist)*
1919

2020
#### Uncommon Cases:
21-
- [ ] **Deeply Nested Configurations:** Multiple levels of directory nesting in config
22-
- [ ] **Configuration Merging:** Combining multiple configuration files
21+
- [x] **Deeply Nested Configurations:** Multiple levels of directory nesting in config *(tests/test_config_file.py: test_dict_equals_yaml)*
22+
- [x] **Configuration Merging:** Combining multiple configuration files *(tests/test_config_file.py: test_merge_nested_dict)*
2323
- [ ] **Duplicate Detection:** Identifying and handling duplicate repositories
2424
- [ ] **Conflicting Configurations:** When the same repository is defined differently in multiple files
25-
- [ ] **Relative Paths:** Config files using relative paths that need resolution
26-
- [ ] **Custom Config Locations:** Loading from non-standard locations
25+
- [x] **Relative Paths:** Config files using relative paths that need resolution *(tests/test_config.py: test_relative_dir)*
26+
- [x] **Custom Config Locations:** Loading from non-standard locations *(tests/test_config_file.py: test_find_config_match_string, test_find_config_match_list)*
2727

2828
#### Edge Cases:
2929
- [ ] **Empty Configuration Files:** Files with empty content or only comments
3030
- [ ] **Malformed YAML/JSON:** Syntax errors in configuration files
3131
- [ ] **Circular Path References:** Directory structures with circular references
3232
- [ ] **Very Large Configurations:** Performance with hundreds of repositories
3333
- [ ] **Case Sensitivity Issues:** Path case differences between config and filesystem
34-
- [ ] **Unicode and Special Characters:** In repository names, paths, and URLs
34+
- [ ] **Unicode and Special Characters:** In repository names, paths, and URLs *(tests/test_validator.py: test_validate_path_with_special_characters - partially covered)*
3535
- [ ] **Inaccessible Paths:** Referenced paths that exist but are not accessible
3636
- [ ] **Path Traversal Attempts:** Paths attempting to use "../" to escape sandboxed areas
37-
- [ ] **Missing Config Files:** Behavior when specified config files don't exist
38-
- [ ] **Mixed VCS Types:** Configurations mixing git, hg, and svn repositories
37+
- [x] **Missing Config Files:** Behavior when specified config files don't exist *(tests/test_config_file.py: test_multiple_config_files_raises_exception)*
38+
- [x] **Mixed VCS Types:** Configurations mixing git, hg, and svn repositories *(tests/test_repo.py: test_vcs_url_scheme_to_object)*
3939
- [ ] **Invalid URLs:** URL schemes that don't match the specified VCS type
4040

4141
### 2. Validation (validator.py, schemas.py)
4242

4343
#### Common Cases:
44-
- [ ] **Basic Schema Validation:** Checking required fields in configurations
45-
- [ ] **VCS Type Validation:** Validating supported VCS types (git, hg, svn)
46-
- [ ] **URL Validation:** Basic validation of repository URLs
47-
- [ ] **Path Validation:** Checking that paths are valid
48-
- [ ] **Git Remote Validation:** Validating git remote configurations
44+
- [x] **Basic Schema Validation:** Checking required fields in configurations *(tests/test_validator.py: test_validate_config_with_valid_config)*
45+
- [x] **VCS Type Validation:** Validating supported VCS types (git, hg, svn) *(tests/test_validator.py: test_validate_repo_config_valid)*
46+
- [x] **URL Validation:** Basic validation of repository URLs *(tests/test_validator.py: test_validate_repo_config_empty_values)*
47+
- [x] **Path Validation:** Checking that paths are valid *(tests/test_validator.py: test_validate_path_valid, test_validate_path_invalid)*
48+
- [x] **Git Remote Validation:** Validating git remote configurations *(tests/test_sync.py: test_updating_remote)*
4949

5050
#### Uncommon Cases:
51-
- [ ] **Nested Validation Errors:** Multiple validation issues in nested structures
51+
- [x] **Nested Validation Errors:** Multiple validation issues in nested structures *(tests/test_validator.py: test_validate_config_nested_validation_errors)*
5252
- [ ] **URL Scheme Mismatches:** When URL scheme doesn't match the VCS type
5353
- [ ] **Advanced URL Validation:** SSH URLs, usernames in URLs, port specifications
54-
- [ ] **Custom Fields Validation:** Handling of non-standard fields in configs
54+
- [x] **Custom Fields Validation:** Handling of non-standard fields in configs *(tests/test_validator.py: test_validate_repo_config_with_extra_fields)*
5555
- [ ] **Shell Command Validation:** Validating shell commands in configs
5656

5757
#### Edge Cases:
58-
- [ ] **Pydantic Model Conversion:** Converting between raw and validated models
58+
- [x] **Pydantic Model Conversion:** Converting between raw and validated models *(tests/test_validator.py: test_format_pydantic_errors)*
5959
- [ ] **Partial Configuration Validation:** Validating incomplete configurations
60-
- [ ] **Deeply Nested Errors:** Validation errors in deeply nested structures
60+
- [x] **Deeply Nested Errors:** Validation errors in deeply nested structures *(tests/test_validator.py: test_validate_config_nested_validation_errors)*
6161
- [ ] **Custom Protocol Handling:** git+ssh://, git+https://, etc.
6262
- [ ] **Invalid Characters:** Non-printable or control characters in fields
6363
- [ ] **Very Long Field Values:** Fields with extremely long values
6464
- [ ] **Mixed Case VCS Types:** "Git" vs "git" vs "GIT"
6565
- [ ] **Conflicting Validation Rules:** When multiple validation rules conflict
66-
- [ ] **Empty vs. Missing Fields:** Distinction between empty and missing fields
66+
- [x] **Empty vs. Missing Fields:** Distinction between empty and missing fields *(tests/test_validator.py: test_validate_repo_config_missing_keys, test_validate_repo_config_empty_values)*
6767
- [ ] **Type Coercion Issues:** When field values are of unexpected types
6868
- [ ] **Invalid URL Formats by VCS Type:** URLs that are valid in general but invalid for specific VCS
6969

7070
### 3. CLI Interface (cli/__init__.py, cli/sync.py)
7171

7272
#### Common Cases:
73-
- [ ] **Basic CLI Invocation:** Running commands with minimal arguments
74-
- [ ] **Repository Filtering:** Using patterns to select repositories
75-
- [ ] **Config File Specification:** Using custom config files
76-
- [ ] **Default Behaviors:** Running with default options
73+
- [x] **Basic CLI Invocation:** Running commands with minimal arguments *(tests/test_cli.py: test_sync)*
74+
- [x] **Repository Filtering:** Using patterns to select repositories *(tests/test_cli.py: test_sync_cli_filter_non_existent)*
75+
- [x] **Config File Specification:** Using custom config files *(tests/test_cli.py: various test fixtures with config paths)*
76+
- [x] **Default Behaviors:** Running with default options *(tests/test_cli.py: test_sync fixtures with default args)*
7777
- [ ] **Help Command:** Displaying help information
7878
- [ ] **Version Display:** Showing version information
7979

8080
#### Uncommon Cases:
81-
- [ ] **Multiple Filters:** Using multiple inclusion/exclusion patterns
81+
- [x] **Multiple Filters:** Using multiple inclusion/exclusion patterns *(tests/test_cli.py: test_sync_cli_filter_non_existent with multiple args)*
8282
- [ ] **Interactive Mode:** CLI behavior in interactive mode
8383
- [ ] **Multiple Config Files:** Specifying multiple config files
8484
- [ ] **Special Output Formats:** JSON, detailed, etc.
@@ -87,7 +87,7 @@ This document provides a comprehensive checklist of test coverage for the VCSPul
8787

8888
#### Edge Cases:
8989
- [ ] **Invalid Arguments:** Handling of invalid command-line arguments
90-
- [ ] **Output Redirection:** Behavior when stdout/stderr are redirected
90+
- [x] **Output Redirection:** Behavior when stdout/stderr are redirected *(tests/test_cli.py: uses capsys fixture in most tests)*
9191
- [ ] **Terminal vs. Non-Terminal:** Behavior in different terminal environments
9292
- [ ] **Signal Handling:** Response to interrupts and other signals
9393
- [ ] **Unknown Commands:** Behavior with non-existing commands
@@ -100,17 +100,17 @@ This document provides a comprehensive checklist of test coverage for the VCSPul
100100
### 4. Repository Operations (libvcs interaction)
101101

102102
#### Common Cases:
103-
- [ ] **Repository Cloning:** Basic cloning of repositories
104-
- [ ] **Repository Update:** Updating existing repositories
105-
- [ ] **Remote Management:** Adding/updating remotes for Git
103+
- [x] **Repository Cloning:** Basic cloning of repositories *(tests/test_sync.py: test_makes_recursive)*
104+
- [x] **Repository Update:** Updating existing repositories *(tests/test_sync.py: test_updating_remote)*
105+
- [x] **Remote Management:** Adding/updating remotes for Git *(tests/test_sync.py: test_updating_remote with remotes)*
106106
- [ ] **Status Checking:** Checking repository status
107-
- [ ] **Success and Error Handling:** Managing operation outcomes
107+
- [x] **Success and Error Handling:** Managing operation outcomes *(tests/test_cli.py: test_sync_broken)*
108108

109109
#### Uncommon Cases:
110110
- [ ] **Repository Authentication:** Cloning/updating repos requiring auth
111-
- [ ] **Custom Remote Configurations:** Non-standard remote setups
111+
- [x] **Custom Remote Configurations:** Non-standard remote setups *(tests/test_sync.py: UPDATING_REMOTE_FIXTURES with has_extra_remotes=True)*
112112
- [ ] **Repository Hooks:** Pre/post operation hooks
113-
- [ ] **Shell Commands:** Executing shell commands after operations
113+
- [x] **Shell Commands:** Executing shell commands after operations *(tests/test_config_file.py: test_expand_shell_command_after)*
114114
- [ ] **Repository Recovery:** Recovering from failed operations
115115

116116
#### Edge Cases:
@@ -129,16 +129,16 @@ This document provides a comprehensive checklist of test coverage for the VCSPul
129129
### 5. Utilities and Helpers (util.py, log.py)
130130

131131
#### Common Cases:
132-
- [ ] **Path Manipulation:** Basic path operations
133-
- [ ] **Dictionary Updates:** Merging and updating configuration dictionaries
132+
- [x] **Path Manipulation:** Basic path operations *(tests/test_config_file.py: test_expand_shell_command_after, test_expandenv_and_homevars)*
133+
- [x] **Dictionary Updates:** Merging and updating configuration dictionaries *(tests/test_config_file.py: test_merge_nested_dict)*
134134
- [ ] **Logging Configuration:** Basic logging setup and usage
135135
- [ ] **Process Execution:** Running external commands
136136

137137
#### Uncommon Cases:
138-
- [ ] **Complex Path Resolution:** Resolving complex path references
138+
- [x] **Complex Path Resolution:** Resolving complex path references *(tests/test_config_file.py: test_expandenv_and_homevars)*
139139
- [ ] **Advanced Logging:** Logging with different levels and formats
140140
- [ ] **Process Timeouts:** Handling command execution timeouts
141-
- [ ] **Environment Variable Expansion:** In various contexts
141+
- [x] **Environment Variable Expansion:** In various contexts *(tests/test_utils.py: test_vcspull_configdir_env_var, test_vcspull_configdir_xdg_config_dir)*
142142

143143
#### Edge Cases:
144144
- [ ] **Path Edge Cases:** Unicode, very long paths, special characters
@@ -154,21 +154,21 @@ This document provides a comprehensive checklist of test coverage for the VCSPul
154154
As part of the transition to Pydantic models, these specific areas need thorough testing:
155155

156156
### Common Cases:
157-
- [ ] **Model Creation:** Creating models from valid data
158-
- [ ] **Model Validation:** Basic validation of required fields
157+
- [x] **Model Creation:** Creating models from valid data *(tests/test_validator.py: test_validate_config_with_valid_config)*
158+
- [x] **Model Validation:** Basic validation of required fields *(tests/test_validator.py: test_validate_repo_config_missing_keys)*
159159
- [ ] **Model Serialization:** Converting models to dictionaries
160160
- [ ] **Field Type Coercion:** Automatic type conversion for compatible types
161161

162162
### Uncommon Cases:
163163
- [ ] **Model Inheritance:** Behavior of model inheritance
164164
- [ ] **Custom Validators:** Advanced field validators
165165
- [ ] **Model Composition:** Models containing other models
166-
- [ ] **Validation Error Handling:** Managing and reporting validation errors
166+
- [x] **Validation Error Handling:** Managing and reporting validation errors *(tests/test_validator.py: test_format_pydantic_errors)*
167167

168168
### Edge Cases:
169169
- [ ] **Conversion Between Raw and Validated Models:** Edge cases in model conversion
170170
- [ ] **Circular References:** Handling models with circular references
171-
- [ ] **Optional vs. Required Fields:** Behavior with different field requirements
171+
- [x] **Optional vs. Required Fields:** Behavior with different field requirements *(tests/test_validator.py: test_validate_repo_config_missing_keys)*
172172
- [ ] **Default Values:** Complex default value scenarios
173173
- [ ] **Union Types:** Fields accepting multiple types
174174
- [ ] **Field Constraints:** Min/max length, regex patterns, etc.
@@ -196,21 +196,21 @@ As part of the transition to Pydantic models, these specific areas need thorough
196196
## Test Infrastructure Improvements
197197

198198
### Fixtures:
199-
- [ ] **Repository Fixtures:** Pre-configured repositories of different types
200-
- [ ] **Configuration Fixtures:** Sample configurations of varying complexity
199+
- [x] **Repository Fixtures:** Pre-configured repositories of different types *(tests/fixtures/example.py)*
200+
- [x] **Configuration Fixtures:** Sample configurations of varying complexity *(tests/fixtures/example.py)*
201201
- [ ] **File System Fixtures:** Mock file systems with different characteristics
202202
- [ ] **Network Fixtures:** Mock network responses for repository operations
203203
- [ ] **VCS Command Fixtures:** Mock VCS command execution
204204

205205
### Mocking:
206-
- [ ] **File System Mocking:** Simulating file system operations
206+
- [x] **File System Mocking:** Simulating file system operations *(tests/helpers.py: EnvironmentVarGuard, tmp_path fixtures)*
207207
- [ ] **Network Mocking:** Simulating network operations
208-
- [ ] **Process Execution Mocking:** Simulating command execution
208+
- [x] **Process Execution Mocking:** Simulating command execution *(tests/test_cli.py: various monkeypatch uses)*
209209
- [ ] **Time Mocking:** Controlling time-dependent operations
210210

211211
### Test Categories:
212-
- [ ] **Unit Tests:** Testing individual functions and methods
213-
- [ ] **Integration Tests:** Testing interactions between components
212+
- [x] **Unit Tests:** Testing individual functions and methods *(most tests in the codebase)*
213+
- [x] **Integration Tests:** Testing interactions between components *(tests/test_sync.py, tests/test_cli.py)*
214214
- [ ] **End-to-End Tests:** Testing full workflows
215215
- [ ] **Property Tests:** Testing invariant properties
216216
- [ ] **Performance Tests:** Testing operation speed and resource usage

0 commit comments

Comments
 (0)