diff --git a/ibis-server/tests/conftest.py b/ibis-server/tests/conftest.py index 0c2e17194..4d671fb08 100644 --- a/ibis-server/tests/conftest.py +++ b/ibis-server/tests/conftest.py @@ -3,3 +3,6 @@ def file_path(path: str) -> str: return os.path.join(os.path.dirname(__file__), path) + + +DATAFUSION_FUNCTION_COUNT = 269 diff --git a/ibis-server/tests/routers/v2/connector/test_trino.py b/ibis-server/tests/routers/v2/connector/test_trino.py index fc6ea3677..a2118f4bf 100644 --- a/ibis-server/tests/routers/v2/connector/test_trino.py +++ b/ibis-server/tests/routers/v2/connector/test_trino.py @@ -72,7 +72,7 @@ def trino(request) -> TrinoContainer: db = TrinoContainer().start() # To avoid `TrinoQueryError(type=INTERNAL_ERROR, name=GENERIC_INTERNAL_ERROR, message="nodes is empty")` - time.sleep(10) + time.sleep(5) conn = connect( host=db.get_container_host_ip(), diff --git a/ibis-server/tests/routers/v3/connector/bigquery/test_functions.py b/ibis-server/tests/routers/v3/connector/bigquery/test_functions.py index c9a07c578..579a467d8 100644 --- a/ibis-server/tests/routers/v3/connector/bigquery/test_functions.py +++ b/ibis-server/tests/routers/v3/connector/bigquery/test_functions.py @@ -6,7 +6,7 @@ from app.config import get_config from app.main import app -from tests.conftest import file_path +from tests.conftest import DATAFUSION_FUNCTION_COUNT, file_path from tests.routers.v3.connector.bigquery.conftest import base_url manifest = { @@ -51,13 +51,13 @@ def test_function_list(): response = client.get(url=f"{base_url}/functions") assert response.status_code == 200 result = response.json() - assert len(result) == 269 + assert len(result) == DATAFUSION_FUNCTION_COUNT config.set_remote_function_list_path(function_list_path) response = client.get(url=f"{base_url}/functions") assert response.status_code == 200 result = response.json() - assert len(result) == 299 + assert len(result) == DATAFUSION_FUNCTION_COUNT + 30 the_func = next(filter(lambda x: x["name"] == "abs", result)) assert the_func == { "name": "abs", @@ -72,7 +72,7 @@ def test_function_list(): response = client.get(url=f"{base_url}/functions") assert response.status_code == 200 result = response.json() - assert len(result) == 269 + assert len(result) == DATAFUSION_FUNCTION_COUNT def test_scalar_function(manifest_str: str, connection_info): response = client.post( diff --git a/ibis-server/tests/routers/v3/connector/canner/test_functions.py b/ibis-server/tests/routers/v3/connector/canner/test_functions.py index a6d88e3a2..dbe642595 100644 --- a/ibis-server/tests/routers/v3/connector/canner/test_functions.py +++ b/ibis-server/tests/routers/v3/connector/canner/test_functions.py @@ -6,7 +6,7 @@ from app.config import get_config from app.main import app -from tests.conftest import file_path +from tests.conftest import DATAFUSION_FUNCTION_COUNT, file_path from tests.routers.v3.connector.canner.conftest import base_url manifest = { @@ -51,13 +51,13 @@ def test_function_list(): response = client.get(url=f"{base_url}/functions") assert response.status_code == 200 result = response.json() - assert len(result) == 269 + assert len(result) == DATAFUSION_FUNCTION_COUNT config.set_remote_function_list_path(function_list_path) response = client.get(url=f"{base_url}/functions") assert response.status_code == 200 result = response.json() - assert len(result) == 299 + assert len(result) == DATAFUSION_FUNCTION_COUNT + 30 the_func = next(filter(lambda x: x["name"] == "abs", result)) assert the_func == { "name": "abs", @@ -72,7 +72,7 @@ def test_function_list(): response = client.get(url=f"{base_url}/functions") assert response.status_code == 200 result = response.json() - assert len(result) == 269 + assert len(result) == DATAFUSION_FUNCTION_COUNT def test_scalar_function(manifest_str: str, connection_info): response = client.post( diff --git a/ibis-server/tests/routers/v3/connector/clickhouse/test_functions.py b/ibis-server/tests/routers/v3/connector/clickhouse/test_functions.py index 453a359ba..95ecdba41 100644 --- a/ibis-server/tests/routers/v3/connector/clickhouse/test_functions.py +++ b/ibis-server/tests/routers/v3/connector/clickhouse/test_functions.py @@ -6,7 +6,7 @@ from app.config import get_config from app.main import app -from tests.conftest import file_path +from tests.conftest import DATAFUSION_FUNCTION_COUNT, file_path from tests.routers.v3.connector.clickhouse.conftest import base_url manifest = { @@ -51,13 +51,13 @@ def test_function_list(): response = client.get(url=f"{base_url}/functions") assert response.status_code == 200 result = response.json() - assert len(result) == 269 + assert len(result) == DATAFUSION_FUNCTION_COUNT config.set_remote_function_list_path(function_list_path) response = client.get(url=f"{base_url}/functions") assert response.status_code == 200 result = response.json() - assert len(result) == 348 + assert len(result) == DATAFUSION_FUNCTION_COUNT + 79 the_func = next(filter(lambda x: x["name"] == "abs", result)) assert the_func == { "name": "abs", @@ -72,7 +72,7 @@ def test_function_list(): response = client.get(url=f"{base_url}/functions") assert response.status_code == 200 result = response.json() - assert len(result) == 269 + assert len(result) == DATAFUSION_FUNCTION_COUNT def test_scalar_function(manifest_str: str, connection_info): response = client.post( diff --git a/ibis-server/tests/routers/v3/connector/mssql/test_functions.py b/ibis-server/tests/routers/v3/connector/mssql/test_functions.py index 4b0f5f4ab..5400334e7 100644 --- a/ibis-server/tests/routers/v3/connector/mssql/test_functions.py +++ b/ibis-server/tests/routers/v3/connector/mssql/test_functions.py @@ -6,7 +6,7 @@ from app.config import get_config from app.main import app -from tests.conftest import file_path +from tests.conftest import DATAFUSION_FUNCTION_COUNT, file_path from tests.routers.v3.connector.mssql.conftest import base_url manifest = { @@ -51,13 +51,13 @@ def test_function_list(): response = client.get(url=f"{base_url}/functions") assert response.status_code == 200 result = response.json() - assert len(result) == 269 + assert len(result) == DATAFUSION_FUNCTION_COUNT config.set_remote_function_list_path(function_list_path) response = client.get(url=f"{base_url}/functions") assert response.status_code == 200 result = response.json() - assert len(result) == 321 + assert len(result) == DATAFUSION_FUNCTION_COUNT + 52 the_func = next(filter(lambda x: x["name"] == "abs", result)) assert the_func == { "name": "abs", @@ -72,7 +72,7 @@ def test_function_list(): response = client.get(url=f"{base_url}/functions") assert response.status_code == 200 result = response.json() - assert len(result) == 269 + assert len(result) == DATAFUSION_FUNCTION_COUNT def test_scalar_function(manifest_str: str, connection_info): response = client.post( diff --git a/ibis-server/tests/routers/v3/connector/mysql/test_functions.py b/ibis-server/tests/routers/v3/connector/mysql/test_functions.py index 1b36be49a..e18afbb80 100644 --- a/ibis-server/tests/routers/v3/connector/mysql/test_functions.py +++ b/ibis-server/tests/routers/v3/connector/mysql/test_functions.py @@ -6,7 +6,7 @@ from app.config import get_config from app.main import app -from tests.conftest import file_path +from tests.conftest import DATAFUSION_FUNCTION_COUNT, file_path from tests.routers.v3.connector.mysql.conftest import base_url manifest = { @@ -51,13 +51,13 @@ def test_function_list(): response = client.get(url=f"{base_url}/functions") assert response.status_code == 200 result = response.json() - assert len(result) == 269 + assert len(result) == DATAFUSION_FUNCTION_COUNT config.set_remote_function_list_path(function_list_path) response = client.get(url=f"{base_url}/functions") assert response.status_code == 200 result = response.json() - assert len(result) == 304 + assert len(result) == DATAFUSION_FUNCTION_COUNT + 35 the_func = next(filter(lambda x: x["name"] == "abs", result)) assert the_func == { "name": "abs", @@ -72,7 +72,7 @@ def test_function_list(): response = client.get(url=f"{base_url}/functions") assert response.status_code == 200 result = response.json() - assert len(result) == 269 + assert len(result) == DATAFUSION_FUNCTION_COUNT def test_scalar_function(manifest_str: str, connection_info): response = client.post( diff --git a/ibis-server/tests/routers/v3/connector/postgres/test_functions.py b/ibis-server/tests/routers/v3/connector/postgres/test_functions.py index 7a335a4b9..a65872dbe 100644 --- a/ibis-server/tests/routers/v3/connector/postgres/test_functions.py +++ b/ibis-server/tests/routers/v3/connector/postgres/test_functions.py @@ -6,7 +6,7 @@ from app.config import get_config from app.main import app -from tests.conftest import file_path +from tests.conftest import DATAFUSION_FUNCTION_COUNT, file_path from tests.routers.v3.connector.postgres.conftest import base_url manifest = { @@ -51,13 +51,13 @@ def test_function_list(): response = client.get(url=f"{base_url}/functions") assert response.status_code == 200 result = response.json() - assert len(result) == 269 + assert len(result) == DATAFUSION_FUNCTION_COUNT config.set_remote_function_list_path(function_list_path) response = client.get(url=f"{base_url}/functions") assert response.status_code == 200 result = response.json() - assert len(result) == 318 + assert len(result) == DATAFUSION_FUNCTION_COUNT + 49 the_func = next(filter(lambda x: x["name"] == "abs", result)) assert the_func == { "name": "abs", @@ -72,7 +72,7 @@ def test_function_list(): response = client.get(url=f"{base_url}/functions") assert response.status_code == 200 result = response.json() - assert len(result) == 269 + assert len(result) == DATAFUSION_FUNCTION_COUNT def test_scalar_function(manifest_str: str, connection_info): response = client.post( diff --git a/ibis-server/tests/routers/v3/connector/snowflake/test_functions.py b/ibis-server/tests/routers/v3/connector/snowflake/test_functions.py index 89eb40c03..25802472f 100644 --- a/ibis-server/tests/routers/v3/connector/snowflake/test_functions.py +++ b/ibis-server/tests/routers/v3/connector/snowflake/test_functions.py @@ -6,7 +6,7 @@ from app.config import get_config from app.main import app -from tests.conftest import file_path +from tests.conftest import DATAFUSION_FUNCTION_COUNT, file_path from tests.routers.v3.connector.snowflake.conftest import base_url manifest = { @@ -51,13 +51,13 @@ def test_function_list(): response = client.get(url=f"{base_url}/functions") assert response.status_code == 200 result = response.json() - assert len(result) == 269 + assert len(result) == DATAFUSION_FUNCTION_COUNT config.set_remote_function_list_path(function_list_path) response = client.get(url=f"{base_url}/functions") assert response.status_code == 200 result = response.json() - assert len(result) == 340 + assert len(result) == DATAFUSION_FUNCTION_COUNT + 71 the_func = next(filter(lambda x: x["name"] == "abs", result)) assert the_func == { "name": "abs", @@ -72,7 +72,7 @@ def test_function_list(): response = client.get(url=f"{base_url}/functions") assert response.status_code == 200 result = response.json() - assert len(result) == 269 + assert len(result) == DATAFUSION_FUNCTION_COUNT def test_scalar_function(manifest_str: str, connection_info): response = client.post( diff --git a/ibis-server/tests/routers/v3/connector/trino/test_functions.py b/ibis-server/tests/routers/v3/connector/trino/test_functions.py index 10b33b509..ddf8c51ad 100644 --- a/ibis-server/tests/routers/v3/connector/trino/test_functions.py +++ b/ibis-server/tests/routers/v3/connector/trino/test_functions.py @@ -6,7 +6,7 @@ from app.config import get_config from app.main import app -from tests.conftest import file_path +from tests.conftest import DATAFUSION_FUNCTION_COUNT, file_path from tests.routers.v3.connector.trino.conftest import base_url manifest = { @@ -51,13 +51,13 @@ def test_function_list(): response = client.get(url=f"{base_url}/functions") assert response.status_code == 200 result = response.json() - assert len(result) == 269 + assert len(result) == DATAFUSION_FUNCTION_COUNT config.set_remote_function_list_path(function_list_path) response = client.get(url=f"{base_url}/functions") assert response.status_code == 200 result = response.json() - assert len(result) == 299 + assert len(result) == DATAFUSION_FUNCTION_COUNT + 30 the_func = next(filter(lambda x: x["name"] == "abs", result)) assert the_func == { "name": "abs", @@ -72,7 +72,7 @@ def test_function_list(): response = client.get(url=f"{base_url}/functions") assert response.status_code == 200 result = response.json() - assert len(result) == 269 + assert len(result) == DATAFUSION_FUNCTION_COUNT def test_scalar_function(manifest_str: str, connection_info): response = client.post(