Skip to content

Add tests for Julia metadata handling#1143

Open
snoopuppy582 wants to merge 2 commits into
Qiskit:mainfrom
snoopuppy582:test/julia-coverage
Open

Add tests for Julia metadata handling#1143
snoopuppy582 wants to merge 2 commits into
Qiskit:mainfrom
snoopuppy582:test/julia-coverage

Conversation

@snoopuppy582
Copy link
Copy Markdown

Summary

Adds JuliaData unit coverage for URL parsing, serialized metadata, JuliaHub URL probing, General registry lookup, download statistics, and update_json orchestration.

Fixes #1106.

Details and comments

The tests mock network calls so they do not depend on JuliaHub, JuliaPackages, the General registry, or Julia download-stat endpoints being reachable during test runs.

Local coverage for ecosystem/julia.py increases to 91% with the new focused tests.

Tests run:

  • uv run --python 3.13 ... pytest tests/models/test_julia.py -q
  • uv run --python 3.13 ... pytest tests/models -q
  • uv run --python 3.13 ... coverage run --source=ecosystem.julia -m unittest tests.models.test_julia && coverage report -m
  • uv run --python 3.13 --with black[jupyter]~=26.3 black --check tests/models/test_julia.py
  • uv run --python 3.13 ... pylint -rn tests/models/test_julia.py
  • git diff --check

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 12, 2026

CLA assistant check
All committers have signed the CLA.

@snoopuppy582
Copy link
Copy Markdown
Author

good

Copy link
Copy Markdown
Member

@1ucian0 1ucian0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Tests should mock network interactions, so they do not fail on network issues. Have a look to #1138 as an example.

@snoopuppy582
Copy link
Copy Markdown
Author

Thanks for the review. I tightened the Julia metadata tests so every ecosystem.julia.request_json call now goes through a strict URL-to-payload mock. If the code tries any unexpected URL, the test raises an assertion instead of silently returning a fallback value. The tests also assert the exact mocked request sequence for the JuliaHub, registry, download stats, and GitHub tree probes.

Verified locally:

  • python -m unittest tests.models.test_julia -v
  • python -m black --check tests/models/test_julia.py
  • python -m pylint -rn tests/models/test_julia.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

increase test coverage of ecosystem/julia.py

3 participants