Skip to content

Commit df4c417

Browse files
committed
deleted set_result_for_command
1 parent 79ccf19 commit df4c417

File tree

3 files changed

+9
-74
lines changed

3 files changed

+9
-74
lines changed

src/xpk/commands/managed_ml_diagnostics_test.py

Lines changed: 7 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@
1414
limitations under the License.
1515
"""
1616

17-
from argparse import Namespace
1817
from dataclasses import dataclass
19-
from typing import Any
2018
from unittest.mock import MagicMock
2119
import pytest
2220
from xpk.commands.managed_ml_diagnostics import install_mldiagnostics_prerequisites
@@ -50,78 +48,20 @@ def mocks(mocker) -> _Mocks:
5048
commands_print_mock=commands_print_mock,
5149
commands_tester=CommandsTester(
5250
mocker,
53-
# run_command_with_updates_path=(
54-
# 'xpk.commands.managed_ml_diagnostics.run_command_with_updates'
55-
# ),
56-
# run_command_for_value_path=(
57-
# 'xpk.commands.managed_ml_diagnostics.run_command_for_value'
58-
# ),
51+
run_command_with_updates_path=(
52+
'xpk.commands.managed_ml_diagnostics.run_command_with_updates'
53+
),
54+
run_command_for_value_path=(
55+
'xpk.commands.managed_ml_diagnostics.run_command_for_value'
56+
),
5957
),
6058
)
6159

60+
6261
def test_install_mldiagnostics_prerequisites_commands_executed(
6362
mocks: _Mocks,
64-
mocker,
6563
):
6664

67-
mocks.commands_tester.set_result_for_command(
68-
(0, ''),
69-
'kubectl',
70-
'rollout',
71-
'status',
72-
'deployment/kueue-controller-manager',
73-
)
74-
75-
mocks.commands_tester.set_result_for_command(
76-
(0, ''),
77-
'kubectl',
78-
'rollout',
79-
'status',
80-
'deployment/cert-manager-webhook',
81-
)
82-
83-
mocks.commands_tester.set_result_for_command(
84-
(0, ''),
85-
'kubectl',
86-
'apply',
87-
'-f',
88-
'https://github.com/cert-manager/cert-manager/releases/',
89-
)
90-
91-
mocks.commands_tester.set_result_for_command(
92-
(0, ''),
93-
'gcloud',
94-
'artifacts',
95-
'generic',
96-
'download',
97-
)
98-
99-
mocks.commands_tester.set_result_for_command(
100-
(0, ''),
101-
'kubectl',
102-
'create',
103-
'namespace',
104-
'gke-mldiagnostics',
105-
)
106-
107-
mocks.commands_tester.set_result_for_command(
108-
(0, ''),
109-
'kubectl',
110-
'apply',
111-
'-f',
112-
'-n',
113-
'gke-mldiagnostics',
114-
)
115-
116-
mocks.commands_tester.set_result_for_command(
117-
(0, ''),
118-
'kubectl',
119-
'label',
120-
'namespace',
121-
'default',
122-
'managed-mldiagnostics-gke=true',
123-
)
124-
12565
install_mldiagnostics_prerequisites()
12666

12767
mocks.commands_tester.assert_command_run(

src/xpk/parser/cluster.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -910,11 +910,6 @@ def add_shared_cluster_create_capacity_arguments(
910910
' types.'
911911
),
912912
)
913-
parser_or_group.add_argument(
914-
'--managed-ml-diagnostics',
915-
action='store_true',
916-
help='Enables the installation of required ML Diagnostics components.',
917-
)
918913

919914

920915
def add_shared_cluster_create_mtc_arguments(

src/xpk/parser/cluster_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def test_cluster_create_managed_mldiagnostics():
114114
"test-cluster",
115115
"--tpu-type",
116116
"v5p-8",
117-
"--managed-ml-diagnostics",
117+
"--managed-mldiagnostics",
118118
])
119119

120-
assert args.managed_ml_diagnostics is True
120+
assert args.managed_mldiagnostics is True

0 commit comments

Comments
 (0)