potiuk commented on code in PR #39513:
URL: https://github.com/apache/airflow/pull/39513#discussion_r1596008489
##########
tests/providers/smtp/notifications/test_smtp.py:
##########
@@ -129,7 +133,7 @@ def test_notifier_with_defaults(self, mock_smtphook_hook,
create_task_instance):
from_email=conf.get("smtp", "smtp_mail_from"),
to="[email protected]",
subject="DAG dag - Task op - Run ID test in State None",
- html_content="""<!DOCTYPE html>\n<html>\n <head>\n <meta
http-equiv="Content-Type" content="text/html; charset=utf-8" />\n <meta
name="viewport" content="width=device-width">\n </head>\n<body>\n <table
role="presentation">\n \n <tr>\n <td>Run ID:</td>\n
<td>test</td>\n </tr>\n <tr>\n <td>Try:</td>\n
<td>0 of 1</td>\n </tr>\n <tr>\n <td>Task
State:</td>\n <td>None</td>\n </tr>\n <tr>\n
<td>Host:</td>\n <td></td>\n </tr>\n <tr>\n
<td>Log Link:</td>\n <td><a
href="http://localhost:8080/dags/dag/grid?dag_run_id=test&task_id=op&map_index=-1&tab=logs"
style="text-decoration:underline;">http://localhost:8080/dags/dag/grid?dag_run_id=test&task_id=op&map_index=-1&tab=logs</a></td>\n
</tr>\n <tr>\n <td>Mark Success Link:</td>\n
<td><a href="http:
//localhost:8080/confirm?task_id=op&dag_id=dag&dag_run_id=test&upstream=false&downstream=false&state=success"
style="text-decoration:underline;">http://localhost:8080/confirm?task_id=op&dag_id=dag&dag_run_id=test&upstream=false&downstream=false&state=success</a></td>\n
</tr>\n \n </table>\n</body>\n</html>""",
+ html_content=f"""<!DOCTYPE html>\n<html>\n <head>\n
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />\n
<meta name="viewport" content="width=device-width">\n </head>\n<body>\n
<table role="presentation">\n \n <tr>\n <td>Run
ID:</td>\n <td>test</td>\n </tr>\n <tr>\n
<td>Try:</td>\n <td>{NUM_TRY} of 1</td>\n </tr>\n
<tr>\n <td>Task State:</td>\n <td>None</td>\n
</tr>\n <tr>\n <td>Host:</td>\n <td></td>\n
</tr>\n <tr>\n <td>Log Link:</td>\n <td><a
href="http://localhost:8080/dags/dag/grid?dag_run_id=test&task_id=op&map_index=-1&tab=logs"
style="text-decoration:underline;">http://localhost:8080/dags/dag/grid?dag_run_id=test&task_id=op&map_index=-1&tab=logs</a></td>\n
</tr>\n <tr>\n <td>Mark Success Link:</td>\n
<td><a hr
ef="http://localhost:8080/confirm?task_id=op&dag_id=dag&dag_run_id=test&upstream=false&downstream=false&state=success"
style="text-decoration:underline;">http://localhost:8080/confirm?task_id=op&dag_id=dag&dag_run_id=test&upstream=false&downstream=false&state=success</a></td>\n
</tr>\n \n </table>\n</body>\n</html>""",
Review Comment:
@dstandish -> I think this is really behaviour change introduced by try_num.
Basically SMTP provider will send different emails when run before and after
try_num change. "(0 of 1) instead of (1 of 1) in the email". I guess we should
handle that in the provider to detect which version of Airflow is used and
adapt it.
--
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]