OpenLiberty / ci.maven

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

Skip tests parameters are not updated if flag removed during dev mode #1213

Open ericglau opened 3 years ago

ericglau commented 3 years ago

Using project https://github.com/turkeylurkey/lmp-multimodules/tree/main/testCases/typeB (tested on Windows)

Define<skipTests>true</skipTests> in the <properties> section of war/pom.xml Start dev mode in multi module project, then press Enter to run tests - notice UTs and ITs are skipped:

[INFO] Running unit tests for guide-maven-multimodules-jar ...
[INFO] No tests to run.
[INFO] Unit tests for guide-maven-multimodules-jar finished.
[INFO]
[INFO] Waiting up to 30 seconds to find the application start up or update message...
[INFO] CWWKM2010I: Searching for (CWWKZ0001I:|CWWKZ0003I:) in C:\Users\Eric\git\lmp-multimodules\testCases\typeB\war\target\liberty\wlp\usr\servers\defaultServer\logs\messages.log. This search will timeout after 30 seconds.
[INFO] CWWKM2015I: Match number: 1 is [7/21/21 16:37:46:180 EDT] 00000038 com.ibm.ws.app.manager.AppMessageHelper                      A CWWKZ0001I: Application guide-maven-multimodules-war started in 0.368 seconds..
[INFO] Running integration tests for guide-maven-multimodules-jar...
[INFO] No tests to run.
[INFO] Integration tests for guide-maven-multimodules-jar finished.

Then change that flag to <skipTests>false</skipTests> or delete it from war/pom.xml. The following output occurs:

[INFO] Running liberty:deploy
[INFO] CWWKM2102I: Using artifact based assembly archive : io.openliberty:openliberty-kernel:null:21.0.0.7:zip.
[INFO] CWWKM2102I: Using installDirectory : C:\Users\Eric\git\lmp-multimodules\testCases\typeB\war\target\liberty\wlp.
[INFO] CWWKM2102I: Using serverName : defaultServer.
[INFO] CWWKM2102I: Using serverDirectory : C:\Users\Eric\git\lmp-multimodules\testCases\typeB\war\target\liberty\wlp\usr\servers\defaultServer.
[INFO] Copying 1 file to C:\Users\Eric\git\lmp-multimodules\testCases\typeB\war\target\liberty\wlp\usr\servers\defaultServer
[INFO] CWWKM2144I: Update server configuration file server.xml from C:\Users\Eric\git\lmp-multimodules\testCases\typeB\war\src\main\liberty\config\server.xml.
[INFO] CWWKM2185I: The liberty-maven-plugin configuration parameter "appsDirectory" value defaults to "apps".
[INFO] CWWKM2160I: Installing application guide-maven-multimodules-war.war.xml.
[INFO] CWWKM2010I: Searching for CWWKZ0001I.*guide-maven-multimodules-war in C:\Users\Eric\git\lmp-multimodules\testCases\typeB\war\target\liberty\wlp\usr\servers\defaultServer\logs\messages.log. This search will timeout after 40 seconds.
[INFO] CWWKM2015I: Match number: 1 is [7/21/21 16:37:46:180 EDT] 00000038 com.ibm.ws.app.manager.AppMessageHelper                      A CWWKZ0001I: Application guide-maven-multimodules-war started in 0.368 seconds..
[INFO] guide-maven-multimodules-war source compilation was successful.
[INFO] guide-maven-multimodules-war tests compilation was successful.
[INFO] Running liberty:deploy
[INFO] CWWKM2102I: Using artifact based assembly archive : io.openliberty:openliberty-kernel:null:21.0.0.7:zip.
[INFO] CWWKM2102I: Using installDirectory : C:\Users\Eric\git\lmp-multimodules\testCases\typeB\war\target\liberty\wlp.
[INFO] CWWKM2102I: Using serverName : defaultServer.
[INFO] CWWKM2102I: Using serverDirectory : C:\Users\Eric\git\lmp-multimodules\testCases\typeB\war\target\liberty\wlp\usr\servers\defaultServer.
[INFO] Copying 1 file to C:\Users\Eric\git\lmp-multimodules\testCases\typeB\war\target\liberty\wlp\usr\servers\defaultServer
[INFO] CWWKM2144I: Update server configuration file server.xml from C:\Users\Eric\git\lmp-multimodules\testCases\typeB\war\src\main\liberty\config\server.xml.
[INFO] CWWKM2185I: The liberty-maven-plugin configuration parameter "appsDirectory" value defaults to "apps".
[INFO] CWWKM2160I: Installing application guide-maven-multimodules-war.war.xml.
[INFO] CWWKM2010I: Searching for CWWKZ0001I.*guide-maven-multimodules-war in C:\Users\Eric\git\lmp-multimodules\testCases\typeB\war\target\liberty\wlp\usr\servers\defaultServer\logs\messages.log. This search will timeout after 40 seconds.
[INFO] CWWKM2015I: Match number: 1 is [7/21/21 16:37:46:180 EDT] 00000038 com.ibm.ws.app.manager.AppMessageHelper                      A CWWKZ0001I: Application guide-maven-multimodules-war started in 0.368 seconds..
[INFO] guide-maven-multimodules-war source compilation was successful.
[INFO] guide-maven-multimodules-war tests compilation was successful.
[INFO] [AUDIT   ] CWWKG0016I: Starting server configuration update.
[INFO] [AUDIT   ] CWWKG0093A: Processing configuration drop-ins resource: C:\Users\Eric\git\lmp-multimodules\testCases\typeB\war\target\liberty\wlp\usr\servers\defaultServer\configDropins\overrides\liberty-plugin-variable-config.xml
[INFO] [AUDIT   ] CWWKG0018I: The server configuration was not updated. No functional changes were detected.
[INFO] [AUDIT   ] CWWKT0017I: Web application removed (default_host): http://host.docker.internal:9080/converter/
[INFO] [AUDIT   ] CWWKZ0009I: The application guide-maven-multimodules-war has stopped successfully.
[INFO] [AUDIT   ] CWWKT0016I: Web application available (default_host): http://host.docker.internal:9080/converter/
[INFO] [AUDIT   ] CWWKZ0003I: The application guide-maven-multimodules-war updated in 0.049 seconds.

Then Press Enter to run tests again. Tests remain skipped (even though they should not skip)

[INFO] Running unit tests for guide-maven-multimodules-jar ...
[INFO] No tests to run.
[INFO] Unit tests for guide-maven-multimodules-jar finished.
[INFO]
[INFO] Running integration tests for guide-maven-multimodules-jar...
[INFO] No tests to run.
[INFO] Integration tests for guide-maven-multimodules-jar finished.
[INFO]
[INFO] To run tests on demand, press Enter.

The same issue occurs for all of the different flags: skipTests, skipITs, skipUTs - they do not update if the user deleted/changed the flag to false if dev mode was started with true

ericglau commented 3 years ago

The issue also occurs if starting with <skipTests>true</skipTests> in the maven-failsafe-plugin configuration in the war project's pom.xml. But if starting with false, then it can be toggled to true and false properly.