Skip to content

Inner loop Operations

Adam Wisniewski edited this page Oct 15, 2020 · 1 revision

The Open Liberty stack implements the following odo inner-loop operations.

PUSH

By default, odo push, in conjuction with the java-openliberty devfile, runs a liberty:dev mode in "hot test" mode, where unit tests and integration tests get automatically re-executed after each detected change. These test results are visible in the OpenShift container logs. To see the realtime contents of the container logs, use the odo CLI:

odo log

It is also possible to disable the "hot test" mode of liberty:dev mode by re-running the odo push with the following argument:

odo push --run-command=run-test-off

DEBUG

The Open Liberty stack has a built in "debug mode". This allows you to connect a debugger to your application running in your cluster. To invoke debug mode, issue the following:

odo push --debug
odo debug port-forward

These commands enable "debug" mode in the underlying Open Liberty server as well as forwarding the default odo debug port of 5858. Once complete, you can connect a debugger from your local workstation.

Additionally, you can override the local port used for debugging with the following option on the odo debug port-forward command:

odo debug port-forward --local-port=7777

TEST

Once your application container is up and running after an odo push, you can force a run of any integration tests that you have for your project. The Open Liberty stack runs the Maven failsafe integration-test goal (failsafe:integration-test) to invoke your project's tests using the MicroShed Testing (MST) framework.

To do this, enter the following:

odo test --show-log