31
31
from unittest import mock
32
32
from unittest .mock import patch
33
33
34
+ import test_training_jobs
35
+
34
36
from google .auth import credentials as auth_credentials
35
37
36
38
from google .cloud import aiplatform
89
91
_TEST_SERVING_CONTAINER_IMAGE = "gcr.io/test-serving/container:image"
90
92
_TEST_SERVING_CONTAINER_PREDICTION_ROUTE = "predict"
91
93
_TEST_SERVING_CONTAINER_HEALTH_ROUTE = "metadata"
94
+ _TEST_MODULE_NAME = f"{ source_utils ._TrainingScriptPythonPackager ._ROOT_MODULE } .task"
92
95
93
96
_TEST_METADATA_SCHEMA_URI_NONTABULAR = schema .dataset .metadata .image
94
97
_TEST_ANNOTATION_SCHEMA_URI = schema .dataset .annotation .image .classification
@@ -827,7 +830,7 @@ def test_run_call_pipeline_service_create_with_tabular_dataset(
827
830
},
828
831
"python_package_spec" : {
829
832
"executor_image_uri" : _TEST_TRAINING_CONTAINER_IMAGE ,
830
- "python_module" : source_utils . _TrainingScriptPythonPackager . module_name ,
833
+ "python_module" : _TEST_MODULE_NAME ,
831
834
"package_uris" : [_TEST_OUTPUT_PYTHON_PACKAGE_PATH ],
832
835
"args" : true_args ,
833
836
"env" : true_env ,
@@ -995,7 +998,7 @@ def test_run_call_pipeline_service_create_with_bigquery_destination(
995
998
},
996
999
"python_package_spec" : {
997
1000
"executor_image_uri" : _TEST_TRAINING_CONTAINER_IMAGE ,
998
- "python_module" : source_utils . _TrainingScriptPythonPackager . module_name ,
1001
+ "python_module" : test_training_jobs . _TEST_MODULE_NAME ,
999
1002
"package_uris" : [_TEST_OUTPUT_PYTHON_PACKAGE_PATH ],
1000
1003
"args" : true_args ,
1001
1004
"env" : true_env ,
@@ -1303,7 +1306,7 @@ def test_run_call_pipeline_service_create_with_no_dataset(
1303
1306
},
1304
1307
"python_package_spec" : {
1305
1308
"executor_image_uri" : _TEST_TRAINING_CONTAINER_IMAGE ,
1306
- "python_module" : source_utils . _TrainingScriptPythonPackager . module_name ,
1309
+ "python_module" : test_training_jobs . _TEST_MODULE_NAME ,
1307
1310
"package_uris" : [_TEST_OUTPUT_PYTHON_PACKAGE_PATH ],
1308
1311
"args" : true_args ,
1309
1312
"env" : true_env ,
@@ -1606,7 +1609,7 @@ def test_run_call_pipeline_service_create_distributed_training(
1606
1609
},
1607
1610
"python_package_spec" : {
1608
1611
"executor_image_uri" : _TEST_TRAINING_CONTAINER_IMAGE ,
1609
- "python_module" : source_utils . _TrainingScriptPythonPackager . module_name ,
1612
+ "python_module" : test_training_jobs . _TEST_MODULE_NAME ,
1610
1613
"package_uris" : [_TEST_OUTPUT_PYTHON_PACKAGE_PATH ],
1611
1614
"args" : true_args ,
1612
1615
"env" : true_env ,
@@ -1625,7 +1628,7 @@ def test_run_call_pipeline_service_create_distributed_training(
1625
1628
},
1626
1629
"python_package_spec" : {
1627
1630
"executor_image_uri" : _TEST_TRAINING_CONTAINER_IMAGE ,
1628
- "python_module" : source_utils . _TrainingScriptPythonPackager . module_name ,
1631
+ "python_module" : _TEST_MODULE_NAME ,
1629
1632
"package_uris" : [_TEST_OUTPUT_PYTHON_PACKAGE_PATH ],
1630
1633
"args" : true_args ,
1631
1634
"env" : true_env ,
@@ -1756,7 +1759,7 @@ def test_run_call_pipeline_service_create_distributed_training_with_reduction_se
1756
1759
},
1757
1760
"python_package_spec" : {
1758
1761
"executor_image_uri" : _TEST_TRAINING_CONTAINER_IMAGE ,
1759
- "python_module" : source_utils . _TrainingScriptPythonPackager . module_name ,
1762
+ "python_module" : _TEST_MODULE_NAME ,
1760
1763
"package_uris" : [_TEST_OUTPUT_PYTHON_PACKAGE_PATH ],
1761
1764
"args" : true_args ,
1762
1765
"env" : true_env ,
@@ -1775,7 +1778,7 @@ def test_run_call_pipeline_service_create_distributed_training_with_reduction_se
1775
1778
},
1776
1779
"python_package_spec" : {
1777
1780
"executor_image_uri" : _TEST_TRAINING_CONTAINER_IMAGE ,
1778
- "python_module" : source_utils . _TrainingScriptPythonPackager . module_name ,
1781
+ "python_module" : test_training_jobs . _TEST_MODULE_NAME ,
1779
1782
"package_uris" : [_TEST_OUTPUT_PYTHON_PACKAGE_PATH ],
1780
1783
"args" : true_args ,
1781
1784
"env" : true_env ,
@@ -2013,7 +2016,7 @@ def test_run_call_pipeline_service_create_with_nontabular_dataset_without_model_
2013
2016
},
2014
2017
"python_package_spec" : {
2015
2018
"executor_image_uri" : _TEST_TRAINING_CONTAINER_IMAGE ,
2016
- "python_module" : source_utils . _TrainingScriptPythonPackager . module_name ,
2019
+ "python_module" : test_training_jobs . _TEST_MODULE_NAME ,
2017
2020
"package_uris" : [_TEST_OUTPUT_PYTHON_PACKAGE_PATH ],
2018
2021
"args" : true_args ,
2019
2022
},
0 commit comments