2022-05-26 15:29:21 -07:00
|
|
|
import platform
|
|
|
|
|
2022-05-26 12:42:50 +02:00
|
|
|
import pytest
|
|
|
|
from freezegun import freeze_time
|
|
|
|
|
2025-05-19 08:39:53 +02:00
|
|
|
from datahub.testing import mce_helpers
|
2022-05-26 12:42:50 +02:00
|
|
|
from tests.test_helpers.click_helpers import run_datahub_cmd
|
|
|
|
from tests.test_helpers.docker_helpers import wait_for_port
|
|
|
|
|
2023-10-03 23:17:49 -04:00
|
|
|
pytestmark = pytest.mark.integration_batch_2
|
2022-05-26 12:42:50 +02:00
|
|
|
FROZEN_TIME = "2020-04-14 07:00:00"
|
|
|
|
|
|
|
|
|
|
|
|
@freeze_time(FROZEN_TIME)
|
2022-08-03 05:00:36 +00:00
|
|
|
@pytest.mark.xfail # TODO: debug the flakes for this test
|
2022-05-26 15:29:21 -07:00
|
|
|
@pytest.mark.skipif(
|
|
|
|
platform.machine().lower() == "aarch64",
|
|
|
|
reason="The hdbcli dependency is not available for aarch64",
|
|
|
|
)
|
2022-05-26 12:42:50 +02:00
|
|
|
def test_hana_ingest(docker_compose_runner, pytestconfig, tmp_path, mock_time):
|
|
|
|
test_resources_dir = pytestconfig.rootpath / "tests/integration/hana"
|
|
|
|
|
|
|
|
with docker_compose_runner(
|
|
|
|
test_resources_dir / "docker-compose.yml", "hana"
|
|
|
|
) as docker_services:
|
|
|
|
# added longer timeout and pause due to slow start of hana
|
|
|
|
wait_for_port(
|
|
|
|
docker_services=docker_services,
|
|
|
|
container_name="testhana",
|
|
|
|
container_port=39041,
|
|
|
|
hostname="localhost",
|
|
|
|
timeout=700,
|
|
|
|
pause=50,
|
|
|
|
)
|
|
|
|
|
|
|
|
# Run the metadata ingestion pipeline.
|
|
|
|
config_file = (test_resources_dir / "hana_to_file.yml").resolve()
|
|
|
|
run_datahub_cmd(
|
|
|
|
["ingest", "--strict-warnings", "-c", f"{config_file}"], tmp_path=tmp_path
|
|
|
|
)
|
|
|
|
|
|
|
|
# Verify the output.
|
|
|
|
mce_helpers.check_golden_file(
|
|
|
|
pytestconfig,
|
|
|
|
output_path=tmp_path / "hana_mces.json",
|
|
|
|
golden_path=test_resources_dir / "hana_mces_golden.json",
|
|
|
|
)
|