2021-02-03 17:37:09 -08:00
|
|
|
import os
|
|
|
|
import subprocess
|
|
|
|
|
|
|
|
|
2021-02-03 20:19:05 -08:00
|
|
|
def test_ingest(sql_server, pytestconfig):
|
2021-02-11 16:00:29 -08:00
|
|
|
docker = "docker"
|
2021-02-03 17:37:09 -08:00
|
|
|
command = f"{docker} exec testsqlserver /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P 'test!Password' -d master -i /setup/setup.sql"
|
2021-02-11 22:48:08 -08:00
|
|
|
ret = subprocess.run(
|
|
|
|
command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE
|
|
|
|
)
|
2021-02-03 17:37:09 -08:00
|
|
|
assert ret.returncode == 0
|
2021-02-11 22:48:08 -08:00
|
|
|
config_file = os.path.join(
|
|
|
|
str(pytestconfig.rootdir), "tests/integration/sql_server", "mssql_to_file.yml"
|
|
|
|
)
|
2021-02-11 16:00:29 -08:00
|
|
|
ingest_command = f'gometa-ingest -c {config_file}'
|
2021-02-03 20:19:05 -08:00
|
|
|
ret = os.system(ingest_command)
|
|
|
|
assert ret == 0
|
2021-02-12 20:17:25 -08:00
|
|
|
# TODO: move to a better way to create an output test fixture
|
|
|
|
os.system("rm ./mssql_mces.json")
|