Drop the TESTS edge kind and its filename-affix machinery#70
Open
janrito wants to merge 2 commits into
Open
Conversation
infer_test_edges linked a test function to the source symbol it tests, using test_prefix/test_suffix filename conventions plus import analysis (with a crude fallback to the first source symbol). The real signal — the test file importing the code — is already captured as an IMPORTS edge, so the dedicated TESTS edge was largely redundant and its name-matching was noise. Remove test_prefix/test_suffix from LanguageRegistration and all plugins, delete infer_test_edges + _strip_test_affix + the now-orphaned _find_source_file/_imported_names_from_file, drop EdgeKind.TESTS, and excise the test-edge cases/tests. Import and cross-language/injection edges are untouched. Regenerate the pi-rbtr protocol schema.
Commit dropping the feature missed the doc/extension surface that still advertised it: the find-refs edge-kind lists in both READMEs and the rbtr_find_refs tool descriptions (kind=imports|tests|docs, 'which tests cover X'). Update them to imports/docs only.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Remove the
TESTSedge — the graph link from a test to the code itexercises — and the per-plugin configuration that drove it.
infer_test_edgeslinked a test function to the source symbol it tests.It located the source by filename convention —
test_prefix/test_suffixstrippedtest_foo.pydown tofooto guess the matchingfile — then either linked test functions to the symbols the test actually
imports, or, failing that, fell back to linking every test function to the
first symbol in the file. That fallback is a guess, and the rest is
redundant: the “test imports the code” relationship it leaned on is already
recorded as an
IMPORTSedge, independently. So the dedicatedTESTSedgewas a noisy, name-matching-dependent layer over a signal the import edge
already carries, and
test_prefix/test_suffixwere per-pluginconfiguration that every one of the ~20 languages still to be packaged
would otherwise have to carry.
Import edges are untouched — including cross-language ones, like an HTML
page's
<script>and<link>resolving to js/ts/css, and languageinjection — so only the test-specific edge and its configuration go.
Confirming that a language actually produces its edges, the one thing the
removed feature was informally used for, is covered instead by each
package's sample, which pins its real import edges; injection-capable
packages embed other-language code so their cross-language edges are
pinned too.
The docs that advertised the feature — the find-refs edge-kind lists and
the
rbtr_find_refstool description — drop theirtestsmentions.No extraction changes. The generated TypeScript
EdgeKindtype drops"tests"to match.