Skip to content

Commit

Permalink
#120 All tests are enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
ahsimb committed Jun 25, 2024
1 parent 460215e commit 3cb4aef
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,22 +144,22 @@ def create_and_run(cls,
passing the connection object to it and calls its run method.
Parameters:
schema - schema where the scripts should be created
dsn - On-Prem database address including the port
schema - Schema where the scripts should be created
dsn - On-Prem database host address, including the port
db_user - On-Prem database username
db_password - On-Prem database user password
db_pass - On-Prem database user password
saas_url - SaaS service url
saas_account_id - SaaS account id
saas_database_id - SaaS database id
saas_database_name - SaaS database name, to use in case the id is unknown
saas_database_name - SaaS database name, to be used in case the id is unknown
saas_token - SaaS Personal Access Token (PAT)
use_ssl_cert_validation - Use SSL server certificate validation
ssl_trusted_ca - Path to a file or directory with a CA bundle
ssl_trusted_ca - Path to a file or directory with a trusted CA bundle
ssl_client_certificate - Path to a file with the client SSL certificate
ssl_private_key - Path to a file with the client private key
to_print - if True the script creation SQL commands will be
printed rather than executed
develop - if True the scripts will be generated from scratch
to_print - If True the script creation SQL commands will be
printed rather than executed
develop - If True the scripts will be generated from scratch
"""

# Infer where the database is - on-prem or SaaS.
Expand Down
1 change: 0 additions & 1 deletion tests/ci_tests/test_deploying_autopilot.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ def _deploy_endpoint(job_name, endpoint_name, model_setup_params, ci_test_env: C
assert endpoint_name in list(map(lambda x: x[0], all_scripts))


@pytest.mark.skip
@pytest.mark.parametrize("db_conn,deploy_params", [
(bfs.path.StorageBackend.onprem, bfs.path.StorageBackend.onprem),
(bfs.path.StorageBackend.saas, bfs.path.StorageBackend.saas)
Expand Down
1 change: 0 additions & 1 deletion tests/ci_tests/test_polling_autopilot.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from tests.ci_tests.utils.parameters import cls_model_setup_params


@pytest.mark.skip
@pytest.mark.parametrize("db_conn,deploy_params", [
(bfs.path.StorageBackend.onprem, bfs.path.StorageBackend.onprem),
(bfs.path.StorageBackend.saas, bfs.path.StorageBackend.saas)
Expand Down
2 changes: 0 additions & 2 deletions tests/ci_tests/test_predicting_autopilot.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ def _make_prediction(job_name, endpoint_name, model_setup_params, ci_test_env: C
assert predictions


@pytest.mark.skip
@pytest.mark.parametrize("db_conn,deploy_params", [
(bfs.path.StorageBackend.onprem, bfs.path.StorageBackend.onprem),
(bfs.path.StorageBackend.saas, bfs.path.StorageBackend.saas)
Expand All @@ -78,7 +77,6 @@ def test_predict_autopilot_regression_job(db_conn, deploy_params, prepare_ci_tes
db_conn=prepare_ci_test_environment)


@pytest.mark.skip
@pytest.mark.parametrize("db_conn,deploy_params", [
(bfs.path.StorageBackend.onprem, bfs.path.StorageBackend.onprem),
(bfs.path.StorageBackend.saas, bfs.path.StorageBackend.saas)
Expand Down
2 changes: 0 additions & 2 deletions tests/ci_tests/test_training_autopilot.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from tests.ci_tests.utils.queries import DatabaseQueries


@pytest.mark.skip
@pytest.mark.parametrize("db_conn,deploy_params", [
(bfs.path.StorageBackend.onprem, bfs.path.StorageBackend.onprem),
(bfs.path.StorageBackend.saas, bfs.path.StorageBackend.saas)
Expand All @@ -28,7 +27,6 @@ def test_train_autopilot_regression_job(db_conn, deploy_params, prepare_ci_test_
job_name, reg_model_setup_params, prepare_ci_test_environment)


@pytest.mark.skip
@pytest.mark.parametrize("db_conn,deploy_params", [
(bfs.path.StorageBackend.onprem, bfs.path.StorageBackend.onprem),
(bfs.path.StorageBackend.saas, bfs.path.StorageBackend.saas)
Expand Down
5 changes: 5 additions & 0 deletions tests/ci_tests/utils/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,16 @@


def get_deploy_arg_list(deploy_params: dict[str, Any], schema: str) -> list[Any]:
"""
Creates a CLI parameter list to be used when calling the script deployment
command (see deployment/deploy_cli.py).
"""
args_list: list[Any] = []
for param_name, param_value in deploy_params.items():
args_list.append(f'--{param_name.replace("_", "-")}')
args_list.append(param_value)
args_list.extend(["--schema", schema])
# We validate the server certificate in SaaS, but not in the Docker DB
if "saas_url" in deploy_params:
args_list.append("--use-ssl-cert-validation")
else:
Expand Down
2 changes: 1 addition & 1 deletion tests/deployment/test_deploy_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def get_all_scripts(db_conn):

@pytest.mark.parametrize("db_conn,deploy_params", [
(bfs.path.StorageBackend.onprem, bfs.path.StorageBackend.onprem),
# (bfs.path.StorageBackend.saas, bfs.path.StorageBackend.saas)
(bfs.path.StorageBackend.saas, bfs.path.StorageBackend.saas)
], indirect=True)
def test_deploy_cli_main(db_conn, deploy_params):

Expand Down
3 changes: 2 additions & 1 deletion tests/deployment/test_deploy_create_statements.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@ def get_all_scripts(db_conn):

@pytest.mark.parametrize("db_conn,deploy_params", [
(bfs.path.StorageBackend.onprem, bfs.path.StorageBackend.onprem),
# (bfs.path.StorageBackend.saas, bfs.path.StorageBackend.saas)
(bfs.path.StorageBackend.saas, bfs.path.StorageBackend.saas)
], indirect=True)
def test_deploy_create_statements(db_conn, deploy_params):

# We validate the server certificate in SaaS, but not in the Docker DB
cert_validation = "saas_url" in deploy_params
DeployCreateStatements.create_and_run(**deploy_params, schema=DB_SCHEMA,
use_ssl_cert_validation=cert_validation)
Expand Down

0 comments on commit 3cb4aef

Please sign in to comment.