Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Progress on catalog version reporting #295

Merged
merged 13 commits into from
Dec 10, 2024

Conversation

marc-white
Copy link
Collaborator

Progress on #294 .

This PR updates the existing available_versions function to:

  • Use pathlib.Path instead of the os module;
  • Consider the min/max/default versions of the catalog specified in the catalog.yaml when reporting available versions;
  • Mark the default version in the pretty printout return.

Tests have also been updated as required.

@marc-white marc-white linked an issue Dec 9, 2024 that may be closed by this pull request
Copy link

codecov bot commented Dec 9, 2024

Codecov Report

Attention: Patch coverage is 81.81818% with 4 lines in your changes missing coverage. Please review.

Project coverage is 98.20%. Comparing base (2f5ba48) to head (6a9012d).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/access_nri_intake/data/utils.py 81.81% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #295      +/-   ##
==========================================
- Coverage   98.49%   98.20%   -0.29%     
==========================================
  Files          11       11              
  Lines         996     1058      +62     
==========================================
+ Hits          981     1039      +58     
- Misses         15       19       +4     

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

@marc-white
Copy link
Collaborator Author

I added more tests, but codecov still thinks I'm not testing L60-63 of data.utils.available_versions.

@charles-turner-1
Copy link
Collaborator

charles-turner-1 commented Dec 9, 2024

I'll take a proper look at this first thing tomorrow morning.

Copy link
Collaborator

@charles-turner-1 charles-turner-1 left a comment

Choose a reason for hiding this comment

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

I suspect that codecov might be getting upset because of the way the mocks are defined?
eg. test_data:

@mock.patch("access_nri_intake.data.utils.get_catalog_fp")
-77 def test_available_versions_no_catalog(mock_get_catalog_fp):
-78    mock_get_catalog_fp.return_value = "/this/is/not/real.yaml"
-79    with pytest.raises(FileNotFoundError):
-80        available_versions()
+ @mock.patch("access_nri_intake.data.utils.get_catalog_fp")
+ def test_available_versions_no_catalog(mock_get_catalog_fp):
+    mock_get_catalog_fp.return_value = "/this/is/not/real.yaml"
+    with pytest.raises(FileNotFoundError):
+        available_versions()

Intellisense is complaining to me that the mock_get_catalog_fp fixture is unused - maybe that's what's throwing codecov off the trail?

Otherwise, a few minor nitpicks (I think I'm a bit jumpy after letting the overflow bug into main) but otherwise looks good.

src/access_nri_intake/data/utils.py Outdated Show resolved Hide resolved
src/access_nri_intake/data/utils.py Show resolved Hide resolved
src/access_nri_intake/data/utils.py Outdated Show resolved Hide resolved
src/access_nri_intake/data/utils.py Outdated Show resolved Hide resolved
@charles-turner-1 charles-turner-1 self-requested a review December 10, 2024 03:44
@charles-turner-1
Copy link
Collaborator

Whoops, accidentally requested a review instead of giving one...

@charles-turner-1 charles-turner-1 removed their request for review December 10, 2024 03:45
Copy link
Collaborator

@charles-turner-1 charles-turner-1 left a comment

Choose a reason for hiding this comment

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

Looks to me like codecov is talking nonsense, so I think this is ready to merge.

@marc-white marc-white merged commit 293d484 into main Dec 10, 2024
16 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

Improve catalog version reporting
2 participants