From 5173fa6382cb28ce01ab0149e21c924b3716599e Mon Sep 17 00:00:00 2001 From: latlon team <info@lat-lon.de> Date: Mon, 17 Mar 2025 05:25:52 +0000 Subject: [PATCH] Code drop - XPLANBOX-3796 fix integration tests & always compile test code (fd3974571) Co-authored-by: Marc Guillemot <guillemot@lat-lon.de> Dropped from commit: 103d99052cd128b8724f4dd3c28fb5f33edf2c59 --- xplan-tests/xplan-tests-integration/README.md | 3 ++- xplan-tests/xplan-tests-integration/pom.xml | 4 +-- .../runAllIntegrationTests.sh | 2 +- .../de/latlon/xplanbox/tests/TestConfig.java | 8 +++--- .../validator/ValidationPublicEventsIT.java | 26 +++++++++---------- 5 files changed, 23 insertions(+), 20 deletions(-) diff --git a/xplan-tests/xplan-tests-integration/README.md b/xplan-tests/xplan-tests-integration/README.md index 1ab7f6f8f..7fc33a042 100644 --- a/xplan-tests/xplan-tests-integration/README.md +++ b/xplan-tests/xplan-tests-integration/README.md @@ -45,8 +45,9 @@ docker run --env XPLAN_VALIDATOR_WEB_BASE_URL=... xplanbox/xplan-tests-integrati - `XPLAN_RABBIT_VIRTUALHOST`: der Virtual Host auf dem RabbitMQ Server (Default: ``) - `XPLAN_RABBIT_USER`: der Benutzername für die Verbindung zum RabbitMQ Server (Default: `guest`) - `XPLAN_RABBIT_PASSWORD`: das Passwort für die Verbindung zum RabbitMQ Server (Default: `guest`) +- `XPLAN_RABBIT_PRIVATE_ANONYMOUSQUEUES_PREFIX`: das Präfix für die Benennung von anonymous queues (Default: ``) - `XPLAN_RABBIT_PUBLIC_TOPIC`: der Name vom Topic Exchange (Default: `xplanbox-public`) -- `XPLAN_RABBIT_PUBLIC_TOPIC_ROUTING_PREFIX`: der Präfix für die verwendeten Routing Keys (Default: ``) +- `XPLAN_RABBIT_PUBLIC_TOPIC_ROUTINGPREFIX`: der Präfix für die verwendeten Routing Keys (Default: ``) Der Report im PDF Format kann zu einem S3 Bucket hochgeladen werden, dafür müssen folgende Umgebungsvariablen gesetzt werden: diff --git a/xplan-tests/xplan-tests-integration/pom.xml b/xplan-tests/xplan-tests-integration/pom.xml index ccb08e416..c15e6fa43 100644 --- a/xplan-tests/xplan-tests-integration/pom.xml +++ b/xplan-tests/xplan-tests-integration/pom.xml @@ -9,11 +9,11 @@ </parent> <properties> - <maven.test.skip>true</maven.test.skip> <maven.install.skip>true</maven.install.skip> <maven.deploy.skip>true</maven.deploy.skip> <enforcer.skip>true</enforcer.skip> <gpg.skip>true</gpg.skip> + <skipTests>true</skipTests> </properties> <dependencies> @@ -73,7 +73,7 @@ <profile> <id>system-tests</id> <properties> - <maven.test.skip>false</maven.test.skip> + <skipTests>false</skipTests> <password /> <username /> </properties> diff --git a/xplan-tests/xplan-tests-integration/runAllIntegrationTests.sh b/xplan-tests/xplan-tests-integration/runAllIntegrationTests.sh index 6b106e5a5..983509219 100755 --- a/xplan-tests/xplan-tests-integration/runAllIntegrationTests.sh +++ b/xplan-tests/xplan-tests-integration/runAllIntegrationTests.sh @@ -63,7 +63,7 @@ kill -9 $xvfbPid echo -e "\n" echo "Results:" -results=`find target/surefire-reports/ -name 'TEST-*.xml' | xargs cat | grep "<testsuite" | sed 's/>.*/>/' | sed -e 's/[">]//g' -e 's/.*name=//' | sort` +results=`find target/failsafe-reports/ -name 'TEST-*.xml' | xargs cat | grep "<testsuite" | sed 's/>.*/>/' | sed -e 's/[">]//g' -e 's/.*name=//' | sort` echo -e "$results" echo -e "\n" diff --git a/xplan-tests/xplan-tests-integration/src/test/java/de/latlon/xplanbox/tests/TestConfig.java b/xplan-tests/xplan-tests-integration/src/test/java/de/latlon/xplanbox/tests/TestConfig.java index eae1bcbd0..acc430b90 100644 --- a/xplan-tests/xplan-tests-integration/src/test/java/de/latlon/xplanbox/tests/TestConfig.java +++ b/xplan-tests/xplan-tests-integration/src/test/java/de/latlon/xplanbox/tests/TestConfig.java @@ -31,7 +31,8 @@ public record TestConfig(String dokumenteApiBaseUrl, String managerApiBaseUrl, S String validatorWebPassword, RabbitConfig rabbitConfig) { public record RabbitConfig(String rabbitHost, int rabbitPort, String rabbitVirtualHost, String rabbitUsername, - String rabbitPassword, String publicTopicName, String publicTopicRoutingPrefix) { + String rabbitPassword, String publicTopicName, String publicTopicRoutingPrefix, + String privateAnonymousQueuePrefix) { }; public static TestConfig getTestConfig() { @@ -55,10 +56,11 @@ public record TestConfig(String dokumenteApiBaseUrl, String managerApiBaseUrl, S String rabbitUsername = getEnv("XPLAN_RABBIT_USER", "guest"); String rabbitPassword = getEnv("XPLAN_RABBIT_PASSWORD", "guest"); String publicTopicName = getEnv("XPLAN_RABBIT_PUBLIC_TOPIC", "latlon.public"); - String publicTopicRoutingPrefix = getEnv("XPLAN_RABBIT_PUBLIC_TOPIC_ROUTING_PREFIX", ""); + String publicTopicRoutingPrefix = getEnv("XPLAN_RABBIT_PUBLIC_TOPIC_ROUTINGPREFIX", ""); + String privateAnonymousQueuePrefix = getEnv("XPLAN_RABBIT_PRIVATE_ANONYMOUSQUEUES_PREFIX", ""); RabbitConfig rabbitConfig = new RabbitConfig(rabbitHost, rabbitPort, rabbitVirtualHost, rabbitUsername, - rabbitPassword, publicTopicName, publicTopicRoutingPrefix); + rabbitPassword, publicTopicName, publicTopicRoutingPrefix, privateAnonymousQueuePrefix); return new TestConfig(dokumenteApiBaseUrl, managerApiBaseUrl, validatorApiBaseUrl, apiUsername, apiPassword, validatorWebBaseUrl, validatorWebUsername, validatorWebPassword, rabbitConfig); } diff --git a/xplan-tests/xplan-tests-integration/src/test/java/de/latlon/xplanbox/tests/rabbit/validator/ValidationPublicEventsIT.java b/xplan-tests/xplan-tests-integration/src/test/java/de/latlon/xplanbox/tests/rabbit/validator/ValidationPublicEventsIT.java index 67a66d115..bd514c4c3 100644 --- a/xplan-tests/xplan-tests-integration/src/test/java/de/latlon/xplanbox/tests/rabbit/validator/ValidationPublicEventsIT.java +++ b/xplan-tests/xplan-tests-integration/src/test/java/de/latlon/xplanbox/tests/rabbit/validator/ValidationPublicEventsIT.java @@ -8,12 +8,12 @@ * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * #L% @@ -63,52 +63,52 @@ class ValidationPublicEventsIT extends AbstractRabbitITExecution { // verify status (probably not yet finished but who knows...) StatusResponse statusResponse = validatorApi.v2Status(r.uuid()); - assertThat(statusResponse.status()).isIn("VALIDATION_REQUESTED", "VALIDATION_FINISHED"); + assertThat(statusResponse.status()).isIn("VALIDATION_REQUESTED", "VALIDATION_STARTED", "VALIDATION_FINISHED"); // awaiting 8 events for this uuid ReceivedPublicEvent expectedEventValidationStarted = new ReceivedPublicEvent( - testConfig.rabbitConfig().publicTopicRoutingPrefix() + "xplanbox.validation", + testConfig.rabbitConfig().publicTopicRoutingPrefix() + "validation", "{\"apiVersion\":\"1.0\",\"eventType\":\"VALIDATION_STARTED\",\"uuid\":\"" + r.uuid() + "\",\"valid\":null,\"error\":null}"); ReceivedPublicEvent expectedEventSynValidationStarted = new ReceivedPublicEvent( - testConfig.rabbitConfig().publicTopicRoutingPrefix() + "xplanbox.validation.syntaktisch", + testConfig.rabbitConfig().publicTopicRoutingPrefix() + "validation.syntaktisch", "{\"apiVersion\":\"1.0\",\"eventType\":\"SYNTACTIC_VALIDATION_STARTED\",\"uuid\":\"" + r.uuid() + "\",\"valid\":null,\"error\":null}"); ReceivedPublicEvent expectedEventSynValidationFinished = new ReceivedPublicEvent( - testConfig.rabbitConfig().publicTopicRoutingPrefix() + "xplanbox.validation.syntaktisch", + testConfig.rabbitConfig().publicTopicRoutingPrefix() + "validation.syntaktisch", "{\"apiVersion\":\"1.0\",\"eventType\":\"SYNTACTIC_VALIDATION_FINISHED\",\"uuid\":\"" + r.uuid() + "\",\"valid\":true,\"error\":null}"); ReceivedPublicEvent expectedEventRefValidationStarted = new ReceivedPublicEvent( - testConfig.rabbitConfig().publicTopicRoutingPrefix() + "xplanbox.validation.referenzen", + testConfig.rabbitConfig().publicTopicRoutingPrefix() + "validation.referenzen", "{\"apiVersion\":\"1.0\",\"eventType\":\"REFERENCES_STARTED\",\"uuid\":\"" + r.uuid() + "\",\"valid\":null,\"error\":null}"); ReceivedPublicEvent expectedEventRefValidationFinished = new ReceivedPublicEvent( - testConfig.rabbitConfig().publicTopicRoutingPrefix() + "xplanbox.validation.referenzen", + testConfig.rabbitConfig().publicTopicRoutingPrefix() + "validation.referenzen", "{\"apiVersion\":\"1.0\",\"eventType\":\"REFERENCES_FINISHED\",\"uuid\":\"" + r.uuid() + "\",\"valid\":true,\"error\":null}"); ReceivedPublicEvent expectedEventGeomValidationStarted = new ReceivedPublicEvent( - testConfig.rabbitConfig().publicTopicRoutingPrefix() + "xplanbox.validation.geometrisch", + testConfig.rabbitConfig().publicTopicRoutingPrefix() + "validation.geometrisch", "{\"apiVersion\":\"1.0\",\"eventType\":\"GEOMETRIC_VALIDATION_STARTED\",\"uuid\":\"" + r.uuid() + "\",\"valid\":null,\"error\":null}"); ReceivedPublicEvent expectedEventGeomValidationFinished = new ReceivedPublicEvent( - testConfig.rabbitConfig().publicTopicRoutingPrefix() + "xplanbox.validation.geometrisch", + testConfig.rabbitConfig().publicTopicRoutingPrefix() + "validation.geometrisch", "{\"apiVersion\":\"1.0\",\"eventType\":\"GEOMETRIC_VALIDATION_FINISHED\",\"uuid\":\"" + r.uuid() + "\",\"valid\":true,\"error\":null}"); ReceivedPublicEvent expectedEventSemValidationStarted = new ReceivedPublicEvent( - testConfig.rabbitConfig().publicTopicRoutingPrefix() + "xplanbox.validation.semantisch", + testConfig.rabbitConfig().publicTopicRoutingPrefix() + "validation.semantisch", "{\"apiVersion\":\"1.0\",\"eventType\":\"SEMANTIC_VALIDATION_STARTED\",\"uuid\":\"" + r.uuid() + "\",\"valid\":null,\"error\":null}"); ReceivedPublicEvent expectedEventSemValidationFinished = new ReceivedPublicEvent( - testConfig.rabbitConfig().publicTopicRoutingPrefix() + "xplanbox.validation.semantisch", + testConfig.rabbitConfig().publicTopicRoutingPrefix() + "validation.semantisch", "{\"apiVersion\":\"1.0\",\"eventType\":\"SEMANTIC_VALIDATION_FINISHED\",\"uuid\":\"" + r.uuid() + "\",\"valid\":true,\"error\":null}"); ReceivedPublicEvent expectedEventValidationFinished = new ReceivedPublicEvent( - testConfig.rabbitConfig().publicTopicRoutingPrefix() + "xplanbox.validation", + testConfig.rabbitConfig().publicTopicRoutingPrefix() + "validation", "{\"apiVersion\":\"1.0\",\"eventType\":\"VALIDATION_FINISHED\",\"uuid\":\"" + r.uuid() + "\",\"valid\":true,\"error\":null}"); waitingIfNeeded(20, -- GitLab