From 65ce425a851ca5fc8577594bc79cd9350b9bc256 Mon Sep 17 00:00:00 2001 From: Sara Robinson Date: Tue, 24 May 2022 11:21:50 -0400 Subject: [PATCH] chore: add tear_down_resources fixture to individual system test classes --- tests/system/aiplatform/test_e2e_tabular.py | 4 +++- tests/system/aiplatform/test_metadata.py | 3 +++ tests/system/aiplatform/test_model_upload.py | 2 +- tests/system/aiplatform/test_tensorboard.py | 3 +++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/system/aiplatform/test_e2e_tabular.py b/tests/system/aiplatform/test_e2e_tabular.py index 31b9bb9769..6746e816a9 100644 --- a/tests/system/aiplatform/test_e2e_tabular.py +++ b/tests/system/aiplatform/test_e2e_tabular.py @@ -46,7 +46,9 @@ } -@pytest.mark.usefixtures("prepare_staging_bucket", "delete_staging_bucket") +@pytest.mark.usefixtures( + "prepare_staging_bucket", "delete_staging_bucket", "tear_down_resources" +) class TestEndToEndTabular(e2e_base.TestEndToEnd): """End to end system test of the Vertex SDK with tabular data adapted from reference notebook http://shortn/_eyoNx3SN0X""" diff --git a/tests/system/aiplatform/test_metadata.py b/tests/system/aiplatform/test_metadata.py index 3d2116fa0a..d5c076e75b 100644 --- a/tests/system/aiplatform/test_metadata.py +++ b/tests/system/aiplatform/test_metadata.py @@ -15,6 +15,8 @@ # limitations under the License. # +import pytest + from google.cloud import aiplatform from tests.system.aiplatform import e2e_base @@ -24,6 +26,7 @@ METRICS = {"sdk-metric-test-1": 0.8, "sdk-metric-test-2": 100} +@pytest.mark.usefixtures("tear_down_resources") class TestMetadata(e2e_base.TestEndToEnd): _temp_prefix = "temp-vertex-sdk-e2e-test" diff --git a/tests/system/aiplatform/test_model_upload.py b/tests/system/aiplatform/test_model_upload.py index 3acc20c103..5591377a1e 100644 --- a/tests/system/aiplatform/test_model_upload.py +++ b/tests/system/aiplatform/test_model_upload.py @@ -28,7 +28,7 @@ _XGBOOST_MODEL_URI = "gs://cloud-samples-data-us-central1/vertex-ai/google-cloud-aiplatform-ci-artifacts/models/iris_xgboost/model.bst" -@pytest.mark.usefixtures("delete_staging_bucket") +@pytest.mark.usefixtures("delete_staging_bucket", "tear_down_resources") class TestModel(e2e_base.TestEndToEnd): _temp_prefix = "temp_vertex_sdk_e2e_model_upload_test" diff --git a/tests/system/aiplatform/test_tensorboard.py b/tests/system/aiplatform/test_tensorboard.py index 501205122f..a1f4634bd9 100644 --- a/tests/system/aiplatform/test_tensorboard.py +++ b/tests/system/aiplatform/test_tensorboard.py @@ -15,10 +15,13 @@ # limitations under the License. # +import pytest + from google.cloud import aiplatform from tests.system.aiplatform import e2e_base +@pytest.mark.usefixtures("tear_down_resources") class TestTensorboard(e2e_base.TestEndToEnd): _temp_prefix = "temp-vertex-sdk-e2e-test"