yesemsanthoshkumar commented on a change in pull request #10343:
URL: https://github.com/apache/airflow/pull/10343#discussion_r471617008
##########
File path: tests/providers/google/cloud/operators/test_dataproc.py
##########
@@ -453,6 +477,50 @@ def test_execute(self, mock_hook):
job_id=job_id, project_id=GCP_PROJECT, location=GCP_LOCATION
)
+ @provide_session
+ def test_operator_extra_links(self, session):
+ job = {}
+ job_id = 'test_job_id_12345'
+ execution_date = datetime(2020, 7, 20)
+
+ op = DataprocSubmitJobOperator(
+ task_id=TASK_ID,
+ location=GCP_LOCATION,
+ project_id=GCP_PROJECT,
+ job=job,
+ gcp_conn_id=GCP_CONN_ID,
+ cluster_name=CLUSTER_NAME
+ )
+ self.dag.clear()
+ session.query(XCom).deete()
+
+ ti = TaskInstance(
+ task=op,
+ execution_date=execution_date
+ )
+
+ self.assertEqual(
+ # pylint: disable=line-too-long
+
'https://console.cloud.google.com/dataproc/clusters/{cluster_name}/job?region={region}&project={project_id}'.format(
# noqa: E501
+ cluster_name=CLUSTER_NAME,
+ region=GCP_LOCATION,
+ project_id=GCP_PROJECT
+ ),
+ op.get_extra_links(execution_date, DataprocJobLink.name)
+ )
+
+ ti.xcom_push(key='job_id', value=job_id)
+
+ self.assertEqual(
+ # pylint: disable=line-too-long
Review comment:
Same as above
----------------------------------------------------------------
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]