Skip to content

Conversation

@httpdss
Copy link
Owner

@httpdss httpdss commented Aug 10, 2025

This PR improves test coverage focusing on three modules:

  • struct_module/utils.py: Added tests for read_config_file, merge_configs, and get_current_repo (HTTPS/SSH variants and error handling).
  • struct_module/filters.py: Added tests for slugify, get_default_branch (success and error with cache clearing), and get_latest_release (success, fallback to default branch, and error). Achieves 100% coverage for this module.
  • struct_module/content_fetcher.py: Added tests for file://, https:// (cache behavior and HTTP error), githubhttps:// (pull on existing clone), github:// (fresh clone path), githubssh:// (missing file), unsupported scheme, and invalid GitHub path inputs.

Minor code change:

  • Align internal URL parsing in ContentFetcher helpers to accept dispatcher-stripped paths (owner/repo/branch/file_path for GitHub; bucket/key for S3/GCS).

Results locally:

  • All tests pass (71 passed).
  • Overall coverage increased from ~65% to ~68%.
  • Module-specific: filters 100%, utils 94%, content_fetcher 61%.

Next steps (optional):

  • Add more ContentFetcher tests for git subprocess failure paths and S3/GCS ImportError/error handling.
  • Introduce .coveragerc and enforce a minimum coverage threshold in CI (e.g., --cov-fail-under=70) and/or Codecov config.

Please review and let me know if you want me to continue with the additional tests and CI guardrails in this PR or a follow-up.

…ent_fetcher URL parsing to accept stripped paths; add error-path tests
@codecov-commenter
Copy link

codecov-commenter commented Aug 10, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.35%. Comparing base (42219a2) to head (5c470b6).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #89      +/-   ##
==========================================
- Coverage   67.98%   64.35%   -3.64%     
==========================================
  Files          26       18       -8     
  Lines        1718     1139     -579     
  Branches      222      197      -25     
==========================================
- Hits         1168      733     -435     
+ Misses        496      350     -146     
- Partials       54       56       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@httpdss httpdss added the minor label Aug 11, 2025
@httpdss httpdss merged commit f2da39e into main Aug 11, 2025
4 of 5 checks passed
@httpdss httpdss deleted the feat/improve-coverage-utils-content-filters branch August 11, 2025 00:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants