Skip to content

Commit

Permalink
test: Ensure telemetry uses latest Iglu schemas (meltano#6820)
Browse files Browse the repository at this point in the history
  • Loading branch information
WillDaSilva committed Sep 30, 2022
1 parent 0fe8405 commit 7686939
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions tests/meltano/core/tracking/test_schemas.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
from __future__ import annotations

from pathlib import Path

from meltano.core.tracking import schemas

schemas_dir = (
Path(__file__).parents[4]
/ "src"
/ "meltano"
/ "core"
/ "tracking"
/ "iglu-client-embedded"
/ "schemas"
/ "com.meltano"
)

versions_in_use = {
x.name: x.version.split("-")
for x in vars(schemas).values() # noqa: WPS421
if isinstance(x, schemas.IgluSchema)
}

versions_available = {
schema_dir.stem: max(
x.stem.split("-") for x in (schema_dir / "jsonschema").iterdir()
)
for schema_dir in schemas_dir.iterdir()
}


def test_using_latest_schemas():
assert versions_in_use == versions_available

0 comments on commit 7686939

Please sign in to comment.