antoniocali commented on a change in pull request #10578:
URL: https://github.com/apache/airflow/pull/10578#discussion_r483426666



##########
File path: tests/providers/google/cloud/operators/test_mlengine.py
##########
@@ -350,6 +350,45 @@ def test_success_create_training_job(self, mock_hook):
             project_id='test-project', job=self.TRAINING_INPUT, 
use_existing_job_fn=ANY
         )
 
+    @patch('airflow.providers.google.cloud.operators.mlengine.MLEngineHook')
+    def test_success_create_training_job_with_master_config(self, mock_hook):
+        custom_training_default_args: dict = 
copy.deepcopy(self.TRAINING_DEFAULT_ARGS)
+        custom_training_default_args['scaleTier'] = 'CUSTOM'

Review comment:
       I'm trying to understand how to write correctly the test honestly
   This is the class
   [class 
TestMLEngineTrainingOperator](https://github.com/apache/airflow/blob/93aceab53ae9552f77f3bddf1b51d3e06c988cd2/tests/providers/google/cloud/operators/test_mlengine.py#L306)
   If you take a look at the class there are 2 dictionary
   `TRAINING_DEFAULT_ARGS` and `TRAINING_INPUT`, both of them contain a 
scale_tier/scaleTier parameter.
   The thing is that I have to overwrite that to CUSTOM to be able to run a 
masterType and masterConfig.
   
   if you look at the [Rest 
Documentation](https://cloud.google.com/ai-platform/training/docs/reference/rest/v1/projects.jobs#traininginput),
 it shows a trainingInput config, where scaleTier appears -> As much as I know 
from my understanding, all of Google Operators at the end just do a HookBase 
Operator that does a rest api call.
   
   I'm tring to fully understand why the test fails, anyway I've prepared a new 
commit and trying to verify. Thank you @mik-laj for your support, and if you 
have a better idea how to solve it please let me know
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to