test(sources): add coverage for source pipeline#1161
Conversation
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/test_sources.py`:
- Line 700: Replace the test URL domain to use the .test TLD: locate the
download_url assignment (download_url="https://example.com/pkg-1.0.tar.gz",) in
tests/test_sources.py and change the host from example.com to pkg.test (e.g.,
"https://pkg.test/pkg-1.0.tar.gz") so the test uses the approved .test domain.
- Line 484: The test uses a URL with the example.com TLD; update the hardcoded
return_value string to use the .test TLD instead (e.g., replace
"https://example.com/pkg-1.0.tar.gz" with "https://pkg.test/pkg-1.0.tar.gz") in
tests/test_sources.py where the mock/fixture sets return_value so the test
follows the .test guideline.
- Line 681: Update the test data to use the `.test` TLD instead of example.com:
locate the download_url assignment in tests/test_sources.py (the download_url
variable/argument set to "https://example.com/pkg-1.0.tar.gz") and change it to
use a .test domain such as "https://pkg.test/pkg-1.0.tar.gz" (or the canonical
test path your suite expects) so tests follow the coding guideline.
- Line 344: Replace the hardcoded pathlib.Path("/tmp/numpy-1.0.tar.gz")
assignment for source_filename with the pytest tmp_path fixture so tests are
portable; update the assignment of source_filename to use tmp_path /
"numpy-1.0.tar.gz" (or pathlib.Path(tmp_path) / "numpy-1.0.tar.gz" if needed)
wherever source_filename is defined in the test to ensure it works on non-Unix
systems.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: ca4573f7-4eac-41fc-80bc-cdcc2626059c
📒 Files selected for processing (1)
tests/test_sources.py
- Add dedicated unit tests for get_source_type(), download_source(), unpack_source(), write_build_meta(), read_build_meta(), prepare_source(), ensure_pkg_info(), and build_sdist() in sources.py. - Increase unit test coverage of sources.py from 44% to 77%. Closes python-wheel-build#1098 Signed-off-by: Marcel Nadzam <mnadzam@redhat.com> Co-authored-by: Cursor
Add dedicated unit tests for get_source_type(), download_source(), unpack_source(), write_build_meta(), read_build_meta(), prepare_source(), ensure_pkg_info(), and build_sdist() in sources.py.
Increase unit test coverage of sources.py from 44% to 77%.
Closes test: add coverage for source pipeline (sources.py) #1098
Co-authored-by: Cursor
PR follows CONTRIBUTING.md guidelines