glotaran / pyglotaran

A Python library for Global and Target Analysis of time-resolved spectroscopy data
GNU Lesser General Public License v3.0
53 stars 18 forks source link

🧪🧹 Remove test of upstream schema creation functionality #1464

Closed s-weigand closed 3 months ago

s-weigand commented 3 months ago

Rather than testing upstream functionality for an exact match, we should test that the schema we generate for a spec file validate correctly. The problem with testing exact schema matching is that it is too tightly coupled to the exact syntax of the schema, even so they might be functionally equivalent, leading to failing unit tests due to upstream schema refinements.

See this recent CI fail with unrelated changes:

Omitting 5 identical items, use -vv to show
  Differing items:
  {'properties': {'type': {'const': None, 'enum': [None], 'title': 'Type', 'type': 'null'}}} != {'properties': {'type': {'const': None, 'title': 'Type'}}}

  Full diff:
    {
        'additionalProperties': False,
        'description': 'This is just a mock item for testing.',
        'properties': {
            'type': {
                'const': None,
  +             'enum': [
  +                 None,
  +             ],
                'title': 'Type',
  +             'type': 'null',
            },
        },
        'required': [
            'type',
        ],
        'title': 'MockTypedItem',
        'type': 'object',
    }

Checklist

github-actions[bot] commented 3 months ago

Binder :point_left: Launch a binder notebook on branch s-weigand/pyglotaran/remove-schema-test

sourcery-ai[bot] commented 3 months ago

🧙 Sourcery is reviewing your pull request!


Tips - Trigger a new Sourcery review by commenting `@sourcery-ai review` on the pull request. - You can change your review settings at any time by accessing your [dashboard](https://sourcery.ai/dashboard): - Enable or disable the Sourcery-generated pull request summary or reviewer's guide; - Change the review language; - You can always [contact us](mailto:support@sourcery.ai) if you have any questions or feedback.
sonarcloud[bot] commented 3 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud