[Bug] Rust test-harness crates named `tests-build` and `tests-integration` are classed as production code
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 30/100
Research direction
Start by running the repro one-liner against path_origin in repowise.core.code_origin, around line 1219, and read how it consults test_paths.py, including the _SUPPORT_DIR_WORDS_UNLESS_PACKAGE set near lines 220-222 and the package_root probe near lines 211-216. The chosen rule (a tests-* workspace member root or a publish = false Cargo manifest signal) must be decided first, since the issue asks for a judgement call. Done when tests-build/src/lib.rs and tests-integration/src/lib.rs classify as test, a published tests-* crate stays production, and both tests/unit/test_test_paths.py and tests/unit/test_code_origin.py pass.
Written by the indexing model from the issue text.
Description
Summary
A Rust workspace member that exists only to test the library, such as a crate in tests-build/ or tests-integration/ with publish = false, is classed as production code. Its src/ files count as shipped code everywhere origin is read.
packages/core/src/repowise/core/test_paths.py:220-222
_SUPPORT_DIR_WORDS_UNLESS_PACKAGE: frozenset[str] = frozenset(
{"testhelpers", "testhelper", "testutils", "testutil", "testsupport"}
)
Mechanism
path_origin(code_origin.py:1219) reads test paths fromtest_paths.py, which matches atests/tree (:82) and support directories such astest-util/, not a sibling crate namedtests-build.- Files under
tests-integration/tests/are alreadytest; only the crate'ssrc/reads as production. - Adding
testsbuildto the set above would not help: a support directory that is a package root stays production (:211-216), and every Rust crate has aCargo.toml. The exact signal is the manifest (publish = falseon a crate named for tests), whichpath_origindoes not read today.
Repro
python -c "from repowise.core.code_origin import path_origin as p; [print(x, '->', p(x)) for x in ['tests-build/src/lib.rs', 'tests-integration/src/lib.rs', 'tests-integration/tests/macros.rs', 'test-util/src/lib.rs']]"
On main:
tests-build/src/lib.rs -> production
tests-integration/src/lib.rs -> production
tests-integration/tests/macros.rs -> test
test-util/src/lib.rs -> test
Impact
Test-harness crates count toward hotspots, health and dead code as shipped code.
Done looks like
- Choose the rule: a
tests-*crate name at a workspace member root, or a Cargo manifest signal through the existingpackage_rootprobe. Record the ceiling in a comment. - Apply it in
repowise.core.code_origin/test_paths.py, so every judge inherits it; no per-caller check. - A published crate whose name starts with
testsstays production. - Help wanted: a judgement call on the signal, and possibly a manifest read at ingestion.
Tests
tests/unit/test_test_paths.py and tests/unit/test_code_origin.py: both crate paths are test; a published tests-* crate follows the chosen rule.
- Dominant language
- Python
- Stars
- 7.1k
- Forks
- 756
- Avg merge
- 21h 5m
- Merged PRs (30d)
- 797
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
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 repowise-dev/repowise
-
[Bug] Elixir `.formatter.exs`, `.credo.exs`, `config/*.exs` and `priv/**/*.exs` are reported as unreachable filesPossibly taken @ZYZ666-RGB claimed this 1 day ago. Openbug good first issue
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
repowise-dev/repowise#6296 · 1 comment ·
Maintainers usually reply within 1 day
-
[Bug] Coverage stack detection omits Swift, Dart, and Scala, falling through to UNKNOWN in evidence setupPossibly taken @RishabhIIITD claimed this 2 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
repowise-dev/repowise#5838 · 2 comments ·
Maintainers usually reply within 1 day
-
[Bug] PR-mined decisions store the decision sentence again as their rationalePossibly taken @suyashgitt claimed this 11 days ago. Openbug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
repowise-dev/repowise#5702 · 2 comments ·
Maintainers usually reply within 1 day
-
[Bug] CICS CSD `DEFINE _PGMLIST` startup programs (`_PGMPH`) are not rootsPossibly taken @dchaudhari7177 claimed this 34 days ago. Openbug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
repowise-dev/repowise#4477 ·
Maintainers usually reply within 1 day
-
[Bug] COBOL listing directives EJECT, SKIP1/SKIP2/SKIP3 and TITLE fail to parse and drop the rest of the filePossibly taken @dchaudhari7177 claimed this 34 days ago. Openbug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 91/100
repowise-dev/repowise#4474 ·
Maintainers usually reply within 1 day
All issues in repowise-dev/repowise
Similar issues
-
triage
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
kornia/kornia-rs#1416 · 1 comment ·
Maintainers usually reply within 2 days
-
ui
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
PolicyEngine/ai-inequality#64 ·
Maintainers usually reply within 1 day
-
LinearGaussianStateSpace.dist splits states and observations wrongly when the transition varies over timePossibly taken @PabloRoque claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
pymc-devs/pymc-extras#839 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day