Skip to content

Conversation

vladistan
Copy link
Contributor

  • Extract loader_test helper function from base class
  • Convert 4 test methods to standalone functions
  • Test both YAML and JSON loaders with different models

@codecov
Copy link

codecov bot commented Aug 2, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.38%. Comparing base (2948d08) to head (00a0e8f).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #446   +/-   ##
=======================================
  Coverage   77.38%   77.38%           
=======================================
  Files          52       52           
  Lines        4479     4479           
  Branches      979      979           
=======================================
  Hits         3466     3466           
  Misses        785      785           
  Partials      228      228           

☔ 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.

@vladistan vladistan marked this pull request as ready for review August 4, 2025 14:00
Copy link
Collaborator

@ialarmedalien ialarmedalien left a comment

Choose a reason for hiding this comment

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

use pytest.mark.parametrize instead of the individual test functions

@vladistan vladistan force-pushed the convert-test-loaders-pydantic-to-pytest branch from 4150589 to 87c9f70 Compare August 4, 2025 17:23
@vladistan vladistan requested a review from ialarmedalien August 4, 2025 17:23
@vladistan vladistan force-pushed the convert-test-loaders-pydantic-to-pytest branch from 87c9f70 to c1c94ae Compare August 4, 2025 17:26
@vladistan vladistan force-pushed the convert-test-loaders-pydantic-to-pytest branch from bb35ddc to 96d34dc Compare August 4, 2025 21:18
@vladistan vladistan requested a review from ialarmedalien August 4, 2025 22:09
ialarmedalien
ialarmedalien previously approved these changes Aug 4, 2025
@ialarmedalien ialarmedalien dismissed their stale review August 4, 2025 22:15

tests failing

@vladistan
Copy link
Contributor Author

weird... works on my machine :-(

@vladistan vladistan force-pushed the convert-test-loaders-pydantic-to-pytest branch from e96c670 to 4089c9f Compare August 5, 2025 00:34
@ialarmedalien
Copy link
Collaborator

The issue here is that there is a test somewhere that's creating the files that these tests are using for comparison (the files already exist if you've run the tests locally, which is why it's so hard to debug locally). Files need to be added to the repo for these comparisons to execute correctly. The potentially bigger problem is that some directories are being git-ignored and this problem may affect numerous files in the repo.

@vladistan vladistan force-pushed the convert-test-loaders-pydantic-to-pytest branch from 929b645 to af32ced Compare August 18, 2025 02:49
@vladistan vladistan force-pushed the convert-test-loaders-pydantic-to-pytest branch from af32ced to 2ae80c2 Compare September 3, 2025 02:12
- Extract loader_test helper function from base class
- Convert 4 test methods to standalone functions
- Test both YAML and JSON loaders with different models
@vladistan vladistan force-pushed the convert-test-loaders-pydantic-to-pytest branch 2 times, most recently from 219b8d6 to c694b9c Compare September 4, 2025 02:36
@vladistan
Copy link
Contributor Author

Ahh ... thanks for digging it up. So looks like we are indeed reading other tests outputs, I don't think it's a right thing to do. I copied those outputs into the input directory they are rather short. I think original test was working because it was importing things from other test files which is also not right thing to do. I am going to clean it up and get ready for merging.

@vladistan vladistan force-pushed the convert-test-loaders-pydantic-to-pytest branch from c694b9c to f2ddd0e Compare September 4, 2025 03:05
Explicitly add input files for test cases do not read test inputs from output directory
@vladistan vladistan force-pushed the convert-test-loaders-pydantic-to-pytest branch from f2ddd0e to 883e590 Compare September 4, 2025 03:06
@vladistan
Copy link
Contributor Author

Ok now all tests are passing

@@ -0,0 +1,20 @@
id: S001
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is identical to the other file -- I would just have a single file, book_series_lotr.yaml.

@@ -0,0 +1,41 @@
persons:
Copy link
Collaborator

Choose a reason for hiding this comment

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

it looks like this is also identical to the yaml version -- just add one, no need for duplicates.

@ialarmedalien ialarmedalien merged commit 66b3861 into linkml:main Sep 25, 2025
17 checks passed
@vladistan vladistan deleted the convert-test-loaders-pydantic-to-pytest branch September 26, 2025 20:48
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.

3 participants