Add comprehensive test coverage for UV detector#1758
Open
bd-spratikbharti wants to merge 6 commits into
Open
Conversation
…ders for uv lockfile(buildless) detector
Contributor
There was a problem hiding this comment.
Pull request overview
Adds unit/functional/battery test coverage for the UV (Python package manager) detector to validate argument building, parsing of uv tree output, parsing of uv.lock, and end-to-end detection via battery fixtures.
Changes:
- Added unit tests for UV CLI argument construction and UV parsers/transformers (TOML, lockfile, tree output).
- Added a functional test for excluding dev dependency groups via
--no-group. - Added new battery fixtures (sample UV projects + expected BDIO) and a
UVBatterytest suite to run them.
Reviewed changes
Copilot reviewed 14 out of 73 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/test/resources/battery/uv-workspace/uv-tree.xout | Battery fixture: uv tree output for a multi-member workspace. |
| src/test/resources/battery/uv-workspace/pyproject.toml | Battery fixture: root workspace pyproject.toml with [tool.uv.workspace]. |
| src/test/resources/battery/uv-workspace/lib-utils/pyproject.toml | Battery fixture: workspace member project definition. |
| src/test/resources/battery/uv-workspace/lib-core/pyproject.toml | Battery fixture: workspace member project definition. |
| src/test/resources/battery/uv-simple/uv-tree.xout | Battery fixture: uv tree output for a simple project. |
| src/test/resources/battery/uv-simple/pyproject.toml | Battery fixture: simple UV-managed pyproject.toml. |
| src/test/resources/battery/uv-devdeps/uv-tree.xout | Battery fixture: uv tree output including dev-group dependencies. |
| src/test/resources/battery/uv-devdeps/pyproject.toml | Battery fixture: project with optional dev dependencies. |
| src/test/java/com/blackduck/integration/detect/battery/detector/UVBattery.java | New battery test runner for uv-simple/uv-devdeps/uv-workspace scenarios. |
| detectable/src/test/java/com/blackduck/integration/detectable/detectables/uv/unit/UVTreeDependencyGraphTransformerTest.java | Unit tests for parsing uv tree output into dependency graphs/code locations. |
| detectable/src/test/java/com/blackduck/integration/detectable/detectables/uv/unit/UVTomlParserTest.java | Unit tests for pyproject.toml parsing (name/version, managed flag). |
| detectable/src/test/java/com/blackduck/integration/detectable/detectables/uv/unit/UVLockParserTest.java | Unit tests for parsing uv.lock into graphs (groups, workspaces, transitives). |
| detectable/src/test/java/com/blackduck/integration/detectable/detectables/uv/unit/UVBuildExtractorTest.java | Unit tests for uv tree CLI argument building (groups include/exclude, conflicts, all). |
| detectable/src/test/java/com/blackduck/integration/detectable/detectables/uv/functional/UVExcludeDevGroupsFunctionalTest.java | Functional test validating end-to-end dev group exclusion behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Description
Summary
Adds unit, functional, and battery tests for the UV detector.
Test Coverage Added
Unit Tests
--group,--no-group,--all-groupsflags;detect.uv.dependency.groups.includedbehavior (single group, multiple groups,ALLkeyword case-insensitive);conflict resolution when a group appears in both included and excluded lists (excluded takes precedence);
edge case —
ALLkeyword combined with explicit exclusionspyproject.tomlFunctional Tests
UVDetectableFunctionalTest— baseline detection (pre-existing)UVExcludeDevGroupsFunctionalTest— dev group exclusion via build detectorBattery Tests
uv-simple— single-package UV projectuv-devdeps— project with dev group dependenciesuv-workspace— multi-member UV workspaceNotes
detect.uv.dependency.groups.includedis only supported by the UV Build Detector (CLI mode).Lockfile detector support is tracked separately; placeholder comments added in relevant tests.