Skip to content

Commit fb9791d

Browse files
committed
fixing uts
1 parent bc50029 commit fb9791d

File tree

3 files changed

+5
-36
lines changed

3 files changed

+5
-36
lines changed

ads/opctl/backend/marketplace/helm_helper.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,6 @@ class HelmPullStatus(Enum):
4141
def run_helm_install(
4242
name: str, chart: str, version: str, namespace: str, values_yaml_path: str, **kwargs
4343
) -> subprocess.CompletedProcess:
44-
cmd = (
45-
HelmCommand.Install
46-
if not _check_if_chart_already_exists_(name, namespace)
47-
else HelmCommand.Upgrade
48-
)
4944
helm_cmd = [
5045
_HELM_BINARY_,
5146
HelmCommand.Upgrade,

tests/unitary/with_extras/operator/feature-store/test_helm_helper_util.py

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -25,36 +25,8 @@
2525

2626

2727
@patch("ads.opctl.backend.marketplace.helm_helper.subprocess.run")
28-
@patch("ads.opctl.backend.marketplace.helm_helper._check_if_chart_already_exists_")
29-
def test_helm_install(mock_check_chart_exist: Mock, subprocess_mock: Mock):
30-
mock_check_chart_exist.return_value = False
28+
def test_helm_install(subprocess_mock: Mock):
3129
run_helm_install(name, chart, version, namespace, values_yaml_path, **kwargs)
32-
mock_check_chart_exist.assert_called_with(name, namespace)
33-
34-
helm_cmd = [
35-
_HELM_BINARY_,
36-
HelmCommand.Install,
37-
name,
38-
chart,
39-
*_get_as_flags_(
40-
namespace=namespace,
41-
values=values_yaml_path,
42-
version=version,
43-
timeout="300s",
44-
**kwargs,
45-
),
46-
"--wait",
47-
]
48-
49-
subprocess_mock.assert_called_with(helm_cmd)
50-
51-
52-
@patch("ads.opctl.backend.marketplace.helm_helper.subprocess.run")
53-
@patch("ads.opctl.backend.marketplace.helm_helper._check_if_chart_already_exists_")
54-
def test_helm_upgrade(mock_check_chart_exist: Mock, subprocess_mock: Mock):
55-
mock_check_chart_exist.return_value = True
56-
run_helm_install(name, chart, version, namespace, values_yaml_path, **kwargs)
57-
mock_check_chart_exist.assert_called_with(name, namespace)
5830
helm_cmd = [
5931
_HELM_BINARY_,
6032
HelmCommand.Upgrade,
@@ -68,7 +40,9 @@ def test_helm_upgrade(mock_check_chart_exist: Mock, subprocess_mock: Mock):
6840
**kwargs,
6941
),
7042
"--wait",
43+
"-i",
7144
]
45+
7246
subprocess_mock.assert_called_with(helm_cmd)
7347

7448

tests/unitary/with_extras/operator/feature-store/test_marketplace_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def test_export_helm_chart_to_container_registry(list_api: Mock, export_api: Moc
5656
pattern = "feature-store-dataplane-api"
5757

5858
mock_container_summary = Mock()
59-
mock_container_summary.display_name = f"{pattern}-1"
59+
mock_container_summary.display_name = f"{pattern}:1"
6060

6161
list_api.return_value.items.__iter__ = Mock(
6262
return_value=iter([mock_container_summary])
@@ -65,4 +65,4 @@ def test_export_helm_chart_to_container_registry(list_api: Mock, export_api: Moc
6565
listing_details.container_tag_pattern = [pattern]
6666
result = _get_tags_map_(listing_details)
6767
assert pattern in result
68-
assert result[pattern] == f"{pattern}-1"
68+
assert result[pattern] == f"1"

0 commit comments

Comments
 (0)