-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
11349b5
commit 69f21e0
Showing
8 changed files
with
172 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
dataContractSpecification: 0.9.2 | ||
id: orders | ||
info: | ||
title: Orders | ||
version: 0.0.1 | ||
description: Order messages as generated by Confluent Datagen Source Adapter | ||
servers: | ||
production: | ||
type: kafka | ||
topic: datamesh.orders.v1 | ||
host: pkc-7xoy1.eu-central-1.aws.confluent.cloud:9092 | ||
models: | ||
orders: | ||
type: table | ||
fields: | ||
ordertime: | ||
type: bigint | ||
orderid: | ||
type: int | ||
itemid: | ||
type: string | ||
orderunits: | ||
type: double | ||
address: | ||
type: object | ||
fields: | ||
city: | ||
type: string | ||
state: | ||
type: string | ||
zipcode: | ||
type: string | ||
quality: | ||
type: SodaCL | ||
specification: | ||
checks for orders: | ||
- row_count >= 5000 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import os | ||
import sys | ||
|
||
import pytest | ||
import six | ||
|
||
# Fix for Python 3.12 | ||
if sys.version_info >= (3, 12, 1): | ||
sys.modules['kafka.vendor.six.moves'] = six.moves | ||
|
||
import logging | ||
|
||
from dotenv import load_dotenv | ||
|
||
from datacontract.data_contract import DataContract | ||
|
||
logging.basicConfig(level=logging.INFO, force=True) | ||
|
||
datacontract = "examples/kafka-remote/datacontract.yaml" | ||
|
||
|
||
@pytest.mark.skipif(os.environ.get("DATACONTRACT_KAFKA_SASL_USERNAME") is None, | ||
reason="Requires DATACONTRACT_KAFKA_SASL_USERNAME to be set") | ||
def _test_examples_kafka_remote(): | ||
load_dotenv(override=True) | ||
# os.environ['DATACONTRACT_KAFKA_SASL_USERNAME'] = "xxx" | ||
# os.environ['DATACONTRACT_KAFKA_SASL_PASSWORD'] = "xxx" | ||
data_contract = DataContract(data_contract_file=datacontract) | ||
|
||
run = data_contract.test() | ||
|
||
print(run) | ||
assert run.result == "passed" |