Skip to content

Commit 5c9ced0

Browse files
committed
test: add unit test for annotations parameter
1 parent 6279006 commit 5c9ced0

File tree

4 files changed

+10
-0
lines changed

4 files changed

+10
-0
lines changed

src/codeflare_sdk/common/utils/unit_test_support.py

+1
Original file line numberDiff line numberDiff line change
@@ -442,5 +442,6 @@ def create_cluster_all_config_params(mocker, cluster_name, is_appwrapper) -> Clu
442442
extended_resource_mapping={"example.com/gpu": "GPU", "intel.com/gpu": "TPU"},
443443
overwrite_default_resource_mapping=True,
444444
local_queue="local-queue-default",
445+
annotations={"key1": "value1", "key2": "value2"},
445446
)
446447
return Cluster(config)

src/codeflare_sdk/ray/cluster/test_config.py

+5
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,11 @@ def test_config_creation_all_parameters(mocker):
9393
)
9494
assert cluster.config.overwrite_default_resource_mapping == True
9595
assert cluster.config.local_queue == "local-queue-default"
96+
assert cluster.config.annotations == {
97+
"app.kubernetes.io/managed-by": "test-prefix",
98+
"key1": "value1",
99+
"key2": "value2",
100+
}
96101

97102
assert filecmp.cmp(
98103
f"{aw_dir}test-all-params.yaml",

tests/test_cluster_yamls/appwrapper/unit-test-all-params.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ spec:
1313
metadata:
1414
annotations:
1515
app.kubernetes.io/managed-by: test-prefix
16+
key1: value1
17+
key2: value2
1618
labels:
1719
controller-tools.k8s.io: '1.0'
1820
key1: value1

tests/test_cluster_yamls/ray/unit-test-all-params.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ kind: RayCluster
33
metadata:
44
annotations:
55
app.kubernetes.io/managed-by: test-prefix
6+
key1: value1
7+
key2: value2
68
labels:
79
controller-tools.k8s.io: '1.0'
810
key1: value1

0 commit comments

Comments
 (0)