Skip to content

Add schema snapshotting util and a snapshot test#4594

Merged
jlndr merged 2 commits into
schemaorg:mainfrom
jlndr:push-kzrqymqowzmz
Nov 20, 2025
Merged

Add schema snapshotting util and a snapshot test#4594
jlndr merged 2 commits into
schemaorg:mainfrom
jlndr:push-kzrqymqowzmz

Conversation

@jlndr
Copy link
Copy Markdown
Contributor

@jlndr jlndr commented Nov 20, 2025

Adding:

  • minimal snapshotting utilities which exports the all-https turtle version of the current schema.
  • 'golden' file of the current schema
  • snapshot test which checks that the current snapshot is up to date with the current schema

This ensures that changes to the complete schema can be observed easily, including changes/additions to the schema itself as well as any code building the schema.

The test could be a fail fast test to run in CI. We can add an github action to run it separately in a follow up. The test runs with the rest of the tests already, but this is quite slow.

demo:

Screenshot 2025-11-19 at 14 55 14

@jlndr jlndr added site tools + python code Infrastructural issues around schema.org site. Most can ignore this! python Pull requests that update Python code labels Nov 20, 2025
@jlndr jlndr force-pushed the push-kzrqymqowzmz branch from 615cc38 to 096bf63 Compare November 20, 2025 09:40
current state.

The snapshot_ttl function writes the current state of the schema into
some output dir, defaulting to `software/tests/snapshot/schemaorg-all-https.ttl`. This file can then be
used for a simple snapshot/diff test to avoid accidental changes to the
schema. When changing the schema the test fails and the 'golden' file needs to be
updated, the updated snapshot is then included into any changes.

MARKDOWN=true
@jlndr jlndr force-pushed the push-kzrqymqowzmz branch from 096bf63 to f89a56e Compare November 20, 2025 09:52
Comment thread software/util/snapshot_schema.py
Copy link
Copy Markdown
Contributor

@pascalfleury pascalfleury left a comment

Choose a reason for hiding this comment

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

that's a good start :-)

@jlndr jlndr merged commit ce585ca into schemaorg:main Nov 20, 2025
1 check passed
@jlndr jlndr deleted the push-kzrqymqowzmz branch November 20, 2025 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Pull requests that update Python code site tools + python code Infrastructural issues around schema.org site. Most can ignore this!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants