You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@codelipenghui , can you please let me know what tests you would like to see for the admin CLI? As I can see, runAdminCommandOnAnyBroker does use the admin cli and is used extensively by integrations tests. And there are some more usages through the constant ADMIN_SCRIPT. So it's not a dedicated test, but I think it already has some coverage.
@andrasbeni Most of the admin CLI integration tests are under tests/integration/cli and yes we already have some coverage for this part. I think we should also consider the improve the coverage for this part to avoid someone changing the output format or introducing new incompatible options. But it's not a very strong opinion, we need to maintain so many test codes in the future. WDYT?
@codelipenghui , I believe integration tests are too expensive to do a full validation of output and command line parameters. Having taken a quick look at admin command implementations and PulsarAdminToolTest, it looks to me that admin commands are designed to be easily unit tested: the PulsarAdmin can be mocked by setting a Supplier and CaptureStdOut makes their output verifiable. So, in my opinion, we would be much better off writing unit tests for all these.
Activity
codelipenghui commentedon Aug 22, 2022
@nodece Is handling the integration test of security
andrasbeni commentedon Sep 20, 2022
@codelipenghui , can you please let me know what tests you would like to see for the admin CLI? As I can see, runAdminCommandOnAnyBroker does use the admin cli and is used extensively by integrations tests. And there are some more usages through the constant
ADMIN_SCRIPT. So it's not a dedicated test, but I think it already has some coverage.codelipenghui commentedon Sep 28, 2022
@andrasbeni Most of the admin CLI integration tests are under
tests/integration/cliand yes we already have some coverage for this part. I think we should also consider the improve the coverage for this part to avoid someone changing the output format or introducing new incompatible options. But it's not a very strong opinion, we need to maintain so many test codes in the future. WDYT?andrasbeni commentedon Sep 29, 2022
@codelipenghui , I believe integration tests are too expensive to do a full validation of output and command line parameters. Having taken a quick look at admin command implementations and
PulsarAdminToolTest, it looks to me that admin commands are designed to be easily unit tested: thePulsarAdmincan be mocked by setting aSupplierandCaptureStdOutmakes their output verifiable. So, in my opinion, we would be much better off writing unit tests for all these.codelipenghui commentedon Sep 29, 2022
@andrasbeni Sound good to me.