Skip to content

Running ITs locally

Scott Kurz edited this page Jul 1, 2021 · 1 revision

Cheat Sheet techniques

This isn't intended to be a complete guide.

Note on maven-invoker-plugin

The invoker plugin allows for an IT to do another invocation in a structured way, calling goals/phases/invocations of the test invocation from the top-level failsafe/surefire test/IT. It has some pattern-matching abilities to save time.

The tests involving server stop/start are especially time-consuming.

setup and run subset of ITs

  1. Setup from liberty-maven-plugin dir

    cd liberty-maven-plugin; mvn verify -Ponline-its -Dinvoker.test="setup" -Druntime=ol -DruntimeVersion=21.0.0.6 # could use other runtimes

  2. Run subset via invoker:

    mvn verify -Ponline-its -Dinvoker.test="ear-project-it*" -Druntime=ol -DruntimeVersion=21.0.0.6

For rapid debug, it can be a shortcut to work out of target dir, if you know what you're doing (be careful)

  1. Switch to target dir:

    cd liberty-maven-plugin/target/it/ear-project-it

  2. Run mvn verify "directly" (not via invoker)

    mvn verify -DruntimeGroupId=io.openliberty -DruntimeArtifactId=openliberty-runtime -DruntimeVersion=21.0.0.6 # not all tests are configured to install features