test: add skills catalog loading and validation tests#666
Conversation
Cover validate_requested_skills, load_skills, internal category exclusion, and regression checks for merged community skills.
Greptile SummaryThis PR adds tests for the skills catalog loader and validator. The main changes are:
Confidence Score: 5/5The changed tests look safe to merge after a small cleanup to the catalog content assertion.
tests/test_skills.py Important Files Changed
Prompt To Fix All With AIFix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
tests/test_skills.py:87
**Short Skills Fail Catalog Test**
When a valid skill has non-empty content of 100 characters or less after frontmatter stripping, this catalog test fails even though the loader contract is satisfied. That can block lightweight skill additions for test policy rather than a broken catalog entry.
```suggestion
assert content[name].strip(), f"{name}: loaded body is empty"
```
Reviews (1): Last reviewed commit: "test: add skills catalog loading and val..." | Re-trigger Greptile |
| for name in sorted(get_all_skill_names()): | ||
| content = load_skills([name]) | ||
| assert name in content, f"{name}: load_skills did not return content" | ||
| assert len(content[name].strip()) > 100, f"{name}: loaded body too short" |
There was a problem hiding this comment.
Short Skills Fail Catalog Test
When a valid skill has non-empty content of 100 characters or less after frontmatter stripping, this catalog test fails even though the loader contract is satisfied. That can block lightweight skill additions for test policy rather than a broken catalog entry.
| assert len(content[name].strip()) > 100, f"{name}: loaded body too short" | |
| assert content[name].strip(), f"{name}: loaded body is empty" |
Prompt To Fix With AI
This is a comment left during a code review.
Path: tests/test_skills.py
Line: 87
Comment:
**Short Skills Fail Catalog Test**
When a valid skill has non-empty content of 100 characters or less after frontmatter stripping, this catalog test fails even though the loader contract is satisfied. That can block lightweight skill additions for test policy rather than a broken catalog entry.
```suggestion
assert content[name].strip(), f"{name}: loaded body is empty"
```
How can I resolve this? If you propose a fix, please make it concise.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Assert non-empty loaded content instead of a 100-char minimum.
|
cc: @rajpratham1 |
Summary
Adds unit tests for
strix.skills— previously untested despite growing community skill contributions.Covers:
scan_modes,coordination) excluded from user-selectable skillsoauth,aws,django,prototype_pollution,insecure_deserialization)validate_requested_skills()success and error pathsload_skills()frontmatter stripping, category-prefixed names, missing-skill handlingWhy
Verification
Test plan
pytest tests/test_skills.py— 11 passed locallyruff check tests/test_skills.py— clean