Skip to content

Commit 000809e

Browse files
committed
test: add unit test for annotations parameter
1 parent 0e888d3 commit 000809e

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
@@ -414,5 +414,6 @@ def create_cluster_all_config_params(mocker, cluster_name, is_appwrapper) -> Clu
414414
extended_resource_mapping={"example.com/gpu": "GPU", "intel.com/gpu": "TPU"},
415415
overwrite_default_resource_mapping=True,
416416
local_queue="local-queue-default",
417+
annotations={"key1": "value1", "key2": "value2"},
417418
)
418419
return Cluster(config)

src/codeflare_sdk/ray/cluster/test_config.py

+5
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,11 @@ def test_config_creation_all_parameters(mocker):
9090
)
9191
assert cluster.config.overwrite_default_resource_mapping == True
9292
assert cluster.config.local_queue == "local-queue-default"
93+
assert cluster.config.annotations == {
94+
"app.kubernetes.io/managed-by": "test-prefix",
95+
"key1": "value1",
96+
"key2": "value2",
97+
}
9398

9499
assert filecmp.cmp(
95100
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)