test: add unit tests for rust resolver#8
Conversation
Signed-off-by: jaydeep869 <jaydeeppokhariya2106@gmail.com>
Signed-off-by: jaydeep869 <jaydeeppokhariya2106@gmail.com>
|
Hey @Jaydeep869, quick question on the compiled artifacts test. The path you used is under /target/debug/deps/ doesn't that get dropped by isRustIgnoredPath before isCompiledRustArtifact or isOwnedByKnownCrate are even reached? If so the test passes but isOwnedByKnownCrate is never actually called. It's worth checking whether that function is even reachable for compiled artifacts given that isRustIgnoredPath drops everything under /target/ first. Also was a direct test for NormalizeRustCrateName intentionally left out? You added TestDecodeGoModulePath in #3 so figured it might have just been missed. And on #12 since you and @Sandipmandal25 are covering the same ground, would it make sense to consolidate into one PR? Happy to leave that to whoever the maintainers prefer but just seems cleaner than two open PRs for the same thing. |
…RustCrateName Signed-off-by: jaydeep869 <jaydeeppokhariya2106@gmail.com>
08356d2 to
0b5bec3
Compare
|
Hey @Elvand-Lie , thank you for the feedback and for taking the time to review this. You were completely right about the compiled artifacts test. The path was indeed getting caught by the ignored paths filter right away, so it never actually reached or validated the compiled artifact functions. I have updated the test to use a direct registry path so those functions are properly tested and verified. |
#12 closed in the favour of this pr |
|
Can you run |
Signed-off-by: jaydeep869 <jaydeeppokhariya2106@gmail.com>
f7047f1 to
81bcda8
Compare
Sure @stupendoussuperpowers, I’ve run |
Description:
This PR introduces comprehensive unit tests for the Rust resolver, completing the test coverage for all ecosystem resolvers.
Changes:
pkg/resolver/rust_test.gowith 13 robust test cases.registry/srcandregistry/cache).index.crates.ioindexing paths./target/) and internal project source paths.pkg:cargo/<name>@<version>).Matcheschecks viaCreateFileFilters.Motivation:
Addresses the lack of unit tests for the Rust resolver, catching errors with Cargo path parsing and maintaining parity with tests added in PRs #2 and #3.
Fixes: #6
Checklist
ResolveandCreateFileFilters)go test ./pkg/resolver -v -run Rust)