diff --git a/tests/integration/test_schema_protobuf.py b/tests/integration/test_schema_protobuf.py index 0f61980c0..d034cea17 100644 --- a/tests/integration/test_schema_protobuf.py +++ b/tests/integration/test_schema_protobuf.py @@ -8,19 +8,11 @@ from karapace.utils import Client from tests.utils import create_subject_name_factory -import json import logging import pytest -import requests baseurl = "http://localhost:8081" -compatibility_test_url = ( - "https://raw.githubusercontent.com/confluentinc/schema-registry/" - + "0530b0107749512b997f49cc79fe423f21b43b87/" - + "protobuf-provider/src/test/resources/diff-schema-examples.json" -) - def add_slashes(text: str) -> str: escape_dict = { @@ -112,60 +104,3 @@ async def test_protobuf_schema_compatibility(registry_async_client: Client, trai ) assert res.status == 200 assert "id" in res.json() - - -class Schemas: - url = requests.get(compatibility_test_url) - sch = json.loads(url.text) - schemas = {} - descriptions = [] - max_count = 120 - count = 0 - for a in sch: - # if a["description"] == "Detect compatible add field to oneof": - descriptions.append(a["description"]) - schemas[a["description"]] = dict(a) - count += 1 - if a["description"] == "Detect incompatible message index change": - break - if count == max_count: - break - - -@pytest.mark.parametrize("trail", ["", "/"]) -@pytest.mark.parametrize("desc", Schemas.descriptions) -async def test_schema_registry_examples(registry_async_client: Client, trail: str, desc) -> None: - subject = create_subject_name_factory(f"test_protobuf_schema_compatibility-{trail}")() - - res = await registry_async_client.put(f"config/{subject}{trail}", json={"compatibility": "BACKWARD"}) - assert res.status == 200 - - description = desc - - schema = Schemas.schemas[description] - original_schema = schema["original_schema"] - evolved_schema = schema["update_schema"] - compatible = schema["compatible"] - - res = await registry_async_client.post( - f"subjects/{subject}/versions{trail}", json={"schemaType": "PROTOBUF", "schema": original_schema} - ) - assert res.status == 200 - assert "id" in res.json() - - res = await registry_async_client.post( - f"compatibility/subjects/{subject}/versions/latest{trail}", - json={"schemaType": "PROTOBUF", "schema": evolved_schema}, - ) - assert res.status == 200 - assert res.json() == {"is_compatible": compatible} - - res = await registry_async_client.post( - f"subjects/{subject}/versions{trail}", json={"schemaType": "PROTOBUF", "schema": evolved_schema} - ) - - if compatible: - assert res.status == 200 - assert "id" in res.json() - else: - assert res.status == 409