Skip to content

Commit

Permalink
[issue 113] - Renaming a profile to better match test related ones, a…
Browse files Browse the repository at this point in the history
…nd excluding Bootable JAR tests when testing EAP
  • Loading branch information
fabiobrz committed Jan 19, 2024
1 parent e9c5460 commit 0dcb844
Show file tree
Hide file tree
Showing 15 changed files with 77 additions and 64 deletions.
4 changes: 2 additions & 2 deletions .ci/openshift-ci/build-root/e2e-test-prod.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion .ci/openshift-ci/build-root/e2e-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion testsuite/deployments/deployments-provider/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@

<profiles>
<profile>
<id>wildfly-deployments-build.eap</id>
<id>ts.wildfly.target-distribution.eap</id>
<properties>
<!--
When this profile is active, the following property is set to have it available at runtime,
Expand Down
16 changes: 0 additions & 16 deletions testsuite/deployments/eap7-shared/eap7-bootable-jar/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,22 +51,6 @@
</dependencies>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-jar-maven-plugin</artifactId>
<version>${version.wildfly-jar-maven-plugin}</version>
<configuration>
<feature-packs>
<feature-pack>
<location>${eap7.xp-feature-pack.location}</location>
</feature-pack>
</feature-packs>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.wildfly.plugins</groupId>
Expand Down
2 changes: 1 addition & 1 deletion testsuite/deployments/eap7-shared/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@

<profiles>
<profile>
<id>wildfly-deployments-build.eap</id>
<id>ts.wildfly.target-distribution.eap</id>
<build>
<plugins>
<!-- Disable the Bootable JAR plugin when testing EAP -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@

<profiles>
<profile>
<id>wildfly-deployments-build.eap</id>
<id>ts.wildfly.target-distribution.eap</id>
<properties>
<!-- WildFly/EAP 8 Maven Plugin coordinates -->
<wildfly-maven-plugin.groupId>org.jboss.eap.plugins</wildfly-maven-plugin.groupId>
Expand Down Expand Up @@ -271,7 +271,7 @@
</build>
</profile>
<profile>
<id>wildfly-deployments-build.eap8</id>
<id>ts.wildfly.target-distribution.eap8</id>
<properties>
<!-- EAP 8 Channel coordinates -->
<wildfly.ee-channel.groupId>org.jboss.eap.channels</wildfly.ee-channel.groupId>
Expand Down
10 changes: 6 additions & 4 deletions testsuite/deployments/wildfly-shared/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@

<profiles>
<profile>
<id>wildfly-deployments-build.eap</id>
<id>ts.wildfly.target-distribution.eap</id>
<properties>
<!-- WildFly/EAP 8 Maven Plugin coordinates -->
<wildfly-maven-plugin.groupId>org.jboss.eap.plugins</wildfly-maven-plugin.groupId>
Expand Down Expand Up @@ -239,7 +239,7 @@
</profile>

<profile>
<id>wildfly-deployments-build.eap8</id>
<id>ts.wildfly.target-distribution.eap8</id>
<properties>
<!-- EAP 8 Channel coordinates -->
<wildfly.ee-channel.groupId>org.jboss.eap.channels</wildfly.ee-channel.groupId>
Expand Down Expand Up @@ -331,8 +331,10 @@

<profile>
<!-- Configuration settings for testing EAP XP -->
<id>wildfly-deployments-build.eapxp</id>
<!-- TODO Currently tested EAP XP is not available yet, and configuration, e.g. the Bootable JAR plugin one - will be needed once it's ready -->
<id>ts.wildfly.target-distribution.eapxp</id>
<!-- TODO Currently tested EAP XP (i.e. EAP XP 5) is not available yet, and configuration, e.g. the
Bootable JAR plugin one - will be needed once it's ready
-->
</profile>

<profile>
Expand Down
48 changes: 19 additions & 29 deletions testsuite/integration-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
community images and deliverables
-->
<intersmash.test.execution.profile>community</intersmash.test.execution.profile>
<!-- And being community oriented, then exclude product specific tests by default -->
<intersmash.test.excludedGroups.by.execution-profile>ts.not-for-community</intersmash.test.excludedGroups.by.execution-profile>
<!-- And being community oriented, no tests are excluded based on WildFly target distribution (e.g.: WildFly can run Bootable JAR tests) -->
<intersmash.test.excludedGroups.by.wildfly-target-distribution>ts.no-test-excluded.default</intersmash.test.excludedGroups.by.wildfly-target-distribution>
</properties>

<dependencies>
Expand Down Expand Up @@ -61,48 +65,34 @@
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration combine.children="append">
<excludedGroups>${intersmash.test.excludedGroups.by.execution-profile},${intersmash.test.excludedGroups.by.wildfly-target-distribution}</excludedGroups>
</configuration>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>ts.prod</id>
<id>ts.execution-profile.prod</id>
<properties>
<!-- Set the intersmash.test.execution.profile property to `prod`, it is read by test classes -->
<intersmash.test.execution.profile>prod</intersmash.test.execution.profile>
<!-- Exclude tests that shouldn't be executed when dealing with products -->
<intersmash.test.execution.excludedGroups>ts.not-for-prod</intersmash.test.execution.excludedGroups>
<intersmash.test.excludedGroups.by.execution-profile>ts.not-for-prod</intersmash.test.excludedGroups.by.execution-profile>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration combine.children="append">
<excludedGroups>${intersmash.test.execution.excludedGroups}</excludedGroups>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>ts.community</id>
<id>ts.wildfly.target-distribution.eap</id>
<properties>
<!-- Set the intersmash.test.execution.profile property to `community`, it is read by test classes -->
<intersmash.test.execution.profile>community</intersmash.test.execution.profile>
<!-- Exclude tests that shouldn't be executed when dealing with community projects -->
<intersmash.test.execution.excludedGroups>ts.not-for-community</intersmash.test.execution.excludedGroups>
<!-- Exclude tests that shouldn't be executed when dealing base EAP, i.e. Bootable Jar tests
(Bootable JAR is only available with WildFLy or EAP XP, ot base EAP) -->
<intersmash.test.excludedGroups.by.wildfly-target-distribution>ts.wildfly.requires-bootable-jar</intersmash.test.excludedGroups.by.wildfly-target-distribution>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration combine.children="append">
<excludedGroups>${intersmash.test.execution.excludedGroups}</excludedGroups>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>

Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -31,6 +32,7 @@

@CleanBeforeAll
@NotForCommunityExecutionProfile
@RequiresBootableJarDistribution
public class Eap7BootableJarTestCase {
private static final OpenShift openShift = OpenShifts.master();
private static final BootableJarOpenShiftApplication application = OpenShiftProvisionerTestBase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ public List<EnvVar> 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());
Expand Down Expand Up @@ -382,7 +382,7 @@ public List<EnvVar> 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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -31,6 +32,7 @@

@CleanBeforeAll
@NotForProductizedExecutionProfile
@RequiresBootableJarDistribution
public class WildflyBootableJarTestCase {
private static final OpenShift openShift = OpenShifts.master();
private static final BootableJarOpenShiftApplication application = OpenShiftProvisionerTestBase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0dcb844

Please sign in to comment.