Skip to content

Add compatibility tests for bundled linkml-model schemas - #3130

Draft
matentzn wants to merge 1 commit into
mainfrom
add-extendeddt-array-model-tests
Draft

matentzn wants to merge 1 commit into
mainfrom
add-extendeddt-array-model-tests

Conversation

@matentzn

@matentzn matentzn commented Feb 3, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #3129

Depends on #3128

The metamodel compat test suite currently only tests meta.yaml (the core metamodel). But linkml-model also ships schemas like arrays.yaml and extended_types.yaml that users are expected to use in their own schemas. If these don't work with the toolkit, that might be a real problem.

This PR adds parametrized tests that load each bundled schema with SchemaView and generate Python with PythonGenerator. Currently both arrays and extended_types fail — see #3129 for details.

Changes

  • conftest.py: Added bundled_schema_path fixture parametrized over ["arrays", "extended_types"]
  • test_metamodel_projectgen.py: Added test_bundled_schema_loads and test_bundled_schema_python_generates

Known failures

These tests will fail on main until the underlying issues are fixed:

  • arrays: slot_usage on slots not supported by runtime loader
  • extended_types: union_of on types not handled by SchemaLoader

Introduce BUNDLED_SCHEMAS and a bundled_schema_path pytest fixture to expose schemas bundled with linkml-model (atm this is "arrays" and "extended_datatypes". Add tests that ensure each bundled schema can be loaded via SchemaView and can generate compilable Python using PythonGenerator (written to a temp file and compiled with py_compile). Also add necessary imports in the test module.
@codecov

codecov Bot commented Feb 3, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.21%. Comparing base (7abce88) to head (4876c45).
⚠️ Report is 984 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3130      +/-   ##
==========================================
+ Coverage   79.59%   83.21%   +3.62%     
==========================================
  Files         155      155              
  Lines       17582    17582              
  Branches     3595     3595              
==========================================
+ Hits        13994    14631     +637     
+ Misses       2833     2149     -684     
- Partials      755      802      +47     
Flag Coverage Δ
linkml 79.58% <ø> (ø)
runtime 79.58% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 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.

@matentzn matentzn self-assigned this Feb 3, 2026
@matentzn
matentzn marked this pull request as draft February 3, 2026 13:51

This branch has not been deployed

No deployments
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.

Toolkit doesn't fully support bundled linkml-model schemas (arrays, extended_types)

1 participant