Skip to content

Commit 48eb62d

Browse files
yinghsienwucopybara-github
authored andcommitted
chore: internal clean up
PiperOrigin-RevId: 866516569
1 parent 04aacbb commit 48eb62d

File tree

4 files changed

+19
-2
lines changed

4 files changed

+19
-2
lines changed

tests/system/aiplatform/e2e_base.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,8 @@ def tear_down_resources(self, shared_state: Dict[str, Any]):
200200
aiplatform.Endpoint,
201201
aiplatform.Featurestore,
202202
aiplatform.MatchingEngineIndexEndpoint,
203+
aiplatform.BatchPredictionJob,
204+
aiplatform.ModelDeploymentMonitoringJob,
203205
),
204206
):
205207
# For endpoint, undeploy model then delete endpoint

tests/system/aiplatform/test_featurestore.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ def test_create_get_list_featurestore(self, shared_state):
7676
featurestore_name=featurestore.resource_name
7777
)
7878
assert featurestore.resource_name == get_featurestore.resource_name
79-
8079
list_featurestores = aiplatform.Featurestore.list()
8180
assert get_featurestore.resource_name in [
8281
featurestore.resource_name for featurestore in list_featurestores

tests/system/vertex_ray/test_ray_data.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,15 @@ def create_bigquery_script(version: str):
7777
}
7878

7979

80+
@pytest.mark.usefixtures(
81+
"prepare_bigquery_dataset",
82+
"delete_bigquery_dataset",
83+
)
8084
class TestRayData(e2e_base.TestEndToEnd):
8185
_temp_prefix = "temp-ray-data"
8286

8387
@pytest.mark.parametrize("cluster_ray_version", ["2.33", "2.42", "2.47"])
84-
def test_ray_data(self, cluster_ray_version):
88+
def test_ray_data(self, cluster_ray_version, shared_state):
8589
head_node_type = vertex_ray.Resources()
8690
worker_node_types = [
8791
vertex_ray.Resources(),
@@ -147,6 +151,14 @@ def test_ray_data(self, cluster_ray_version):
147151
print(client.get_job_info(job_id).message)
148152
raise RuntimeError("The Ray Job encountered an error and failed")
149153

154+
# Delete the bigquery dataset
155+
version_suffix = cluster_ray_version.replace(".", "")
156+
dataset_id = f"bugbashbq1.system_test_ray{version_suffix}_write"
157+
bigquery_client = shared_state["bigquery_client"]
158+
bigquery_client.delete_dataset(
159+
dataset_id, delete_contents=True, not_found_ok=True
160+
)
161+
150162
vertex_ray.delete_ray_cluster(cluster_resource_name)
151163
# Ensure cluster was deleted
152164
for cluster in vertex_ray.list_ray_clusters():

tests/system/vertexai/test_batch_prediction.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ def test_batch_prediction_with_bq_input(self, shared_state):
9191
output_uri_prefix=f"bq://{shared_state['bigquery_dataset_id']}",
9292
)
9393
shared_state["resources"].append(job)
94+
bigquery_client = shared_state["bigquery_client"]
95+
bigquery_client.delete_dataset(
96+
shared_state["bigquery_dataset_id"], delete_contents=True, not_found_ok=True
97+
)
9498

9599
assert (
96100
job.model_name == _GEMINI_MODEL_RESOURCE_NAME

0 commit comments

Comments
 (0)