-
Notifications
You must be signed in to change notification settings - Fork 134
Enabling some disabled schemaloader tests for improved test coverage #2834
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
Conversation
| description: type 'phenotype' is undefined | ||
|
|
||
| imports: | ||
| - ../../../includes/types |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
completely wrong
| ] | ||
|
|
||
|
|
||
| @pytest.mark.skip(reason="Re-enable this once we get fully migrated") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re-enabled all these tests
| SchemaLoader(fn).resolve() | ||
|
|
||
|
|
||
| @pytest.mark.skip(reason="Re-enable this once we get fully migrated") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re-enabled
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2834 +/- ##
==========================================
+ Coverage 83.03% 83.14% +0.11%
==========================================
Files 126 126
Lines 13994 13994
Branches 2900 2900
==========================================
+ Hits 11620 11636 +16
+ Misses 1737 1727 -10
+ Partials 637 631 -6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| SchemaLoader(fn).resolve() | ||
|
|
||
| @pytest.mark.parametrize( | ||
| ("file", "error"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The majority of these tests were in the same form -- load a dodgy file, check the error message. I parametrised them to save on repetition of the same code.
| SchemaLoader(fn).resolve() | ||
|
|
||
|
|
||
| @pytest.mark.skip(reason="Re-enable this once we get fully migrated") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re-enabled
| def test_type_definition_ok(input_path): | ||
| """A type with either a typeof or uri is OK.""" | ||
| fn = input_path("loaderpass11.yaml") | ||
| SchemaLoader(fn).resolve() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add in some testing rather than just having a successful load being the test
| SchemaLoader(fn).resolve() | ||
|
|
||
|
|
||
| @pytest.mark.skip(reason="Re-enable this once we get fully migrated") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re-enabled
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR re-enables previously disabled SchemaLoader tests to improve test coverage and consolidates multiple error path tests into a more maintainable parameterized format.
Key changes:
- Converts multiple individual test functions into a single parameterized test for error scenarios
- Re-enables previously skipped tests by updating them to work with current SchemaLoader behavior
- Updates test data files to have more accurate descriptions and proper import statements
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/test_utils/test_schemaloader.py | Consolidates error path tests into parameterized format and re-enables disabled tests |
| tests/test_utils/input/loaderpass11.yaml | Updates description to reflect actual test purpose |
| tests/test_utils/input/loadererror5.yaml | Fixes imports and adds proper description |
| tests/test_utils/input/loadererror10.yaml | Updates description to reflect actual test purpose |
Tracking down some schema issues which involved stepping through the SchemaLoader code. Whilst doing so, I checked the tests for the schema loader and found that numerous tests had been disabled. I re-enabled the tests that passed and tidied up the test files a bit.
SchemaLoader does a lot of checks when loading up the schema, and ideally all these checks would be implemented as linter rules. Currently the linter will happily load files that make the SchemaLoader (and generators, etc., that rely on it) fail.