Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests before release #827

Merged
merged 3 commits into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions tests/integration/flows/test_bigquery_to_adls.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,9 @@ def test_bigquery_to_adls_validate_df_fail(mocked_data):
adls_sp_credentials_secret=ADLS_CREDENTIAL_SECRET,
validate_df_dict={"column_list_to_match": ["type", "country", "test"]},
)
try:
result = flow_bigquery.run()
except ValidationError:
pass

os.remove("test_bigquery_to_adls_validate_df_fail.parquet")
os.remove("test_bigquery_to_adls_validate_df_fail.json")
result = flow_bigquery.run()
assert result.is_failed()


@mock.patch(
Expand Down Expand Up @@ -138,7 +134,5 @@ def test_bigquery_to_adls_validate_df_success(mocked_data):
os.remove("test_bigquery_to_adls_validate_df_success.parquet")
os.remove("test_bigquery_to_adls_validate_df_success.json")

rm = AzureDataLakeRemove(
path=ADLS_DIR_PATH + ADLS_FILE_NAME, vault_name="azuwevelcrkeyv001s"
)
rm = AzureDataLakeRemove(path=ADLS_DIR_PATH + ADLS_FILE_NAME)
rm.run(sp_credentials_secret=ADLS_CREDENTIAL_SECRET)
2 changes: 0 additions & 2 deletions tests/integration/flows/test_mysql_to_adls.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ def test_adls_gen1_to_azure_sql_new_mock(TEST_PARQUET_FILE_PATH):
query=query,
file_path=TEST_PARQUET_FILE_PATH,
to_path=f"raw/examples/{TEST_PARQUET_FILE_PATH}",
sp_credentials_secret="App-Azure-CR-DatalakeGen2-AIA-DEV",
overwrite_adls=True,
)
flow.run()
Expand All @@ -32,7 +31,6 @@ def test_validate_df(TEST_PARQUET_FILE_PATH):
country_short="DE",
query=query,
file_path=TEST_PARQUET_FILE_PATH,
sp_credentials_secret="App-Azure-CR-DatalakeGen2-AIA",
to_path=f"raw/examples/{TEST_PARQUET_FILE_PATH}",
validate_df_dict={"column_size": {"sales_org": 3}},
)
Expand Down
2 changes: 0 additions & 2 deletions tests/integration/flows/test_salesforce_to_adls.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ def test_salesforce_to_adls():
os.remove("test_salesforce_to_adls_run_flow.json")
rm = AzureDataLakeRemove(
path=ADLS_DIR_PATH + ADLS_FILE_NAME,
vault_name="azuwevelcrkeyv001s",
)
rm.run(sp_credentials_secret=credentials_secret)

Expand All @@ -56,6 +55,5 @@ def test_salesforce_to_adls_validate_success():
os.remove("test_salesforce_to_adls_run_flow.json")
rm = AzureDataLakeRemove(
path=ADLS_DIR_PATH + ADLS_FILE_NAME,
vault_name="azuwevelcrkeyv001s",
)
rm.run(sp_credentials_secret=credentials_secret)
10 changes: 3 additions & 7 deletions tests/integration/flows/test_vidclub_to_adls.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ def test_vidclub_validate_df_task_success(caplog):
to_date="2023-10-25",
adls_dir_path="raw/tests",
adls_file_name="test.parquet",
adls_sp_credentials_secret="App-Azure-CR-DatalakeGen2-AIA",
overwrite_adls=True,
validate_df_dict={
"column_size": {"submissionID": 5},
Expand Down Expand Up @@ -78,15 +77,12 @@ def test_vidclub_validate_df_task_fail(caplog):
to_date="2023-10-25",
adls_dir_path="raw/tests",
adls_file_name="test.parquet",
adls_sp_credentials_secret="App-Azure-CR-DatalakeGen2-AIA",
overwrite_adls=True,
validate_df_dict={
"column_size": {"submissionID": 5},
"column_unique_values": ["regionID"],
"column_unique_values": ["id"],
},
)

try:
flow.run()
except ValidationError:
pass
result = flow.run()
assert result.is_failed()
2 changes: 1 addition & 1 deletion tests/integration/tasks/test_vid_club.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def test_drop_columns(var_dictionary):
Args:
var_dictionary: Dictionary with example arguments for run method.
"""
cols_to_drop = ["regionID", "submissionDate"]
cols_to_drop = ["__v", "status"]
vc_to_df = VidClubToDF(credentials=CREDENTIALS)

output_with_dropped = vc_to_df.run(
Expand Down
Loading