Taragolis commented on code in PR #34002:
URL: https://github.com/apache/airflow/pull/34002#discussion_r1314315301


##########
tests/system/providers/microsoft/azure/example_azure_container_instances.py:
##########
@@ -52,7 +55,39 @@
         task_id="start_container",
     )
 
+    t2 = AzureContainerInstancesOperator(
+        ci_conn_id="azure_default",
+        registry_conn_id=None,
+        resource_group="resource-group",
+        name="aci-test-{{ ds }}",
+        image=f"{CONTAINER_REGISTRY_SERVER}:hello-world",
+        region="WestUS2",
+        environment_variables={},
+        volumes=[],
+        memory_in_gb=4.0,
+        cpu=1.0,
+        task_id="start_container_with_custom_container_registry",
+    )
 
+    t3 = AzureContainerInstancesOperator(
+        ci_conn_id="azure_default",
+        registry_conn_id=None,
+        resource_group="resource-group",
+        name="aci-test-{{ ds }}",
+        image="hello-world",
+        region="WestUS2",
+        environment_variables={},
+        volumes=[
+            AzureContainerVolumeHook().get_file_volume(
+                mount_name="mountname",
+                share_name=AZURE_VOLUME_SHARE_NAME,
+                storage_account_name=AZURE_STORAGE_ACOOUNT,
+            )
+        ],

Review Comment:
   This one spawn DB connection during DAG parsing that the reason why test 
failed.
   
   In general for this cases better use taskflow operator which returns 
required value, however volumes are not templated fields, so maybe better make 
it templated first.
   
   Some samples from other providers
   
   
https://github.com/apache/airflow/blob/6ef80e8be178e0ab8d119270a28b23d0bf47ed62/tests/system/providers/amazon/aws/example_batch.py#L60-L83
   
   
https://github.com/apache/airflow/blob/d2c0bbebacd1c58d357d647707a1bdb0c5b3b425/tests/system/providers/amazon/aws/example_ec2.py#L42-L60
   
   



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