OpenLiberty / ci.maven

Maven plugins for managing Liberty profile servers #devops
Apache License 2.0
130 stars 91 forks source link

Dev mode to support arquillian #848

Open gkwan-ibm opened 4 years ago

gkwan-ibm commented 4 years ago

Arquillian requires to start its server but dev mode start one. Suggest to have <allowConnectingToRunningServer>true</allowConnectingToRunningServer> property. It allows Arquillian to connect the running server started by dev mode.

See Option 2 in https://github.com/OpenLiberty/guide-arquillian-managed/pull/68:

or https://github.com/OpenLiberty/guide-arquillian-managed/issues/69

gkwan-ibm commented 4 years ago

Currently, if using arquillian, users have to run as following:

mvn clean package
mvn liberty:create liberty:install-feature liberty:deploy
mvn liberty:configure-arquillian 
mvn failsafe:integration-test
gkwan-ibm commented 4 years ago

Currently (3.2.2), if using dev mode by following the instruction in the description, tests will fail as

[ERROR] it.io.openliberty.guides.inventory.InventoryArquillianIT  Time elapsed: 0 s  <<< ERROR!
java.lang.RuntimeException: Arquillian initialization has already been attempted, but failed. See previous exceptions for cause
Caused by: org.jboss.arquillian.container.spi.client.container.LifecycleException: Could not start container
Caused by: org.jboss.arquillian.container.spi.client.container.LifecycleException: Connecting to an already running server is not allowed
gkwan-ibm commented 4 years ago

Suggest to have a better design/experience so that even no need to do mvn liberty:configure-arquillian

ericglau commented 4 years ago

Summary of current situation based on the above: Currently dev mode does not work with Arquillian tests - Arquillian cannot start its own server while dev mode is running, and it cannot connect to dev mode's Liberty server (perhaps unless some manual steps are performed).

This issue is to support a scenario where user is developing Open Liberty and/or Arquillian test cases, and wants to run their Arquillian tests on dev mode's Liberty server.

ericglau commented 3 years ago

Document that dev mode does not currently work with Arquillian tests.