chore(test): add a rapid property test for the --file case and backslash rules
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- Half a day
- Newbie friendliness
- 72/100
Research direction
Read filterByFile and normalizeNarrowPath in internal/query/node.go, then the two example tests TestCalleesWithTheEndOfAFilePath and TestCalleesWithABackslashFilePath in internal/query/definitions_test.go. Use TestFileSelectionPartitionsTheUnion and the drawGraph generator as the pattern for a rapid.Check test. Done when the new property test checks that the filter keeps exactly the file-bearing nodes whose normalized path contains the normalized hint, and that case and separator changes in the hint keep the same nodes, and go test ./internal/query/ passes.
Written by the indexing model from the issue text.
Description
What kind of chore?
Test infrastructure
What needs doing?
Add a rapid property test for the --file rules in filterByFile (internal/query/node.go:214). The rules ignore letter case and treat a backslash as a slash, through normalizeNarrowPath (internal/query/node.go:206).
Only two example tests cover these rules: TestCalleesWithTheEndOfAFilePath (internal/query/definitions_test.go:605) and TestCalleesWithABackslashFilePath (internal/query/definitions_test.go:624).
The property: the filter keeps a node that has a file and whose normalized path contains the normalized hint. It drops every other node. A hint that differs only in case or separators keeps the same nodes.
TestFileSelectionPartitionsTheUnion (internal/query/definitions_test.go:932) already uses rapid.Check, but it tests the partition of rows by file. It does not test the case or separator rules. The new test can reuse the graph generator drawGraph (internal/query/definitions_test.go:823).
Why now?
Each case the examples miss can drop rows from callers, callees and impact without an error. filterByFile documents that those commands use it as a hard filter (internal/query/node.go:210). A property test covers every case in the rule, not only the ones someone wrote down.
Issue #221 asks for property tests as part of its test cleanup. This change adds one test and does not change the scope of #221.
Does this touch anything load-bearing?
- The release pipeline (
release.yml,.goreleaser.yaml, signing) - The upgrade identity (
internal/upgrade/verify.go) - The perf baseline (
tools/bench/baseline.json) - The graph schema / meta-key layout
- None of these
Before submitting
- I searched existing issues and this is not a duplicate
🤖 Generated with Claude Code
- Dominant language
- Go
- Stars
- 0
- Forks
- 0
- Avg merge
- 5h 16m
- Merged PRs (30d)
- 107
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 seanb4t/codegraph-go
-
area:indexer bug needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
seanb4t/codegraph-go#385 ·
Maintainers usually reply within 1 day
-
chore needs-triage
Difficulty 1/5 Under an hour Newbie friendliness 88/100
seanb4t/codegraph-go#380 ·
Maintainers usually reply within 1 day
-
chore needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
seanb4t/codegraph-go#379 ·
Maintainers usually reply within 1 day
-
chore needs-triage
Difficulty 1/5 1-3 hours Newbie friendliness 84/100
seanb4t/codegraph-go#362 ·
Maintainers usually reply within 1 day
-
area:query bug priority:low spec-needed
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
seanb4t/codegraph-go#355 ·
Maintainers usually reply within 1 day
All issues in seanb4t/codegraph-go
Similar issues
-
enhancement exporter/awskinesis needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
open-telemetry/opentelemetry-collector-contrib#53334 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
erigontech/erigon#26523 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 83/100
SocialGouv/iterion#3376 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
seaweedfs/seaweedfs#12740 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day