Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: TOOLS-2714 truncating a namespace with --no-warn causes error #224

Merged
merged 1 commit into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/live_cluster/manage_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -2485,7 +2485,7 @@ async def _do_default(self, line):
line=line,
arg="--no-warn",
default=False,
modifiers=self.modifiers,
modifiers=self.modifiers | self.required_modifiers,
mods=self.mods,
)

Expand Down
30 changes: 30 additions & 0 deletions test/e2e/live_cluster/test_manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -1097,3 +1097,33 @@ def test_check_for_OK_response(self, cmd, exp_title, exp_header):
for row in actual_values:
entry = row[1]
self.assertEqual(entry, ASINFO_RESPONSE_OK)


class ManageTruncateTest(TestManage):
def get_args(self, cmd):
return self._args.format(cmd)

def setUp(self):
lib.start()
self._args = f"-h {lib.SERVER_IP}:{lib.PORT} --enable -e '{{}}' -Uadmin -Padmin"

def tearDown(self) -> None:
lib.stop()

@parameterized.expand(
[
(
f"manage truncate ns test --no-warn",
"Successfully started truncation for namespace test",
),
(
f"manage truncate ns test set testset --no-warn",
"Successfully started truncation for set testset of namespace test",
),
]
)
def test_check_for_OK_response(self, cmd, exp_stdout):
cp = test_util.run_asadm(self.get_args(cmd))
stdout = cp.stdout

self.assertEqual(exp_stdout, stdout.strip())
Loading