lhotari commented on code in PR #25126:
URL: https://github.com/apache/pulsar/pull/25126#discussion_r2767793508
##########
pulsar-client-tools-test/src/test/java/org/apache/pulsar/admin/cli/PulsarAdminToolTest.java:
##########
@@ -2181,6 +2182,97 @@ public boolean matches(Long timestamp) {
}
+ @Test
+ public void topicsAnalyzeBacklog() throws Exception {
Review Comment:
> Seems we need to handle the test in integration module like `CLITest`?
>
>
https://github.com/apache/pulsar/blob/85625e0f100479dd95fb1311aeb52411b6b0a25d/tests/integration/src/test/java/org/apache/pulsar/tests/integration/cli/CLITest.java
>
> Is there a better approach? Running the tests in integration module
requires local image building.
Yes it's a bit clumbersome.
To build an image quickly, use this script:
```
./build/build_java_test_image.sh
```
That requires setting `export
PULSAR_TEST_IMAGE_NAME=apachepulsar/java-test-image:latest` environment
variable so that the `apachepulsar/java-test-image:latest` docker image is used
instead of the default `apachepulsar/pulsar-test-latest-version:latest` which
takes much longer to build.
If you are running the test in IntelliJ, you can edit the default value at
https://github.com/apache/pulsar/blob/15daf18a877cddc3786dc0661fde0e049bac916a/tests/integration/src/test/java/org/apache/pulsar/tests/integration/containers/PulsarContainer.java#L62
For running integration tests on command line, this is the sequence I have
used:
```
# compile integration test dependencies
mvn -am -pl tests/integration -Dcheckstyle.skip=true -Dlicense.skip=true
-Dspotbugs.skip=true -DskipTests install
./build/build_java_test_image.sh
export PULSAR_TEST_IMAGE_NAME=apachepulsar/java-test-image:latest
# run the test
mvn -DintegrationTests -pl tests/integration -DtestRetryCount=0
-DredirectTestOutputToFile=false test \
-Dtest=TestClassNameHere
```
If you are working on the test alone, you obviously don't have to rebuild
the image after each change.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]