This is an automated email from the ASF dual-hosted git repository. ppalaga pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
commit d18824651ea87038bb385b3e0c09f96db12aa88c Author: Peter Palaga <ppal...@redhat.com> AuthorDate: Wed Apr 14 18:33:55 2021 +0200 Run Azure tests grouped on the CI thus saving some time --- .../azure}/README.adoc | 19 +++- .../azure}/azure-eventhubs/pom.xml | 2 +- .../azure/eventhubs/it/AzureEventhubsResource.java | 14 +-- .../azure/eventhubs/it/AzureEventhubsRoutes.java | 29 +++-- .../azure/eventhubs/it/AzureEventhubsIT.java | 0 .../azure/eventhubs/it/AzureEventhubsTest.java | 0 .../azure}/azure-resources.sh | 4 +- .../azure}/azure-storage-blob/pom.xml | 3 +- .../storage/blob/it/AzureStorageBlobResource.java | 0 .../src/main/resources/application.properties | 0 .../azure/storage/blob/it/AzureStorageBlobIT.java | 0 .../storage/blob/it/AzureStorageBlobTest.java | 0 .../azure}/azure-storage-queue/pom.xml | 3 +- .../queue/it/AzureStorageQueueResource.java | 0 .../src/main/resources/application.properties | 0 .../storage/queue/it/AzureStorageQueueIT.java | 0 .../storage/queue/it/AzureStorageQueueTest.java | 0 integration-test-groups/{ => azure}/pom.xml | 15 ++- integration-test-groups/pom.xml | 7 +- integration-tests/azure-grouped/README.adoc | 20 ++++ .../{azure-eventhubs => azure-grouped}/pom.xml | 123 ++++++++++++++++++--- integration-tests/azure-storage-blob/README.adoc | 16 --- integration-tests/azure-storage-queue/README.adoc | 16 --- integration-tests/pom.xml | 4 +- pom.xml | 14 ++- tooling/scripts/group-tests.groovy | 25 ++--- tooling/scripts/test-categories.yaml | 4 +- 27 files changed, 213 insertions(+), 105 deletions(-) diff --git a/integration-tests/azure-eventhubs/README.adoc b/integration-test-groups/azure/README.adoc similarity index 65% rename from integration-tests/azure-eventhubs/README.adoc rename to integration-test-groups/azure/README.adoc index 55b8163..33c21ec 100644 --- a/integration-tests/azure-eventhubs/README.adoc +++ b/integration-test-groups/azure/README.adoc @@ -1,11 +1,21 @@ -== Azure Event Hubs Service integration tests +== Azure isolated integration tests -By default the integration tests run only against the real remote Azure API. +=== Azurite + +By default the integration tests are run against the Azurite test container, +or skipped, if the given service is not supported by Azurite. + +Unsupported by Azurite: + +* `azure-eventhubs` + +=== Real Azure API Prerequisites: * A https://docs.microsoft.com/en-us/azure/storage/common/storage-account-create?toc=%2Fazure%2Fstorage%2Fblobs%2Ftoc.json&tabs=azure-portal[general-purpose v2 Azure storage account] and https://docs.microsoft.com/en-us/azure/storage/blobs/storage-quickstart-blobs-portal[create a container] +* View the https://docs.microsoft.com/en-us/azure/storage/common/storage-account-keys-manage?tabs=azure-portal#view-account-access-keys[account keys] and set the following environment variables: * An https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-create[Azure Event Hub] * An https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-get-connection-string[Event Hubs connection string] @@ -26,7 +36,7 @@ Here are the environment variables you need to set: export AZURE_STORAGE_ACCOUNT_NAME=<your-azure-storage-account-name> export AZURE_STORAGE_ACCOUNT_KEY=<your-azure-storage-account-key> # the container has to exist before you run the test -export AZURE_BLOB_CONTAINER_NAME=<your-container-name> +export AZURE_EVENT_HUBS_BLOB_CONTAINER_NAME=<your-container-name> export AZURE_EVENT_HUBS_CONNECTION_STRING="Endpoint=sb://<your-namespace>.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=<your-key>;EntityPath=<your-hub-name>" ---- @@ -37,3 +47,6 @@ To clean up, run $ ./azure-resources.sh delete ---- +You may want to `export CAMEL_QUARKUS_START_MOCK_BACKEND=false` to avoid starting the local Azurite container and make sure that you test against the real remote Azure API. + + diff --git a/integration-tests/azure-eventhubs/pom.xml b/integration-test-groups/azure/azure-eventhubs/pom.xml similarity index 98% copy from integration-tests/azure-eventhubs/pom.xml copy to integration-test-groups/azure/azure-eventhubs/pom.xml index 39b96ee..5d8f783 100644 --- a/integration-tests/azure-eventhubs/pom.xml +++ b/integration-test-groups/azure/azure-eventhubs/pom.xml @@ -21,7 +21,7 @@ <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.apache.camel.quarkus</groupId> - <artifactId>camel-quarkus-integration-tests</artifactId> + <artifactId>camel-quarkus-integration-tests-azure</artifactId> <version>1.9.0-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> diff --git a/integration-tests/azure-eventhubs/src/main/java/org/apache/camel/quarkus/component/azure/eventhubs/it/AzureEventhubsResource.java b/integration-test-groups/azure/azure-eventhubs/src/main/java/org/apache/camel/quarkus/component/azure/eventhubs/it/AzureEventhubsResource.java similarity index 89% rename from integration-tests/azure-eventhubs/src/main/java/org/apache/camel/quarkus/component/azure/eventhubs/it/AzureEventhubsResource.java rename to integration-test-groups/azure/azure-eventhubs/src/main/java/org/apache/camel/quarkus/component/azure/eventhubs/it/AzureEventhubsResource.java index b9da58b..f5e3043 100644 --- a/integration-tests/azure-eventhubs/src/main/java/org/apache/camel/quarkus/component/azure/eventhubs/it/AzureEventhubsResource.java +++ b/integration-test-groups/azure/azure-eventhubs/src/main/java/org/apache/camel/quarkus/component/azure/eventhubs/it/AzureEventhubsResource.java @@ -18,6 +18,7 @@ package org.apache.camel.quarkus.component.azure.eventhubs.it; import java.net.URI; import java.util.List; +import java.util.Optional; import java.util.stream.Collectors; import javax.enterprise.context.ApplicationScoped; @@ -51,17 +52,8 @@ public class AzureEventhubsResource { @Inject CamelContext context; - @ConfigProperty(name = "azure.storage.account-name") - String azureStorageAccountName; - - @ConfigProperty(name = "azure.storage.account-key") - String azureStorageAccountKey; - @ConfigProperty(name = "azure.event.hubs.connection.string") - String connectionString; - - @ConfigProperty(name = "azure.blob.container.name") - String azureBlobContainerName; + Optional<String> connectionString; private volatile String message; private int counter = 0; @@ -73,7 +65,7 @@ public class AzureEventhubsResource { @Scheduled(every = "1s") void schedule() { if (message != null) { - final String endpointUri = "azure-eventhubs:?connectionString=RAW(" + connectionString + ")"; + final String endpointUri = "azure-eventhubs:?connectionString=RAW(" + connectionString.get() + ")"; producerTemplate.sendBody(endpointUri, message + (counter++)); } } diff --git a/integration-tests/azure-eventhubs/src/main/java/org/apache/camel/quarkus/component/azure/eventhubs/it/AzureEventhubsRoutes.java b/integration-test-groups/azure/azure-eventhubs/src/main/java/org/apache/camel/quarkus/component/azure/eventhubs/it/AzureEventhubsRoutes.java similarity index 58% rename from integration-tests/azure-eventhubs/src/main/java/org/apache/camel/quarkus/component/azure/eventhubs/it/AzureEventhubsRoutes.java rename to integration-test-groups/azure/azure-eventhubs/src/main/java/org/apache/camel/quarkus/component/azure/eventhubs/it/AzureEventhubsRoutes.java index 0a98d3c..c3aa6be 100644 --- a/integration-tests/azure-eventhubs/src/main/java/org/apache/camel/quarkus/component/azure/eventhubs/it/AzureEventhubsRoutes.java +++ b/integration-test-groups/azure/azure-eventhubs/src/main/java/org/apache/camel/quarkus/component/azure/eventhubs/it/AzureEventhubsRoutes.java @@ -16,6 +16,8 @@ */ package org.apache.camel.quarkus.component.azure.eventhubs.it; +import java.util.Optional; + import javax.enterprise.context.ApplicationScoped; import com.azure.core.amqp.AmqpTransportType; @@ -32,20 +34,27 @@ public class AzureEventhubsRoutes extends RouteBuilder { String azureStorageAccountKey; @ConfigProperty(name = "azure.event.hubs.connection.string") - String connectionString; + Optional<String> connectionString; + + @ConfigProperty(name = "azure.event.hubs.blob.container.name") + Optional<String> azureBlobContainerName; - @ConfigProperty(name = "azure.blob.container.name") - String azureBlobContainerName; + @ConfigProperty(name = "camel.quarkus.start.mock.backend", defaultValue = "true") + boolean startMockBackend; @Override public void configure() throws Exception { - from("azure-eventhubs:?connectionString=RAW(" + connectionString - + ")&blobAccountName=RAW(" + azureStorageAccountName - + ")&blobAccessKey=RAW(" + azureStorageAccountKey - + ")&blobContainerName=RAW(" + azureBlobContainerName + ")&amqpTransportType=" - + AmqpTransportType.AMQP) - .to("mock:azure-consumed"); - + if (connectionString.isPresent() && azureBlobContainerName.isPresent()) { + from("azure-eventhubs:?connectionString=RAW(" + connectionString.get() + + ")&blobAccountName=RAW(" + azureStorageAccountName + + ")&blobAccessKey=RAW(" + azureStorageAccountKey + + ")&blobContainerName=RAW(" + azureBlobContainerName.get() + ")&amqpTransportType=" + + AmqpTransportType.AMQP) + .to("mock:azure-consumed"); + } else if (!startMockBackend) { + throw new IllegalStateException( + "azure.event.hubs.connection.string and azure.event.hubs.blob.container.name must be set when camel.quarkus.start.mock.backend == false"); + } } } diff --git a/integration-tests/azure-eventhubs/src/test/java/org/apache/camel/quarkus/component/azure/eventhubs/it/AzureEventhubsIT.java b/integration-test-groups/azure/azure-eventhubs/src/test/java/org/apache/camel/quarkus/component/azure/eventhubs/it/AzureEventhubsIT.java similarity index 100% rename from integration-tests/azure-eventhubs/src/test/java/org/apache/camel/quarkus/component/azure/eventhubs/it/AzureEventhubsIT.java rename to integration-test-groups/azure/azure-eventhubs/src/test/java/org/apache/camel/quarkus/component/azure/eventhubs/it/AzureEventhubsIT.java diff --git a/integration-tests/azure-eventhubs/src/test/java/org/apache/camel/quarkus/component/azure/eventhubs/it/AzureEventhubsTest.java b/integration-test-groups/azure/azure-eventhubs/src/test/java/org/apache/camel/quarkus/component/azure/eventhubs/it/AzureEventhubsTest.java similarity index 100% rename from integration-tests/azure-eventhubs/src/test/java/org/apache/camel/quarkus/component/azure/eventhubs/it/AzureEventhubsTest.java rename to integration-test-groups/azure/azure-eventhubs/src/test/java/org/apache/camel/quarkus/component/azure/eventhubs/it/AzureEventhubsTest.java diff --git a/integration-tests/azure-eventhubs/azure-resources.sh b/integration-test-groups/azure/azure-resources.sh similarity index 97% rename from integration-tests/azure-eventhubs/azure-resources.sh rename to integration-test-groups/azure/azure-resources.sh index fd7cc46..8b7a4b6 100755 --- a/integration-tests/azure-eventhubs/azure-resources.sh +++ b/integration-test-groups/azure/azure-resources.sh @@ -18,7 +18,7 @@ suffix="$(az ad signed-in-user show --query displayName -o tsv | tr '[:upper:]' '[:lower:]' | tr -cd '[:alnum:]' | cut -c-12)" -suffix="${suffix}1" +suffix="${suffix}4" export AZURE_STORAGE_ACCOUNT_NAME=cqacc${suffix} export AZURE_BLOB_CONTAINER_NAME=cq-container-${suffix} @@ -54,7 +54,7 @@ function createResources() { echo 'export AZURE_STORAGE_ACCOUNT_NAME="'${AZURE_STORAGE_ACCOUNT_NAME}'"' echo 'export AZURE_STORAGE_ACCOUNT_KEY="'${AZURE_STORAGE_ACCOUNT_KEY}'"' - echo 'export AZURE_BLOB_CONTAINER_NAME="'${AZURE_BLOB_CONTAINER_NAME}'"' + echo 'export AZURE_EVENT_HUBS_BLOB_CONTAINER_NAME="'${AZURE_BLOB_CONTAINER_NAME}'"' echo 'export AZURE_EVENT_HUBS_CONNECTION_STRING="'$AZURE_EVENT_HUBS_CONNECTION_STRING';EntityPath='${EH_NAME}'"' } diff --git a/integration-tests/azure-storage-blob/pom.xml b/integration-test-groups/azure/azure-storage-blob/pom.xml similarity index 97% rename from integration-tests/azure-storage-blob/pom.xml rename to integration-test-groups/azure/azure-storage-blob/pom.xml index ae7abc7..1f3824c 100644 --- a/integration-tests/azure-storage-blob/pom.xml +++ b/integration-test-groups/azure/azure-storage-blob/pom.xml @@ -21,8 +21,9 @@ <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.apache.camel.quarkus</groupId> - <artifactId>camel-quarkus-integration-tests</artifactId> + <artifactId>camel-quarkus-integration-tests-azure</artifactId> <version>1.9.0-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> </parent> <artifactId>camel-quarkus-integration-test-azure-storage-blob</artifactId> diff --git a/integration-tests/azure-storage-blob/src/main/java/org/apache/camel/quarkus/component/azure/storage/blob/it/AzureStorageBlobResource.java b/integration-test-groups/azure/azure-storage-blob/src/main/java/org/apache/camel/quarkus/component/azure/storage/blob/it/AzureStorageBlobResource.java similarity index 100% rename from integration-tests/azure-storage-blob/src/main/java/org/apache/camel/quarkus/component/azure/storage/blob/it/AzureStorageBlobResource.java rename to integration-test-groups/azure/azure-storage-blob/src/main/java/org/apache/camel/quarkus/component/azure/storage/blob/it/AzureStorageBlobResource.java diff --git a/integration-tests/azure-storage-queue/src/main/resources/application.properties b/integration-test-groups/azure/azure-storage-blob/src/main/resources/application.properties similarity index 100% rename from integration-tests/azure-storage-queue/src/main/resources/application.properties rename to integration-test-groups/azure/azure-storage-blob/src/main/resources/application.properties diff --git a/integration-tests/azure-storage-blob/src/test/java/org/apache/camel/quarkus/component/azure/storage/blob/it/AzureStorageBlobIT.java b/integration-test-groups/azure/azure-storage-blob/src/test/java/org/apache/camel/quarkus/component/azure/storage/blob/it/AzureStorageBlobIT.java similarity index 100% rename from integration-tests/azure-storage-blob/src/test/java/org/apache/camel/quarkus/component/azure/storage/blob/it/AzureStorageBlobIT.java rename to integration-test-groups/azure/azure-storage-blob/src/test/java/org/apache/camel/quarkus/component/azure/storage/blob/it/AzureStorageBlobIT.java diff --git a/integration-tests/azure-storage-blob/src/test/java/org/apache/camel/quarkus/component/azure/storage/blob/it/AzureStorageBlobTest.java b/integration-test-groups/azure/azure-storage-blob/src/test/java/org/apache/camel/quarkus/component/azure/storage/blob/it/AzureStorageBlobTest.java similarity index 100% rename from integration-tests/azure-storage-blob/src/test/java/org/apache/camel/quarkus/component/azure/storage/blob/it/AzureStorageBlobTest.java rename to integration-test-groups/azure/azure-storage-blob/src/test/java/org/apache/camel/quarkus/component/azure/storage/blob/it/AzureStorageBlobTest.java diff --git a/integration-tests/azure-storage-queue/pom.xml b/integration-test-groups/azure/azure-storage-queue/pom.xml similarity index 97% rename from integration-tests/azure-storage-queue/pom.xml rename to integration-test-groups/azure/azure-storage-queue/pom.xml index 5746c25..e49b1b6 100644 --- a/integration-tests/azure-storage-queue/pom.xml +++ b/integration-test-groups/azure/azure-storage-queue/pom.xml @@ -21,8 +21,9 @@ <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.apache.camel.quarkus</groupId> - <artifactId>camel-quarkus-integration-tests</artifactId> + <artifactId>camel-quarkus-integration-tests-azure</artifactId> <version>1.9.0-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> </parent> <artifactId>camel-quarkus-integration-test-azure-storage-queue</artifactId> diff --git a/integration-tests/azure-storage-queue/src/main/java/org/apache/camel/quarkus/component/azure/storage/queue/it/AzureStorageQueueResource.java b/integration-test-groups/azure/azure-storage-queue/src/main/java/org/apache/camel/quarkus/component/azure/storage/queue/it/AzureStorageQueueResource.java similarity index 100% rename from integration-tests/azure-storage-queue/src/main/java/org/apache/camel/quarkus/component/azure/storage/queue/it/AzureStorageQueueResource.java rename to integration-test-groups/azure/azure-storage-queue/src/main/java/org/apache/camel/quarkus/component/azure/storage/queue/it/AzureStorageQueueResource.java diff --git a/integration-tests/azure-storage-blob/src/main/resources/application.properties b/integration-test-groups/azure/azure-storage-queue/src/main/resources/application.properties similarity index 100% rename from integration-tests/azure-storage-blob/src/main/resources/application.properties rename to integration-test-groups/azure/azure-storage-queue/src/main/resources/application.properties diff --git a/integration-tests/azure-storage-queue/src/test/java/org/apache/camel/quarkus/component/azure/storage/queue/it/AzureStorageQueueIT.java b/integration-test-groups/azure/azure-storage-queue/src/test/java/org/apache/camel/quarkus/component/azure/storage/queue/it/AzureStorageQueueIT.java similarity index 100% rename from integration-tests/azure-storage-queue/src/test/java/org/apache/camel/quarkus/component/azure/storage/queue/it/AzureStorageQueueIT.java rename to integration-test-groups/azure/azure-storage-queue/src/test/java/org/apache/camel/quarkus/component/azure/storage/queue/it/AzureStorageQueueIT.java diff --git a/integration-tests/azure-storage-queue/src/test/java/org/apache/camel/quarkus/component/azure/storage/queue/it/AzureStorageQueueTest.java b/integration-test-groups/azure/azure-storage-queue/src/test/java/org/apache/camel/quarkus/component/azure/storage/queue/it/AzureStorageQueueTest.java similarity index 100% rename from integration-tests/azure-storage-queue/src/test/java/org/apache/camel/quarkus/component/azure/storage/queue/it/AzureStorageQueueTest.java rename to integration-test-groups/azure/azure-storage-queue/src/test/java/org/apache/camel/quarkus/component/azure/storage/queue/it/AzureStorageQueueTest.java diff --git a/integration-test-groups/pom.xml b/integration-test-groups/azure/pom.xml similarity index 77% copy from integration-test-groups/pom.xml copy to integration-test-groups/azure/pom.xml index 5211165..a4d678a 100644 --- a/integration-test-groups/pom.xml +++ b/integration-test-groups/azure/pom.xml @@ -22,19 +22,24 @@ <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.apache.camel.quarkus</groupId> - <artifactId>camel-quarkus</artifactId> + <artifactId>camel-quarkus-integration-test-groups</artifactId> <version>1.9.0-SNAPSHOT</version> - <relativePath>../pom.xml</relativePath> </parent> - <artifactId>camel-quarkus-integration-test-groups</artifactId> + <artifactId>camel-quarkus-integration-tests-azure</artifactId> <packaging>pom</packaging> - <name>Camel Quarkus :: Integration Test Groups</name> + <name>Camel Quarkus :: Azure Integration Tests</name> + + <properties> + <quarkus.banner.enabled>false</quarkus.banner.enabled> + </properties> <modules> <!-- extensions a..z; do not remove this comment, it is important when sorting via mvn process-resources -Pformat --> - <module>aws2</module> + <module>azure-eventhubs</module> + <module>azure-storage-blob</module> + <module>azure-storage-queue</module> </modules> </project> diff --git a/integration-test-groups/pom.xml b/integration-test-groups/pom.xml index 5211165..fc6e64c 100644 --- a/integration-test-groups/pom.xml +++ b/integration-test-groups/pom.xml @@ -22,9 +22,9 @@ <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.apache.camel.quarkus</groupId> - <artifactId>camel-quarkus</artifactId> + <artifactId>camel-quarkus-build-parent-it</artifactId> <version>1.9.0-SNAPSHOT</version> - <relativePath>../pom.xml</relativePath> + <relativePath>../poms/build-parent-it/pom.xml</relativePath> </parent> <artifactId>camel-quarkus-integration-test-groups</artifactId> @@ -33,8 +33,9 @@ <name>Camel Quarkus :: Integration Test Groups</name> <modules> - <!-- extensions a..z; do not remove this comment, it is important when sorting via mvn process-resources -Pformat --> + <!-- test groups a..z; do not remove this comment, it is important when sorting via mvn process-resources -Pformat --> <module>aws2</module> + <module>azure</module> </modules> </project> diff --git a/integration-tests/azure-grouped/README.adoc b/integration-tests/azure-grouped/README.adoc new file mode 100644 index 0000000..beed18b --- /dev/null +++ b/integration-tests/azure-grouped/README.adoc @@ -0,0 +1,20 @@ +== Azure grouped integration tests + +This module allows executing all tests from `integration-test-groups/azure/*` grouped together. + +While grouping brings the benefit of faster native compilation +(compared to the sum of compilation times of all modules under `integration-test-groups/azure/*`) +it is methodologically not as clean as running those tests in isolation. +Hence, this module is intended to be run instead of the tests under `integration-test-groups/azure/*` +if, in the given situation, the speed matters more than isolation. + +=== How the grouping works + +* The grouped module dynamically pulls all sources from the individual AWS test modules to its +* `target/[test-]classes` directories. +* `application.properties` files and service descriptors are concatenated using a Groovy script. +* The dependencies in the grouped `pom.xml` can be updated via `mvn process-resources -Pformat -N`. + +=== Mock backend vs. real service + +Please refer to link:../../integration-tests-azure/README.adoc[integration-test-groups/azure/README.adoc] for more details. diff --git a/integration-tests/azure-eventhubs/pom.xml b/integration-tests/azure-grouped/pom.xml similarity index 55% rename from integration-tests/azure-eventhubs/pom.xml rename to integration-tests/azure-grouped/pom.xml index 39b96ee..694f966 100644 --- a/integration-tests/azure-eventhubs/pom.xml +++ b/integration-tests/azure-grouped/pom.xml @@ -18,17 +18,16 @@ --> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.apache.camel.quarkus</groupId> <artifactId>camel-quarkus-integration-tests</artifactId> <version>1.9.0-SNAPSHOT</version> - <relativePath>../pom.xml</relativePath> </parent> + <modelVersion>4.0.0</modelVersion> - <artifactId>camel-quarkus-integration-test-azure-eventhubs</artifactId> - <name>Camel Quarkus :: Integration Tests :: Azure Event Hubs</name> - <description>Integration tests for Camel Quarkus Azure Event Hubs extension</description> + <artifactId>camel-quarkus-integration-test-azure-grouped</artifactId> + <name>Camel Quarkus :: Integration Tests :: Azure Grouped</name> + <description>Azure tests from ../integration-test-groups/azure merged together</description> <dependencyManagement> <dependencies> @@ -49,16 +48,9 @@ </dependencies> </dependencyManagement> + <!-- Regenerate the dependencies via `mvn process-resources -Pformat -N` from the source tree root directory --> <dependencies> <dependency> - <groupId>org.apache.camel.quarkus</groupId> - <artifactId>camel-quarkus-azure-eventhubs</artifactId> - </dependency> - <dependency> - <groupId>org.apache.camel.quarkus</groupId> - <artifactId>camel-quarkus-mock</artifactId> - </dependency> - <dependency> <groupId>io.quarkus</groupId> <artifactId>quarkus-quartz</artifactId> </dependency> @@ -70,8 +62,22 @@ <groupId>io.quarkus</groupId> <artifactId>quarkus-resteasy-jackson</artifactId> </dependency> - - <!-- test dependencies --> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-azure-eventhubs</artifactId> + </dependency> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-azure-storage-blob</artifactId> + </dependency> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-azure-storage-queue</artifactId> + </dependency> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-mock</artifactId> + </dependency> <dependency> <groupId>io.quarkus</groupId> <artifactId>quarkus-junit5</artifactId> @@ -83,6 +89,11 @@ <scope>test</scope> </dependency> <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-integration-tests-support-azure</artifactId> + <scope>test</scope> + </dependency> + <dependency> <groupId>org.awaitility</groupId> <artifactId>awaitility</artifactId> <scope>test</scope> @@ -104,6 +115,32 @@ </dependency> <dependency> <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-azure-storage-blob-deployment</artifactId> + <version>${project.version}</version> + <type>pom</type> + <scope>test</scope> + <exclusions> + <exclusion> + <groupId>*</groupId> + <artifactId>*</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-azure-storage-queue-deployment</artifactId> + <version>${project.version}</version> + <type>pom</type> + <scope>test</scope> + <exclusions> + <exclusion> + <groupId>*</groupId> + <artifactId>*</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> <artifactId>camel-quarkus-mock-deployment</artifactId> <version>${project.version}</version> <type>pom</type> @@ -117,6 +154,62 @@ </dependency> </dependencies> + <build> + <plugins> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>build-helper-maven-plugin</artifactId> + <executions> + <execution> + <id>add-sources</id> + <phase>generate-sources</phase> + <goals> + <goal>add-source</goal> + </goals> + <configuration> + <sources> + <source>${basedir}/target/src/main/java</source> + </sources> + </configuration> + </execution> + <execution> + <id>add-test-sources</id> + <phase>generate-sources</phase> + <goals> + <goal>add-test-source</goal> + </goals> + <configuration> + <sources> + <source>${basedir}/target/src/test/java</source> + </sources> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.codehaus.gmaven</groupId> + <artifactId>groovy-maven-plugin</artifactId> + <executions> + <execution> + <id>group-sources</id> + <goals> + <goal>execute</goal> + </goals> + <phase>generate-sources</phase> + <configuration> + <source>file:///${maven.multiModuleProjectDirectory}/tooling/scripts/group-tests.groovy</source> + <properties> + <group-tests.source.dir>${maven.multiModuleProjectDirectory}/integration-test-groups/azure</group-tests.source.dir> + <group-tests.dest.module.dir>${project.basedir}</group-tests.dest.module.dir> + <group-tests.concat.rel.paths>src/main/resources/application.properties</group-tests.concat.rel.paths> + </properties> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + <profiles> <profile> <id>native</id> diff --git a/integration-tests/azure-storage-blob/README.adoc b/integration-tests/azure-storage-blob/README.adoc deleted file mode 100644 index db86b5c..0000000 --- a/integration-tests/azure-storage-blob/README.adoc +++ /dev/null @@ -1,16 +0,0 @@ -== Azure Storage Blob Service integration tests - -By default the integration tests run against a local https://github.com/Azure/Azurite[Azurite] container. - -To run the tests against the real remote Azure API, you need the following: - -* A https://docs.microsoft.com/en-us/azure/storage/common/storage-account-create?toc=%2Fazure%2Fstorage%2Fblobs%2Ftoc.json&tabs=azure-portal[general-purpose v2 Azure storage account] -* View the https://docs.microsoft.com/en-us/azure/storage/common/storage-account-keys-manage?tabs=azure-portal#view-account-access-keys[account keys] and set the following environment variables: -+ -[source,shell] ----- -export AZURE_STORAGE_ACCOUNT_NAME=my-account-name -export AZURE_STORAGE_ACCOUNT_KEY=my-account-key ----- - -You may want to `export CAMEL_QUARKUS_START_MOCK_BACKEND=false` to avoid starting he the local Azurite container and make sure that you test against the real remote Azure API. diff --git a/integration-tests/azure-storage-queue/README.adoc b/integration-tests/azure-storage-queue/README.adoc deleted file mode 100644 index db86b5c..0000000 --- a/integration-tests/azure-storage-queue/README.adoc +++ /dev/null @@ -1,16 +0,0 @@ -== Azure Storage Blob Service integration tests - -By default the integration tests run against a local https://github.com/Azure/Azurite[Azurite] container. - -To run the tests against the real remote Azure API, you need the following: - -* A https://docs.microsoft.com/en-us/azure/storage/common/storage-account-create?toc=%2Fazure%2Fstorage%2Fblobs%2Ftoc.json&tabs=azure-portal[general-purpose v2 Azure storage account] -* View the https://docs.microsoft.com/en-us/azure/storage/common/storage-account-keys-manage?tabs=azure-portal#view-account-access-keys[account keys] and set the following environment variables: -+ -[source,shell] ----- -export AZURE_STORAGE_ACCOUNT_NAME=my-account-name -export AZURE_STORAGE_ACCOUNT_KEY=my-account-key ----- - -You may want to `export CAMEL_QUARKUS_START_MOCK_BACKEND=false` to avoid starting he the local Azurite container and make sure that you test against the real remote Azure API. diff --git a/integration-tests/pom.xml b/integration-tests/pom.xml index cb38bb3..c55782b 100644 --- a/integration-tests/pom.xml +++ b/integration-tests/pom.xml @@ -72,9 +72,7 @@ <module>avro-rpc</module> <module>aws2</module> <module>aws2-grouped</module> - <module>azure-eventhubs</module> - <module>azure-storage-blob</module> - <module>azure-storage-queue</module> + <module>azure-grouped</module> <module>base64</module> <module>bean</module> <module>bean-validator</module> diff --git a/pom.xml b/pom.xml index 2fa3fed..118d7e8 100644 --- a/pom.xml +++ b/pom.xml @@ -742,6 +742,7 @@ <sortModulesPath>integration-tests/pom.xml</sortModulesPath> <sortModulesPath>integration-test-groups/pom.xml</sortModulesPath> <sortModulesPath>integration-test-groups/aws2/pom.xml</sortModulesPath> + <sortModulesPath>integration-test-groups/azure/pom.xml</sortModulesPath> </sortModulesPaths> <sortDependencyManagementPaths> <sortDependencyManagementPath>poms/bom/pom.xml</sortDependencyManagementPath> @@ -790,19 +791,28 @@ <directory>${basedir}</directory> <includes> <include>integration-tests/*/src/main/resources/application.properties</include> - <include>integration-tests-aws2/*/src/main/resources/application.properties</include> + <include>integration-test-groups/*/*/src/main/resources/application.properties</include> </includes> </removeEmptyApplicationProperties> <mergePoms> <mergePom> <sourcePoms> - <directory>${basedir}/integration-tests-aws2</directory> + <directory>${basedir}/integration-test-groups/aws2</directory> <includes> <include>*/pom.xml</include> </includes> </sourcePoms> <destinationPom>${basedir}/integration-tests/aws2-grouped/pom.xml</destinationPom> </mergePom> + <mergePom> + <sourcePoms> + <directory>${basedir}/integration-test-groups/azure</directory> + <includes> + <include>*/pom.xml</include> + </includes> + </sourcePoms> + <destinationPom>${basedir}/integration-tests/azure-grouped/pom.xml</destinationPom> + </mergePom> </mergePoms> </configuration> </execution> diff --git a/tooling/scripts/group-tests.groovy b/tooling/scripts/group-tests.groovy index 6e1a654..5e01b2d 100644 --- a/tooling/scripts/group-tests.groovy +++ b/tooling/scripts/group-tests.groovy @@ -42,19 +42,11 @@ Files.list(sourceDir) .filter {p -> Files.exists(p.resolve('pom.xml'))} .sorted() .forEach {p -> - mergedFiles.each { relPath, sb -> sb.append(p.resolve(relPath).getText('UTF-8') + '\n') } - new AntBuilder().copy(todir: destinationModuleDir.resolve('target/src/main/java')) { - fileset(dir: p.resolve('src/main/java'), includes: "**") - } - new AntBuilder().copy(todir: destinationModuleDir.resolve('target/src/test/java')) { - fileset(dir: p.resolve('src/test/java'), includes: "**") - } - new AntBuilder().copy(todir: destinationModuleDir.resolve('target/classes')) { - fileset(dir: p.resolve('src/main/resources'), includes: "**") - } - new AntBuilder().copy(todir: destinationModuleDir.resolve('target/test-classes')) { - fileset(dir: p.resolve('src/test/resources'), includes: "**") - } + mergedFiles.each { relPath, sb -> (Files.exists(p.resolve(relPath))) ? (sb.append(p.resolve(relPath).getText('UTF-8') + '\n')) : sb } + copyResources(p.resolve('src/main/java'), destinationModuleDir.resolve('target/src/main/java')) + copyResources(p.resolve('src/test/java'), destinationModuleDir.resolve('target/src/test/java')) + copyResources(p.resolve('src/main/resources'), destinationModuleDir.resolve('target/classes')) + copyResources(p.resolve('src/test/resources'), destinationModuleDir.resolve('target/test-classes')) } mergedFiles.each { relPath, sb -> @@ -64,3 +56,10 @@ mergedFiles.each { relPath, sb -> Files.write(destPath, sb.toString().getBytes('UTF-8')) } +static void copyResources(Path source, Path dest) { + if (Files.exists(source)) { + new AntBuilder().copy(todir: dest) { + fileset(dir: source, includes: "**") + } + } +} diff --git a/tooling/scripts/test-categories.yaml b/tooling/scripts/test-categories.yaml index 5c9c3ab..1ad7109 100644 --- a/tooling/scripts/test-categories.yaml +++ b/tooling/scripts/test-categories.yaml @@ -119,9 +119,7 @@ dozer-social-azure: - master - syndication - zendesk - - azure-storage-blob - - azure-storage-queue - - azure-eventhubs + - azure-grouped messaging-networking1: - activemq - amqp