From 6f0ae0644cec8ca93e6640fbc911b26f4b563dfd Mon Sep 17 00:00:00 2001 From: Marco Bungart Date: Thu, 5 Sep 2024 20:20:52 +0200 Subject: [PATCH 1/3] #2: Add container descriptor handler for spring boot's meta inf. The server cannot be started because the spring `NamespaceHandler` cannot be found. Adding the container descriptor handler resolves the issue. This is the workaround mentioned in https://github.com/citrusframework/citrus-remote/issues/2#issuecomment-1642491118, moved to the default descriptors. --- .../src/main/resources/assemblies/test-jar.xml | 5 +++++ .../src/main/resources/assemblies/test-war.xml | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/citrus-remote-maven-plugin/src/main/resources/assemblies/test-jar.xml b/citrus-remote-maven-plugin/src/main/resources/assemblies/test-jar.xml index 3e25b8d..b9e295c 100644 --- a/citrus-remote-maven-plugin/src/main/resources/assemblies/test-jar.xml +++ b/citrus-remote-maven-plugin/src/main/resources/assemblies/test-jar.xml @@ -30,4 +30,9 @@ test + + + metaInf-spring + + diff --git a/citrus-remote-maven-plugin/src/main/resources/assemblies/test-war.xml b/citrus-remote-maven-plugin/src/main/resources/assemblies/test-war.xml index 0c3b905..a9b27a4 100644 --- a/citrus-remote-maven-plugin/src/main/resources/assemblies/test-war.xml +++ b/citrus-remote-maven-plugin/src/main/resources/assemblies/test-war.xml @@ -44,4 +44,9 @@ + + + metaInf-spring + + From c87ab1ea057c54996d113bfacdd52f6164ca804f Mon Sep 17 00:00:00 2001 From: Marco Bungart Date: Thu, 5 Sep 2024 20:51:03 +0200 Subject: [PATCH 2/3] Refactoring: Move verification of citrus test in phase "verify". We want to copy the logs from the citrus container before the maven execution fails. This makes it necessary to split the execution and verification of the citrus tests into different maven phases, so we can "move" the execution of docker:copy, docker:stop and docker:remove "between" test execution and test verification. --- citrus-remote-sample/pom.xml | 55 ++++++++++++++---------------------- 1 file changed, 21 insertions(+), 34 deletions(-) diff --git a/citrus-remote-sample/pom.xml b/citrus-remote-sample/pom.xml index 1f4ce83..fd6cb7c 100644 --- a/citrus-remote-sample/pom.xml +++ b/citrus-remote-sample/pom.xml @@ -22,7 +22,9 @@ 6.1.12 - none + citrus-remote + none + none none none @@ -56,34 +58,6 @@ package - - - - citrus-tests - - jar - - false - - - / - false - true - true - test - - - - - - - - metaInf-spring - - - - - org.citrusframework.remote.sample.entrypoint.CustomEntrypoint @@ -91,9 +65,8 @@ trigger-citrus-remote test - verify - ${citrus.remote.phase} + ${citrus.remote.test.phase} http://localhost:4567 @@ -104,7 +77,19 @@ 15000 - citrus-remote + ${citrus.remote.report.directory} + + + + + verify-citrus-remote-tests + + verify + + ${citrus.remote.verify.phase} + + + ${citrus.remote.report.directory} @@ -322,7 +307,8 @@ docker - integration-test + integration-test + verify pre-integration-test post-integration-test @@ -335,7 +321,8 @@ skip-citrus-remote - none + none + none From cda71a6ad4224c5141a6ff5b832097450fd235a2 Mon Sep 17 00:00:00 2001 From: Marco Bungart Date: Thu, 5 Sep 2024 21:01:25 +0200 Subject: [PATCH 3/3] Refactoring: Give the docker:copy execution a separate stage. In the current implementation, citrus-remote:test and docker:copy are executed within the same stage. This makes the order of execution dependent on the plugin order within the pom.xml. By providing a separate stage (post-integration-test), the only critical part is that docker:copy is executed before docker:stop and docker:remove. This makes the order of execution still dependent on the order in which the executions in the docker plugin are defined, but only within the same plugin. --- citrus-remote-sample/pom.xml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/citrus-remote-sample/pom.xml b/citrus-remote-sample/pom.xml index fd6cb7c..ecc9c1f 100644 --- a/citrus-remote-sample/pom.xml +++ b/citrus-remote-sample/pom.xml @@ -27,6 +27,7 @@ none none + none none none none @@ -175,7 +176,7 @@ copy - ${citrus.remote.phase} + ${docker.copy.phase} stop-container @@ -311,6 +312,7 @@ verify pre-integration-test + post-integration-test post-integration-test pre-integration-test post-integration-test @@ -323,6 +325,8 @@ none none + + none