new test that fails on digit first or x-digit slot names#755
new test that fails on digit first or x-digit slot names#755
Conversation
LinkML Linting Resultslinkml, version 1.8.4 linting found the following issues. For more information about the linting rule categories, see the LinkML linter documentation. Summary
Problems per SchemaFile: /home/runner/work/mixs/mixs/src/mixs/schema/mixs.yaml Warning
|
2025-04-21Slots whose names start with 'x' and a digit: ['x16s_recover', 'x16s_recover_software'] |
79ecc2a to
4ca4295
Compare
There was a problem hiding this comment.
Pull request overview
Adds a regression test intended to prevent MIxS schema slot names from starting with a digit (or with x followed by a digit), motivated by the ongoing x16s_recover* short-name discussion in #742 / mixs#801.
Changes:
- Introduces a new
unittestthat loadssrc/mixs/schema/mixs.yamlviaSchemaView. - Asserts there are no slots (excluding
MixsCompliantData-domain slots) whose names start with a digit or withx+ digit.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| self.assertListEqual(slot_name_digit_first, [], | ||
| f"Slots whose names start with a digit: {slot_name_digit_first}") | ||
|
|
||
| self.assertListEqual(slot_name_x_digit, [], | ||
| f"Slots whose names start with 'x' and a digit: {slot_name_x_digit}") |
There was a problem hiding this comment.
As written, this test is guaranteed to fail against the current schema because src/mixs/schema/mixs.yaml contains slots like x16s_recover/x16s_recover_software (names starting with x + digit). Since CI runs python -m unittest discover in make test, this will block merging. If the failure is intentional until #742/#801 is addressed, mark the test as an expected failure or skip it with a reference to the issue(s), then flip it back once the schema is updated.
| """Test term name length.""" | ||
|
|
||
| def test_digit_first_term_name(self): | ||
| """Test term name length.""" |
There was a problem hiding this comment.
The docstrings say "term name length", but the test is actually checking for slot names that start with a digit or with x+digit. Updating the class/method docstrings to match the actual assertion would make the intent clearer for future readers.
| """Test term name length.""" | |
| def test_digit_first_term_name(self): | |
| """Test term name length.""" | |
| """Test that slot names do not start with a digit or with 'x' followed by a digit.""" | |
| def test_digit_first_term_name(self): | |
| """Verify that no slot name starts with a digit or with 'x' followed by a digit.""" |
| def test_digit_first_term_name(self): | ||
| """Test term name length.""" | ||
|
|
||
| print("\n") |
There was a problem hiding this comment.
print("\n") adds noise to test output and makes failures harder to scan in CI logs. Consider removing it unless there is a specific debugging need.
| print("\n") |
| import src.mixs.datamodel.mixs as mixs | ||
|
|
There was a problem hiding this comment.
import src.mixs.datamodel.mixs as mixs will raise ModuleNotFoundError during python -m unittest discover because src/ is not a Python package (no src/__init__.py). The import is also unused. Remove it, or import from the installed package namespace (e.g., mixs...) if you intended to validate the generated datamodel is importable.
| import src.mixs.datamodel.mixs as mixs |
|
Merge order and requirementsThis PR should merge after #974, which adds taxon-neutral replacements for the Implementation noteCopilot's review flagged several items worth addressing:
Related
|
This is expected to fail until the
x16s_recoveris fixed.See