File tree Expand file tree Collapse file tree
src/databricks/labs/pytester/fixtures
tests/integration/fixtures Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ def create(
104104 }
105105 else :
106106 kwargs ["spark_conf" ] = {"spark.databricks.cluster.profile" : "singleNode" , "spark.master" : "local[*]" }
107- kwargs ["custom_tags" ] = {"ResourceClass" : "SingleNode" }
107+ kwargs ["custom_tags" ] = kwargs . get ( "custom_tags" , {}) | {"ResourceClass" : "SingleNode" }
108108 if "instance_pool_id" not in kwargs :
109109 kwargs ["node_type_id" ] = ws .clusters .select_node_type (local_disk = True , min_memory_gb = 16 )
110110 if "custom_tags" not in kwargs :
Original file line number Diff line number Diff line change @@ -18,6 +18,17 @@ def test_cluster(make_cluster, env_or_skip):
1818 logger .info (f"created { make_cluster (single_node = True , instance_pool_id = env_or_skip ('TEST_INSTANCE_POOL_ID' ))} " )
1919
2020
21+ def test_cluster_custom_tags (make_cluster , env_or_skip ):
22+ cluster = make_cluster (
23+ single_node = True ,
24+ instance_pool_id = env_or_skip ('TEST_INSTANCE_POOL_ID' ),
25+ tags = [EndpointTagPair (key = 'my-custom-tag' , value = 'my-custom-tag-value' )],
26+ )
27+ cluster_tags = cluster .tags .as_dict ()
28+ assert isinstance (cluster_tags , dict )
29+ assert cluster_tags ["custom_tags" ][1 ]["key" ] == "my-custom-tag"
30+
31+
2132def test_instance_pool (make_instance_pool ):
2233 logger .info (f"created { make_instance_pool ()} " )
2334
You can’t perform that action at this time.
0 commit comments