A project under a directory named test, tests or spec is skipped entirely
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
Research direction
Start with is_test_file in src/crapper/discover.py and trace how iter_source_files and the CLI resolve paths; compare the project-relative test-directory handling described for mutator. Reproduce with a project beneath a directory named test, then verify source files are analyzed and an empty run does not silently pass. Check whether dryer shares the same behavior.
Written by the indexing model from the issue text.
Description
is_test_file (src/crapper/discover.py) looks at every part of the path, and the paths it gets are absolute, because iter_source_files and the CLI resolve them. When any directory above the project root is named test, tests, spec, specs or __tests__, every source file counts as a test. crapper then prints No source files to analyze., exits 0, and writes no .metrics/crap.edn.
mkdir -p /tmp/test/demo/src/demo /tmp/work/demo/src/demo
printf 'def sign(x):\n if x > 0:\n return 1\n return 0\n' | tee /tmp/test/demo/src/demo/core.py > /tmp/work/demo/src/demo/core.py
(cd /tmp/work/demo && crapper --no-coverage) # sign demo.core 2 N/A N/A
(cd /tmp/test/demo && crapper --no-coverage) # No source files to analyze. exit 0
mutator handles the same rule correctly: it skips a test directory only when that directory is the first component of the path relative to the project root. crapper could check path.relative_to(root).parts in the same way.
Because the run exits 0, a quality gate built on crapper passes without checking anything. An empty run could exit non-zero.
dryer has the same is_test_file and behaves the same way (No source files to analyze., exit 0).
- Dominant language
- Python
- Stars
- 255
- Forks
- 101
- Avg merge
- 7m
- Merged PRs (30d)
- 4
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from unclebob/crapper
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Functions missing from the coverage report score 0% with no warningPossibly taken @warxhead1 claimed this 13 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
All issues in unclebob/crapper
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
AIR-Bench Foundation reads the first letter of the word after "answer" as the model's choicePossibly taken @beartester34 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
modelscope/evalscope#2330 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Distribution plot crashes when a numeric feature is constant in the train or test setPossibly taken @adembilge claimed this today. Openbug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
MAIF/shapash#847 · 1 comment ·
Maintainers usually reply within 10 days