Skip to content

Commit

Permalink
Enable OracleOpenTelemetryJdbcInstrumentationTest
Browse files Browse the repository at this point in the history
  • Loading branch information
navinyashende committed Oct 3, 2023
1 parent 7417dc3 commit e2abce6
Show file tree
Hide file tree
Showing 4 changed files with 136 additions and 0 deletions.
81 changes: 81 additions & 0 deletions integration-tests/opentelemetry-jdbc-instrumentation/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -326,5 +326,86 @@
</plugins>
</build>
</profile>
<profile>
<id>test-jdbc-instrumentation-docker-oracle</id>
<activation>
<property>
<name>start-containers</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<configuration>
<images>
<image>
<name>${oracle.image}</name>
<run>
<ports>
<port>1521:1521</port>
</ports>
<env>
<ORACLE_PASSWORD>quarkus</ORACLE_PASSWORD>
</env>
<log>
<prefix>Oracle Database: </prefix>
<date>default</date>
<color>red</color>
</log>
<wait>
<!-- good docs found at: https://dmp.fabric8.io/#build-healthcheck -->
<!-- Unfortunately booting this is slow, needs to set a generous timeout: -->
<time>60000</time>
<!-- leverage the healthcheck in the image we use -->
<healthy>yes</healthy>
<!-- In case of any issues with the built-in healthcheck we can revert back to the original log check:-->
<!--<log>DATABASE IS READY TO USE!</log>-->
</wait>
</run>
</image>
</images>
<!--Stops all Oracle DB images currently running, not just those we just started.
Useful to stop processes still running from a previously failed integration test run -->
<allContainers>true</allContainers>
</configuration>
<executions>
<execution>
<id>docker-start</id>
<phase>compile</phase>
<goals>
<goal>stop</goal>
<goal>start</goal>
</goals>
</execution>
<execution>
<id>docker-stop</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<id>docker-prune</id>
<phase>generate-resources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>${docker-prune.location}</executable>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package io.quarkus.it.opentelemetry;

import java.util.HashMap;
import java.util.Map;

import io.quarkus.test.common.QuarkusTestResourceLifecycleManager;

public class OracleLifecycleManager implements QuarkusTestResourceLifecycleManager {

@Override
public Map<String, String> start() {
Map<String, String> properties = new HashMap<>();
properties.put("quarkus.datasource.oracle.jdbc.url", "jdbc:oracle:thin:@localhost:1521/FREEPDB1");
properties.put("quarkus.datasource.oracle.password", "quarkus");
properties.put("quarkus.datasource.oracle.username", "SYSTEM");
properties.put("quarkus.hibernate-orm.oracle.database.generation", "drop-and-create");
properties.put("quarkus.hibernate-orm.oracle.active", "true");
properties.put("quarkus.hibernate-orm.mariadb.active", "false");
properties.put("quarkus.hibernate-orm.postgresql.active", "false");
properties.put("quarkus.hibernate-orm.db2.active", "false");

return properties;
}

@Override
public void stop() {
// EMPTY
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package io.quarkus.it.opentelemetry;

import io.quarkus.test.junit.QuarkusIntegrationTest;

@QuarkusIntegrationTest
public class OracleOpenTelemetryJdbcInstrumentationIT extends OracleOpenTelemetryJdbcInstrumentationTest {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package io.quarkus.it.opentelemetry;

import org.junit.jupiter.api.Test;

import io.quarkus.test.common.QuarkusTestResource;
import io.quarkus.test.junit.QuarkusTest;

@QuarkusTest
@QuarkusTestResource(value = OracleLifecycleManager.class, restrictToAnnotatedClass = true)
public class OracleOpenTelemetryJdbcInstrumentationTest extends OpenTelemetryJdbcInstrumentationTest {

@Test
void testOracleQueryTraced() {
testQueryTraced("oracle", "OracleHit");
}

}

0 comments on commit e2abce6

Please sign in to comment.