Skip to content

Commit 9adec54

Browse files
committed
docs: add pre-PR workflow and test failure documentation
- Add mandatory pre-PR checklist with linting and testing steps - Document JVM restart error in test_sync_ontology.py - Record PR #216 incident as learning example - Emphasize importance of running tests before creating PRs
1 parent 44e8d10 commit 9adec54

1 file changed

Lines changed: 52 additions & 0 deletions

File tree

.copilot/repo-memory.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,55 @@ conda activate temp_owlapy && PYTHONPATH=. pytest --ignore=tests/test_z_do_last_
3939
conda activate temp_owlapy && coverage run -m pytest --ignore=tests/test_z_do_last_ebr_retrieval.py -p no:warnings -x
4040
conda activate temp_owlapy && coverage report -m
4141
```
42+
43+
## Pull Request Workflow
44+
45+
**CRITICAL: Always run tests BEFORE creating a pull request!**
46+
47+
### Pre-PR Checklist
48+
1. ✅ Run linter and fix issues:
49+
```bash
50+
ruff check owlapy --line-length=200 --fix --unsafe-fixes
51+
```
52+
53+
2. ✅ Run full test suite (excluding EBR):
54+
```bash
55+
PYTHONPATH=. pytest --ignore=tests/test_z_do_last_ebr_retrieval.py -p no:warnings -x
56+
```
57+
58+
3. ✅ Verify no test failures (especially JVM-related tests)
59+
60+
4. ✅ Commit changes with descriptive message
61+
62+
5. ✅ Push to feature branch
63+
64+
6. ✅ Create pull request
65+
66+
### Known Test Issues
67+
68+
**JVM Restart Error in test_sync_ontology.py**
69+
- **Error**: `OSError: JVM cannot be restarted` in `test__eq__`
70+
- **Cause**: JPype cannot restart JVM within same Python process after stopJVM() is called
71+
- **Location**: `tests/test_sync_ontology.py::TestSyncOntology::test__eq__`
72+
- **Status**: Pre-existing issue, not introduced by documentation changes
73+
- **Impact**: Fails in CI when test runs after other JVM-dependent tests
74+
- **Workaround**: Run this test in isolation or fix test isolation issues
75+
76+
**Always verify tests pass locally before creating PR to avoid CI failures.**
77+
78+
## Recent Issues and Learnings
79+
80+
### PR #216: Agent Documentation Fixes (May 2026)
81+
- **What happened**: Created PR without running tests first
82+
- **Result**: CI failed with JVM restart error in test_sync_ontology.py
83+
- **Lesson**: ALWAYS run `pytest tests -x` before creating PR
84+
- **Context**: The JVM restart error is a pre-existing issue unrelated to documentation changes, but it highlighted the importance of running tests before PR creation
85+
- **Fix needed**: Test isolation issue where `test__eq__` creates a new SyncOntology after JVM was stopped by previous tests
86+
87+
### How to Detect Test Issues Before PR
88+
```bash
89+
# Run these commands in sequence before any PR:
90+
ruff check owlapy --line-length=200 --fix --unsafe-fixes # Fix linting
91+
PYTHONPATH=. pytest --ignore=tests/test_z_do_last_ebr_retrieval.py -p no:warnings -x # Run tests
92+
# Only create PR if both succeed
93+
```

0 commit comments

Comments
 (0)