mrk-andreev commented on code in PR #43847:
URL: https://github.com/apache/airflow/pull/43847#discussion_r1835447587
##########
providers/tests/cncf/kubernetes/operators/test_spark_kubernetes.py:
##########
@@ -828,3 +830,26 @@ def
test_resolve_application_file_real_file_not_exists(create_task_instance_of_o
task: SparkKubernetesOperator = ti.task
with pytest.raises(TypeError, match="application_file body can't
transformed into the dictionary"):
_ = task.template_body
+
+
[email protected](
+ "random_name_suffix",
+ [pytest.param(True, id="use-random_name_suffix"), pytest.param(False,
id="skip-random_name_suffix")],
+)
+def test_create_job_name(random_name_suffix: bool):
+ name = f"{uuid4()}"
+ op = SparkKubernetesOperator(task_id="task_id", name=name,
random_name_suffix=random_name_suffix)
+ pod_name = op.create_job_name()
+
+ if random_name_suffix:
+ assert pod_name.startswith(name)
Review Comment:
Withed with
```
assert pod_name.startswith(name)
assert pod_name != name
```
--
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]