Skip to content

Commit

Permalink
Merge pull request wildfly#18405 from jasondlee/WFLY-19974
Browse files Browse the repository at this point in the history
WFLY-19974 Update Arquillian Testcontainers to 1.0.0.Alpha3
  • Loading branch information
bstansberry authored Nov 27, 2024
2 parents 9ef90d5 + c286d38 commit ea428fe
Show file tree
Hide file tree
Showing 15 changed files with 49 additions and 25 deletions.
7 changes: 7 additions & 0 deletions boms/standard-test-expansion/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,13 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.jboss.arquillian</groupId>
<artifactId>arquillian-testcontainers</artifactId>
<version>${version.org.jboss.arquillian.testcontainers}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.jboss.weld.se</groupId>
<artifactId>weld-se-core</artifactId>
Expand Down
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@
<version.org.javassist>3.29.2-GA</version.org.javassist>
<version.org.jboss.arquillian.core>1.9.1.Final</version.org.jboss.arquillian.core>
<version.org.jboss.arquillian.jakarta>10.0.0.Final</version.org.jboss.arquillian.jakarta>
<version.org.jboss.arquillian.testcontainers>1.0.0.Alpha3</version.org.jboss.arquillian.testcontainers>
<version.org.jboss.byteman>4.0.23</version.org.jboss.byteman>
<version.org.jboss.logmanager.commons-logging-jboss-logmanager>1.0.3.Final</version.org.jboss.logmanager.commons-logging-jboss-logmanager>
<!-- only needed here until wildfly-arquillian has this version properly synced with arquillian itself -->
Expand Down
30 changes: 29 additions & 1 deletion testsuite/integration/microprofile/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,6 @@
<dependency>
<groupId>org.jboss.arquillian</groupId>
<artifactId>arquillian-testcontainers</artifactId>
<version>1.0.0.Alpha1</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down Expand Up @@ -1015,6 +1014,35 @@
</plugins>
</build>
</profile>

<profile>
<id>disable-container-tests</id>
<!--
There is currently no way to identify hosts on which Docker-based tests should not run apart from an
OS check. There are CI updates in the pipeline (see https://issues.redhat.com/browse/WFCI-63 and
https://issues.redhat.com/browse/WFCI-64, for example) that will require this to be modified. Ideally,
a system property or environment variable can be set to indicate that such tests should not be run. For
now, we'll have to live with an OS check, which addresses the immediate need.
-->
<activation>
<os>
<family>Windows</family>
</os>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<systemPropertyVariables>
<org.arquillian.testcontainers.docker.required.exception>org.junit.AssumptionViolatedException</org.arquillian.testcontainers.docker.required.exception>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.junit.Assert;
import org.junit.AssumptionViolatedException;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.wildfly.test.integration.microprofile.faulttolerance.micrometer.deployment.FaultTolerantApplication;
Expand All @@ -46,7 +45,7 @@
*/
@RunWith(Arquillian.class)
@ServerSetup(MicrometerSetupTask.class)
@DockerRequired(AssumptionViolatedException.class)
@DockerRequired
public class FaultToleranceMicrometerIntegrationTestCase {

// Let's use a slightly higher number of invocations, so we can at times differentiate between stale read and other problems
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.junit.AssumptionViolatedException;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.wildfly.test.integration.microprofile.faulttolerance.micrometer.FaultToleranceMicrometerIntegrationTestCase;
Expand All @@ -38,7 +37,7 @@
@RunWith(Arquillian.class)
@RunAsClient
@ServerSetup(MicrometerSetupTask.class)
@DockerRequired(AssumptionViolatedException.class)
@DockerRequired
public class MultipleDeploymentMetricsTestCase {

public static final String DEPLOYMENT_1 = "deployment-1";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,14 @@
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.junit.Assert;
import org.junit.AssumptionViolatedException;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.wildfly.test.integration.observability.opentelemetry.application.JaxRsActivator;


@RunWith(Arquillian.class)
@ServerSetup(MicrometerSetupTask.class)
@DockerRequired(AssumptionViolatedException.class)
@DockerRequired
public class BasicMicrometerTestCase {
@Inject
private MeterRegistry meterRegistry;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,14 @@
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.junit.Assert;
import org.junit.AssumptionViolatedException;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.wildfly.test.integration.observability.opentelemetry.application.JaxRsActivator;

@RunWith(Arquillian.class)
@ServerSetup(MicrometerSetupTask.class)
@DockerRequired(AssumptionViolatedException.class)
@DockerRequired
@RunAsClient
public class MicrometerOtelIntegrationTestCase {
public static final int REQUEST_COUNT = 5;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@
import org.jboss.as.test.shared.observability.setuptasks.MicrometerSetupTask;
import org.jboss.as.test.shared.observability.signals.PrometheusMetric;
import org.junit.Assert;
import org.junit.AssumptionViolatedException;
import org.junit.runner.RunWith;

@RunWith(Arquillian.class)
@ServerSetup(MicrometerSetupTask.class)
@DockerRequired(AssumptionViolatedException.class)
@DockerRequired
@RunAsClient
public abstract class BaseMultipleTestCase {
protected static final String SERVICE_ONE = "service-one";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,12 @@
import org.jboss.as.test.shared.observability.setuptasks.OpenTelemetrySetupTask;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.junit.Assert;
import org.junit.AssumptionViolatedException;
import org.junit.Test;
import org.junit.runner.RunWith;

@RunWith(Arquillian.class)
@ServerSetup(OpenTelemetrySetupTask.class)
@DockerRequired(AssumptionViolatedException.class)
@DockerRequired
public class BasicOpenTelemetryTestCase extends BaseOpenTelemetryTest {
@Inject
private Tracer tracer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import org.jboss.as.test.shared.observability.signals.jaeger.JaegerTrace;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.junit.Assert;
import org.junit.AssumptionViolatedException;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.wildfly.test.integration.observability.opentelemetry.application.OtelService2;
Expand All @@ -38,7 +37,7 @@
@RunWith(Arquillian.class)
@RunAsClient
@ServerSetup({OpenTelemetrySetupTask.class})
@DockerRequired(AssumptionViolatedException.class)
@DockerRequired
public class ContextPropagationTestCase extends BaseOpenTelemetryTest {
@Testcontainer
private OpenTelemetryCollectorContainer otelCollector;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,14 @@
import org.jboss.as.test.shared.observability.signals.jaeger.JaegerTrace;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.junit.Assert;
import org.junit.AssumptionViolatedException;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.wildfly.test.integration.observability.setuptask.ServiceNameSetupTask;

@RunWith(Arquillian.class)
@ServerSetup({OpenTelemetrySetupTask.class, ServiceNameSetupTask.class})
@RunAsClient
@DockerRequired(AssumptionViolatedException.class)
@DockerRequired
public class OpenTelemetryIntegrationTestCase extends BaseOpenTelemetryTest {
@Testcontainer
private OpenTelemetryCollectorContainer otelCollector;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,14 @@
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.junit.Assert;
import org.junit.AssumptionViolatedException;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.wildfly.test.preview.microprofile.telemetry.application.JaxRsActivator;
import org.wildfly.test.preview.microprofile.telemetry.application.MetricResource;

@RunWith(Arquillian.class)
@ServerSetup(OpenTelemetrySetupTask.class)
@DockerRequired(AssumptionViolatedException.class)
@DockerRequired
@RunAsClient
public class MetricsTestCase {
public static final int REQUEST_COUNT = 5;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@
import java.util.List;

import org.jboss.arquillian.testcontainers.api.DockerRequired;
import org.junit.AssumptionViolatedException;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.Network;
import org.testcontainers.utility.DockerImageName;

@DockerRequired(AssumptionViolatedException.class)
@DockerRequired
public abstract class BaseContainer<SELF extends GenericContainer<SELF>> extends GenericContainer<SELF> {
private final String containerName;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@
import org.jboss.as.test.shared.ServerReload;
import org.jboss.as.test.shared.observability.containers.OpenTelemetryCollectorContainer;
import org.jboss.dmr.ModelNode;
import org.junit.AssumptionViolatedException;

/**
* Sets up a functioning Micrometer subsystem configuration. Requires functioning Docker environment! Tests using this
* are expected to call AssumeTestGroupUtil.assumeDockerAvailable(); in a @BeforeClass.
*/
@DockerRequired(AssumptionViolatedException.class)
@DockerRequired
public class MicrometerSetupTask extends AbstractSetupTask {
private static final ModelNode micrometerExtension = Operations.createAddress("extension", "org.wildfly.extension.micrometer");
private static final ModelNode micrometerSubsystem = Operations.createAddress("subsystem", "micrometer");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@
import org.jboss.as.test.shared.ServerReload;
import org.jboss.as.test.shared.observability.containers.OpenTelemetryCollectorContainer;
import org.jboss.dmr.ModelNode;
import org.junit.AssumptionViolatedException;

@DockerRequired(AssumptionViolatedException.class)
@DockerRequired
public class OpenTelemetrySetupTask extends AbstractSetupTask {
private static final String SUBSYSTEM_NAME = "opentelemetry";
private static final ModelNode extensionAddress = Operations.createAddress("extension", "org.wildfly.extension.opentelemetry");
Expand Down

0 comments on commit ea428fe

Please sign in to comment.