diff --git a/.ci/openshift-ci/build-root/e2e-test-prod.sh b/.ci/openshift-ci/build-root/e2e-test-prod.sh index 7cfc35f9c..d93c134ea 100644 --- a/.ci/openshift-ci/build-root/e2e-test-prod.sh +++ b/.ci/openshift-ci/build-root/e2e-test-prod.sh @@ -94,8 +94,8 @@ EOL cat test.properties mkdir local-repo-prod -mvn clean install -Dmaven.repo.local=./local-repo-prod -DskipTests -Pwildfly-deployments-build.eap -mvn test -Dmaven.repo.local=./local-repo-prod -pl testsuite/integration-tests -Pts.prod \ +mvn clean install -Dmaven.repo.local=./local-repo-prod -DskipTests -Pts.wildfly.target-distribution.eap +mvn test -Dmaven.repo.local=./local-repo-prod -pl testsuite/integration-tests -Pts.execution-profile.prod,ts.wildfly.target-distribution.eap \ -Dintersmash.wildfly.image=registry.redhat.io/jboss-eap-8-tech-preview/eap8-openjdk17-builder-openshift-rhel8:1.0.0.Beta \ -Dintersmash.wildfly.runtime.image=registry.redhat.io/jboss-eap-8-tech-preview/eap8-openjdk17-runtime-openshift-rhel8:1.0.0.Beta \ -Dintersmash.wildfly.operators.catalog_source=redhat-operators \ diff --git a/.ci/openshift-ci/build-root/e2e-test.sh b/.ci/openshift-ci/build-root/e2e-test.sh index 2bee5cfd7..47e118980 100644 --- a/.ci/openshift-ci/build-root/e2e-test.sh +++ b/.ci/openshift-ci/build-root/e2e-test.sh @@ -90,4 +90,4 @@ cat test.properties mkdir local-repo-community mvn clean install -Dmaven.repo.local=./local-repo-community -DskipTests -mvn test -Dmaven.repo.local=./local-repo-community -pl testsuite/integration-tests -Pts.community +mvn test -Dmaven.repo.local=./local-repo-community -pl testsuite/integration-tests -Pts.execution-profile.community diff --git a/README.md b/README.md index 2b26cbcd2..7c0d4cb59 100644 --- a/README.md +++ b/README.md @@ -110,22 +110,22 @@ public class PostgresqlApplication implements PostgreSQLTemplateOpenShiftApplica mvn clean install -DskipTests ``` -* By building with the `wildfly-deployments-build.eap` profile, the WildFly deployments will instead be built by using productised bits configuration: +* By building with the `ts.wildfly.target-distribution.eap` profile, the WildFly deployments will instead be built by using productised bits configuration: ```shell -mvn clean install -DskipTests -Pwildfly-deployments-build.eap +mvn clean install -DskipTests -Pts.wildfly.target-distribution.eap ``` ## Running the Intersmash test suite * Run the testsuite against community deliverables, e.g.: Keycloak operator or WildFly images: ```shell -mvn test -pl testsuite/ -Pts.community +mvn test -pl testsuite/ -Pts.execution-profile.community ``` This is usually executed to test community images, deliverables and - for application servers like WildFly - deployments built from community artifacts. * Run the testsuite against productised deliverables, e.g.: Red Hat Single Sign On operator or JBoss EAP images: ```shell -mvn test -pl testsuite/ -Pts.prod +mvn test -pl testsuite/ -Pts.execution-profile.prod ``` This is usually executed to test productised images, deliverables and - for application servers like JBoss EAP - deployments built from community artifacts. diff --git a/testsuite/deployments/deployments-provider/pom.xml b/testsuite/deployments/deployments-provider/pom.xml index 746b2a1f4..d652cd26f 100644 --- a/testsuite/deployments/deployments-provider/pom.xml +++ b/testsuite/deployments/deployments-provider/pom.xml @@ -75,7 +75,7 @@ - wildfly-deployments-build.eap + ts.wildfly.target-distribution.eap diff --git a/testsuite/deployments/openshift-jakarta-sample-standalone/pom.xml b/testsuite/deployments/openshift-jakarta-sample-standalone/pom.xml index 8a751ad6d..d1b71ccde 100644 --- a/testsuite/deployments/openshift-jakarta-sample-standalone/pom.xml +++ b/testsuite/deployments/openshift-jakarta-sample-standalone/pom.xml @@ -199,7 +199,7 @@ - wildfly-deployments-build.eap + ts.wildfly.target-distribution.eap org.jboss.eap.plugins @@ -271,7 +271,7 @@ - wildfly-deployments-build.eap8 + ts.wildfly.target-distribution.eap8 org.jboss.eap.channels diff --git a/testsuite/deployments/wildfly-shared/pom.xml b/testsuite/deployments/wildfly-shared/pom.xml index 4c21e1a11..a5743ef44 100644 --- a/testsuite/deployments/wildfly-shared/pom.xml +++ b/testsuite/deployments/wildfly-shared/pom.xml @@ -129,7 +129,7 @@ - wildfly-deployments-build.eap + ts.wildfly.target-distribution.eap org.jboss.eap.plugins @@ -239,7 +239,7 @@ - wildfly-deployments-build.eap8 + ts.wildfly.target-distribution.eap8 org.jboss.eap.channels @@ -331,8 +331,10 @@ - wildfly-deployments-build.eapxp - + ts.wildfly.target-distribution.eapxp + diff --git a/testsuite/integration-tests/pom.xml b/testsuite/integration-tests/pom.xml index 3f9501597..58664a794 100644 --- a/testsuite/integration-tests/pom.xml +++ b/testsuite/integration-tests/pom.xml @@ -20,6 +20,10 @@ community images and deliverables --> community + + ts.not-for-community + + ts.no-test-excluded.default @@ -61,48 +65,34 @@ true + + + org.apache.maven.plugins + maven-surefire-plugin + + ${intersmash.test.excludedGroups.by.execution-profile},${intersmash.test.excludedGroups.by.wildfly-target-distribution} + + + - ts.prod + ts.execution-profile.prod prod - ts.not-for-prod + ts.not-for-prod - - - - org.apache.maven.plugins - maven-surefire-plugin - - ${intersmash.test.execution.excludedGroups} - - - - - ts.community + ts.wildfly.target-distribution.eap - - community - - ts.not-for-community + + ts.wildfly.requires-bootable-jar - - - - org.apache.maven.plugins - maven-surefire-plugin - - ${intersmash.test.execution.excludedGroups} - - - - diff --git a/testsuite/integration-tests/src/main/java/org/jboss/intersmash/testsuite/junit5/categories/wildfly/RequiresBootableJarDistribution.java b/testsuite/integration-tests/src/main/java/org/jboss/intersmash/testsuite/junit5/categories/wildfly/RequiresBootableJarDistribution.java new file mode 100644 index 000000000..c32cf4f78 --- /dev/null +++ b/testsuite/integration-tests/src/main/java/org/jboss/intersmash/testsuite/junit5/categories/wildfly/RequiresBootableJarDistribution.java @@ -0,0 +1,33 @@ +/** + * Copyright (C) 2023 Red Hat, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jboss.intersmash.testsuite.junit5.categories.wildfly; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import org.junit.jupiter.api.Tag; + +/** + * Mark a test that requires a WildFly Bootable JAR capable distribution, i.e. either WildFly itself or JBoss EAP XP. + * Used per class. + */ +@Tag("ts.wildfly.requires-bootable-jar") +@Retention(RetentionPolicy.RUNTIME) +@Target({ ElementType.TYPE, ElementType.METHOD }) +public @interface RequiresBootableJarDistribution { +} diff --git a/testsuite/integration-tests/src/test/java/org/jboss/intersmash/testsuite/provision/openshift/Eap7BootableJarTestCase.java b/testsuite/integration-tests/src/test/java/org/jboss/intersmash/testsuite/provision/openshift/Eap7BootableJarTestCase.java index 5433a783c..c940e3e6f 100644 --- a/testsuite/integration-tests/src/test/java/org/jboss/intersmash/testsuite/provision/openshift/Eap7BootableJarTestCase.java +++ b/testsuite/integration-tests/src/test/java/org/jboss/intersmash/testsuite/provision/openshift/Eap7BootableJarTestCase.java @@ -20,6 +20,7 @@ import org.jboss.intersmash.provision.openshift.BootableJarImageOpenShiftProvisioner; import org.jboss.intersmash.provision.openshift.WildflyBootableJarImageOpenShiftProvisioner; import org.jboss.intersmash.testsuite.junit5.categories.NotForCommunityExecutionProfile; +import org.jboss.intersmash.testsuite.junit5.categories.wildfly.RequiresBootableJarDistribution; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; @@ -31,6 +32,7 @@ @CleanBeforeAll @NotForCommunityExecutionProfile +@RequiresBootableJarDistribution public class Eap7BootableJarTestCase { private static final OpenShift openShift = OpenShifts.master(); private static final BootableJarOpenShiftApplication application = OpenShiftProvisionerTestBase diff --git a/testsuite/integration-tests/src/test/java/org/jboss/intersmash/testsuite/provision/openshift/OpenShiftProvisionerTestBase.java b/testsuite/integration-tests/src/test/java/org/jboss/intersmash/testsuite/provision/openshift/OpenShiftProvisionerTestBase.java index 299809146..0860dd54e 100644 --- a/testsuite/integration-tests/src/test/java/org/jboss/intersmash/testsuite/provision/openshift/OpenShiftProvisionerTestBase.java +++ b/testsuite/integration-tests/src/test/java/org/jboss/intersmash/testsuite/provision/openshift/OpenShiftProvisionerTestBase.java @@ -320,7 +320,7 @@ public List getEnvVars() { // let's pass the profile for building the deployment too... mavenAdditionalArgs = mavenAdditionalArgs.concat( (Strings.isNullOrEmpty(TestDeploymentProperties.getWildflyDeploymentsBuildProfile()) ? "" - : " -Pwildfly-deployments-build." + : " -Pts.wildfly.target-distribution." + TestDeploymentProperties.getWildflyDeploymentsBuildProfile())); list.add(new EnvVarBuilder().withName("MAVEN_ARGS_APPEND").withValue(mavenAdditionalArgs).build()); list.add(new EnvVarBuilder().withName("ARTIFACT_DIR").withValue(deploymentRelativePath + "target").build()); @@ -382,7 +382,7 @@ public List getEnvVars() { // let's pass the profile for building the deployment too... mavenAdditionalArgs = mavenAdditionalArgs.concat( (Strings.isNullOrEmpty(TestDeploymentProperties.getWildflyDeploymentsBuildProfile()) ? "" - : " -Pwildfly-deployments-build." + : " -Pts.wildfly.target-distribution." + TestDeploymentProperties.getWildflyDeploymentsBuildProfile())); if (!Strings.isNullOrEmpty(mavenAdditionalArgs)) { list.add(new EnvVarBuilder().withName("MAVEN_ARGS_APPEND").withValue(mavenAdditionalArgs).build()); diff --git a/testsuite/integration-tests/src/test/java/org/jboss/intersmash/testsuite/provision/openshift/WildflyBootableJarTestCase.java b/testsuite/integration-tests/src/test/java/org/jboss/intersmash/testsuite/provision/openshift/WildflyBootableJarTestCase.java index 3c8fbdc76..be58ebac1 100644 --- a/testsuite/integration-tests/src/test/java/org/jboss/intersmash/testsuite/provision/openshift/WildflyBootableJarTestCase.java +++ b/testsuite/integration-tests/src/test/java/org/jboss/intersmash/testsuite/provision/openshift/WildflyBootableJarTestCase.java @@ -20,6 +20,7 @@ import org.jboss.intersmash.provision.openshift.BootableJarImageOpenShiftProvisioner; import org.jboss.intersmash.provision.openshift.WildflyBootableJarImageOpenShiftProvisioner; import org.jboss.intersmash.testsuite.junit5.categories.NotForProductizedExecutionProfile; +import org.jboss.intersmash.testsuite.junit5.categories.wildfly.RequiresBootableJarDistribution; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; @@ -31,6 +32,7 @@ @CleanBeforeAll @NotForProductizedExecutionProfile +@RequiresBootableJarDistribution public class WildflyBootableJarTestCase { private static final OpenShift openShift = OpenShifts.master(); private static final BootableJarOpenShiftApplication application = OpenShiftProvisionerTestBase diff --git a/testsuite/integration-tests/src/test/java/org/jboss/intersmash/testsuite/provision/openshift/WildflyHelmChartOpenShiftExampleApplication.java b/testsuite/integration-tests/src/test/java/org/jboss/intersmash/testsuite/provision/openshift/WildflyHelmChartOpenShiftExampleApplication.java index 169c2d23d..0f353e983 100644 --- a/testsuite/integration-tests/src/test/java/org/jboss/intersmash/testsuite/provision/openshift/WildflyHelmChartOpenShiftExampleApplication.java +++ b/testsuite/integration-tests/src/test/java/org/jboss/intersmash/testsuite/provision/openshift/WildflyHelmChartOpenShiftExampleApplication.java @@ -58,7 +58,7 @@ private HelmChartRelease loadRelease(final WildflyHelmChartRelease release) { // let's pass the profile for building the deployment too... mavenAdditionalArgs = mavenAdditionalArgs.concat( (Strings.isNullOrEmpty(TestDeploymentProperties.getWildflyDeploymentsBuildProfile()) ? "" - : " -Pwildfly-deployments-build." + : " -Pts.wildfly.target-distribution." + TestDeploymentProperties.getWildflyDeploymentsBuildProfile())); // ok, let's configure the release via the WildflyHelmChartRelease fluent(-ish) API, // which offers a common reference for both WildFly and EAP (latest) diff --git a/testsuite/integration-tests/src/test/resources/org/jboss/intersmash/testsuite/provision/openshift/eap8-helm-values.yaml b/testsuite/integration-tests/src/test/resources/org/jboss/intersmash/testsuite/provision/openshift/eap8-helm-values.yaml index ccac1acc7..8b98b768e 100644 --- a/testsuite/integration-tests/src/test/resources/org/jboss/intersmash/testsuite/provision/openshift/eap8-helm-values.yaml +++ b/testsuite/integration-tests/src/test/resources/org/jboss/intersmash/testsuite/provision/openshift/eap8-helm-values.yaml @@ -5,7 +5,7 @@ build: contextDir: "deployments/openshift-jakarta-sample-standalone" env: - name: "MAVEN_ARGS_APPEND" - value: "-Denforcer.skip=true -Pwildfly-deployments-build.eap" + value: "-Denforcer.skip=true -Pts.wildfly.target-distribution.eap" s2i: kind: "DockerImage" buildApplicationImage: true