2h-kim commented on code in PR #28052:
URL: https://github.com/apache/airflow/pull/28052#discussion_r1040279300


##########
tests/providers/amazon/aws/operators/test_emr_add_steps.py:
##########
@@ -207,3 +207,22 @@ def test_init_with_nonexistent_cluster_name(self):
             with pytest.raises(AirflowException) as ctx:
                 operator.execute(self.mock_context)
             assert str(ctx.value) == f"No cluster found for name: 
{cluster_name}"
+
+    def test_wait_for_completion(self):
+        def check_wait_for_completion(**kwargs):
+            return kwargs.get("wait_for_completion")
+
+        wait_for_completion = False
+        with patch(
+            "airflow.providers.amazon.aws.hooks.emr.EmrHook.add_job_flow_steps"
+        ) as mock_add_job_flow_steps:
+            mock_add_job_flow_steps.side_effect = check_wait_for_completion
+            operator = EmrAddStepsOperator(
+                task_id="test_task",
+                job_flow_id="j-8989898989",
+                aws_conn_id="aws_default",
+                dag=DAG("test_dag_id", default_args=self.args),
+                wait_for_completion=wait_for_completion,
+            )
+
+            assert operator.execute(self.mock_context) == wait_for_completion

Review Comment:
   I thought I needed a test code to see if the parameter was well included in 
the `add_job_flow_steps` function.
   Because this problem was found to have occurred  `wait_for_completion` 
variable entered the fixed value to `add_job_flow_steps`, so i think parameter 
check was required. If `wait_for_completion` parameter is not working, I 
thought it is problem of `add_job_flow_steps` function of `EmrHook`, not the 
`EmrAddStepsOperator`.
   
   I'm not sure if I'm right either, so I'd like you to tell me if you have any 
other opinions.
   
   



-- 
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.

To unsubscribe, e-mail: [email protected]

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

Reply via email to