mirror of
https://github.com/datahub-project/datahub.git
synced 2025-07-04 23:57:03 +00:00
24 lines
754 B
Python
24 lines
754 B
Python
import mce_helpers
|
|
from click.testing import CliRunner
|
|
|
|
from datahub.entrypoints import datahub
|
|
|
|
|
|
def test_mysql_ingest(mysql, pytestconfig):
|
|
test_resources_dir = pytestconfig.rootpath / "tests/integration/mysql"
|
|
config_file = (test_resources_dir / "mysql_to_file.yml").resolve()
|
|
|
|
# Run the metadata ingestion pipeline.
|
|
runner = CliRunner()
|
|
with runner.isolated_filesystem():
|
|
result = runner.invoke(datahub, ["ingest", "-c", f"{config_file}"])
|
|
assert result.exit_code == 0
|
|
|
|
output = mce_helpers.load_json_file("mysql_mces.json")
|
|
|
|
# Verify the output.
|
|
golden = mce_helpers.load_json_file(
|
|
str(test_resources_dir / "mysql_mce_golden.json")
|
|
)
|
|
mce_helpers.assert_mces_equal(output, golden)
|