File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed
Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,46 @@ Expected one of: router:
5454Commit prefix validation failed.
5555```
5656
57+ ## Running Unit Tests
58+
59+ The commit linter has comprehensive unit tests. To run them:
60+
61+ ### Prerequisites
62+
63+ Install the test dependencies:
64+
65+ ``` bash
66+ pip install pytest gitpython
67+ ```
68+
69+ ### Running Tests
70+
71+ From the repository root directory, run:
72+
73+ ``` bash
74+ # Run all tests
75+ pytest .github/scripts/tests/test_commit_lint.py -v
76+
77+ # Run a specific test
78+ pytest .github/scripts/tests/test_commit_lint.py::test_valid_commit_single_prefix -v
79+
80+ # Run with more detailed output
81+ pytest .github/scripts/tests/test_commit_lint.py -v -s
82+ ```
83+
84+ Alternatively, you can run from the scripts directory:
85+
86+ ``` bash
87+ cd .github/scripts
88+ pytest tests/test_commit_lint.py -v
89+ ```
90+
91+ The test suite covers:
92+ - Prefix inference from file paths
93+ - Bad squash detection
94+ - Commit validation (success and error cases)
95+ - Edge cases and boundary conditions
96+
5797## Testing Specific Commits
5898
5999To test a specific commit, you can temporarily checkout that commit:
You can’t perform that action at this time.
0 commit comments