Skip to content

Commit

Permalink
updated vertica test with new features
Browse files Browse the repository at this point in the history
  • Loading branch information
vishalkSimplify committed Oct 12, 2023
1 parent d20fa65 commit d55d24c
Show file tree
Hide file tree
Showing 4 changed files with 1,514 additions and 1,028 deletions.
5 changes: 0 additions & 5 deletions metadata-ingestion/tests/integration/vertica/ddl.sql
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,4 @@ SELECT tokenize(phrase) OVER () FROM phrases;
CREATE TEMPORARY TABLE sampletemp (a int, b int) ON COMMIT PRESERVE ROWS;
INSERT INTO sampletemp VALUES(1,2);

-- Create partition key
ALTER TABLE store.store_orders_fact PARTITION BY date_ordered::DATE GROUP BY DATE_TRUNC('month', (date_ordered)::DATE);
SELECT PARTITION_TABLE('store.store_orders_fact');
CREATE PROJECTION ytd_orders AS SELECT * FROM store.store_orders_fact ORDER BY date_ordered
ON PARTITION RANGE BETWEEN date_trunc('year',now())::date AND NULL;
SELECT start_refresh();
20 changes: 8 additions & 12 deletions metadata-ingestion/tests/integration/vertica/test_vertica.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import subprocess
import time
from typing import List, Optional

import pytest
Expand All @@ -17,13 +16,12 @@ def test_resources_dir(pytestconfig):
return pytestconfig.rootpath / "tests/integration/vertica"


def is_vertica_responsive(
container_name: str, port: int, hostname: Optional[str]
) -> bool:
if hostname:
cmd = f"docker logs {container_name} 2>&1 | grep 'Vertica is now running' "
ret = subprocess.run(cmd, shell=True, stdout=subprocess.DEVNULL)

def is_vertica_responsive(container_name: str) -> bool:
cmd = f"docker logs {container_name} 2>&1 | grep 'Vertica is now running' "
ret = subprocess.run(
cmd,
shell=True,
)
return ret.returncode == 0


Expand All @@ -37,9 +35,7 @@ def vertica_runner(docker_compose_runner, test_resources_dir):
"vertica-ce",
5433,
timeout=120,
checker=lambda: is_vertica_responsive(
"vertica-ce", 5433, hostname="vertica-ce"
),
checker=lambda: is_vertica_responsive("vertica-ce"),
)

commands = """
Expand All @@ -56,7 +52,7 @@ def vertica_runner(docker_compose_runner, test_resources_dir):

# Test needs more work to be done , currently it is working fine.
@freeze_time(FROZEN_TIME)
#@pytest.mark.skip("Failing in CI, cmd failing with exit code 1")
# @pytest.mark.skip("Failing in CI, cmd failing with exit code 1")
@pytest.mark.integration
def test_vertica_ingest_with_db(vertica_runner, pytestconfig, tmp_path):
test_resources_dir = pytestconfig.rootpath / "tests/integration/vertica"
Expand Down
Loading

0 comments on commit d55d24c

Please sign in to comment.