Skip to content

Commit e7d2719

Browse files
authored
fix: update system test_model_upload to use BUILD_SPECIFIC_GCP_PROJECT (#1043)
Fixes #972, #877
1 parent 2ba404f commit e7d2719

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

tests/system/aiplatform/test_model_upload.py

+6-7
Original file line numberDiff line numberDiff line change
@@ -19,29 +19,28 @@
1919

2020
import pytest
2121

22-
from google import auth as google_auth
2322
from google.cloud import aiplatform
2423
from google.cloud import storage
2524

2625
from tests.system.aiplatform import e2e_base
2726

28-
# TODO(vinnys): Replace with env var `BUILD_SPECIFIC_GCP_PROJECT` once supported
29-
_, _TEST_PROJECT = google_auth.default()
30-
_TEST_LOCATION = "us-central1"
3127

3228
_XGBOOST_MODEL_URI = "gs://cloud-samples-data-us-central1/vertex-ai/google-cloud-aiplatform-ci-artifacts/models/iris_xgboost/model.bst"
3329

3430

3531
@pytest.mark.usefixtures("delete_staging_bucket")
3632
class TestModel(e2e_base.TestEndToEnd):
37-
_temp_prefix = f"{_TEST_PROJECT}-vertex-staging-{_TEST_LOCATION}"
33+
34+
_temp_prefix = "temp_vertex_sdk_e2e_model_upload_test"
3835

3936
def test_upload_and_deploy_xgboost_model(self, shared_state):
4037
"""Upload XGBoost model from local file and deploy it for prediction. Additionally, update model name, description and labels"""
4138

42-
aiplatform.init(project=_TEST_PROJECT, location=_TEST_LOCATION)
39+
aiplatform.init(
40+
project=e2e_base._PROJECT, location=e2e_base._LOCATION,
41+
)
4342

44-
storage_client = storage.Client(project=_TEST_PROJECT)
43+
storage_client = storage.Client(project=e2e_base._PROJECT)
4544
model_blob = storage.Blob.from_string(
4645
uri=_XGBOOST_MODEL_URI, client=storage_client
4746
)

0 commit comments

Comments
 (0)