2021-02-09 01:02:05 -08:00
|
|
|
import os
|
|
|
|
import pytest
|
|
|
|
import subprocess
|
|
|
|
|
2021-02-11 12:53:44 -08:00
|
|
|
import mce_helpers
|
|
|
|
|
2021-02-09 01:02:05 -08:00
|
|
|
|
2021-02-11 12:24:20 -08:00
|
|
|
|
|
|
|
def test_ingest(mysql, pytestconfig, tmp_path):
|
|
|
|
test_resources_dir = pytestconfig.rootpath / "tests/integration/mysql"
|
|
|
|
|
|
|
|
config_file=(test_resources_dir / "mysql_to_file.yml").resolve()
|
|
|
|
ingest_command=f'cd {tmp_path} && gometa-ingest -c {config_file}'
|
2021-02-09 01:02:05 -08:00
|
|
|
ret = os.system(ingest_command)
|
|
|
|
assert ret == 0
|
|
|
|
|
2021-02-11 12:53:44 -08:00
|
|
|
output = mce_helpers.load_json_file(str(tmp_path / "mysql_mces.json"))
|
|
|
|
golden = mce_helpers.load_json_file(str(test_resources_dir / "mysql_mce_golden.json"))
|
|
|
|
mce_helpers.assert_mces_equal(output, golden)
|