Skip to content

Commit

Permalink
test: add unit test for annotations parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Bobbins228 authored and openshift-merge-bot[bot] committed Jan 2, 2025
1 parent 77e7952 commit 2fc9488
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/codeflare_sdk/common/utils/unit_test_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,5 +442,6 @@ def create_cluster_all_config_params(mocker, cluster_name, is_appwrapper) -> Clu
extended_resource_mapping={"example.com/gpu": "GPU", "intel.com/gpu": "TPU"},
overwrite_default_resource_mapping=True,
local_queue="local-queue-default",
annotations={"key1": "value1", "key2": "value2"},
)
return Cluster(config)
5 changes: 5 additions & 0 deletions src/codeflare_sdk/ray/cluster/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ def test_config_creation_all_parameters(mocker):
)
assert cluster.config.overwrite_default_resource_mapping == True
assert cluster.config.local_queue == "local-queue-default"
assert cluster.config.annotations == {
"app.kubernetes.io/managed-by": "test-prefix",
"key1": "value1",
"key2": "value2",
}

assert filecmp.cmp(
f"{aw_dir}test-all-params.yaml",
Expand Down
2 changes: 2 additions & 0 deletions tests/test_cluster_yamls/appwrapper/unit-test-all-params.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ spec:
metadata:
annotations:
app.kubernetes.io/managed-by: test-prefix
key1: value1
key2: value2
labels:
controller-tools.k8s.io: '1.0'
key1: value1
Expand Down
2 changes: 2 additions & 0 deletions tests/test_cluster_yamls/ray/unit-test-all-params.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ kind: RayCluster
metadata:
annotations:
app.kubernetes.io/managed-by: test-prefix
key1: value1
key2: value2
labels:
controller-tools.k8s.io: '1.0'
key1: value1
Expand Down

0 comments on commit 2fc9488

Please sign in to comment.