Skip to content

Commit

Permalink
change healthcheck, switch database to default created (sample), add …
Browse files Browse the repository at this point in the history
…thread sleep
  • Loading branch information
iNikitaGricenko committed Mar 26, 2024
1 parent 356b4f7 commit b1b8193
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 11 deletions.
6 changes: 3 additions & 3 deletions docker-compose-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ services:
volumes:
- /Docker:/database
healthcheck:
test: /opt/ibm/db2/V11.5/bin/db2 CONNECT TO $$DBNAME
interval: 5s
test: /opt/ibm/db2/V11.5/bin/db2 CONNECT TO sample
interval: 15s
timeout: 240s
start_period: 240s
start_period: 120s

oracle:
image: wnameless/oracle-xe-11g-r2
Expand Down
4 changes: 2 additions & 2 deletions environment_db2
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
LICENSE=accept
DB2INSTANCE=db2inst1
DB2INST1_PASSWORD=password
DBNAME=testdb
DBNAME=sample
BLU=false
ENABLE_ORACLE_COMPATIBILITY=false
UPDATEAVAIL=NO
TO_CREATE_SAMPLEDB=false
TO_CREATE_SAMPLEDB=true
REPODB=false
IS_OSXFS=false
PERSISTENT_HOME=true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,22 @@

import io.kestra.plugin.jdbc.AbstractJdbcDriverTest;
import io.micronaut.test.extensions.junit5.annotation.MicronautTest;
import org.junit.jupiter.api.BeforeAll;

import java.sql.Driver;

@MicronautTest
public class Db2DriverTest extends AbstractJdbcDriverTest {

@BeforeAll
static void initWait() {
try {
Thread.sleep(31000);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}

@Override
protected Class<? extends Driver> getDriverClass() {
return com.ibm.db2.jcc.DB2Driver.class;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
import io.kestra.plugin.jdbc.AbstractJdbcQuery;
import io.kestra.plugin.jdbc.AbstractRdbmsTest;
import io.micronaut.test.extensions.junit5.annotation.MicronautTest;
import lombok.SneakyThrows;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import java.io.FileNotFoundException;
Expand All @@ -24,6 +22,15 @@
@MicronautTest
public class Db2Test extends AbstractRdbmsTest {

@BeforeAll
static void initWait() {
try {
Thread.sleep(31000);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}

@Test
void checkInitiation() throws Exception {
RunContext runContext = runContextFactory.of(ImmutableMap.of());
Expand Down Expand Up @@ -146,7 +153,7 @@ void updateBlob() throws Exception {

@Override
protected String getUrl() {
return "jdbc:db2://localhost:50010/testdb";
return "jdbc:db2://localhost:50010/sample";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@
@MicronautTest
class Db2TriggerTest extends AbstractJdbcTriggerTest {

@BeforeAll
static void initWait() {
try {
Thread.sleep(31000);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}

@Test
void run() throws Exception {
var execution = triggerFlow(this.getClass().getClassLoader(), "flows","db2-listen");
Expand All @@ -27,7 +36,7 @@ void run() throws Exception {

@Override
protected String getUrl() {
return "jdbc:db2://localhost:50010/testdb";
return "jdbc:db2://localhost:50010/sample";
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion plugin-jdbc-db2/src/test/resources/flows/db2-listen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace: io.kestra.tests
triggers:
- id: watch
type: io.kestra.plugin.jdbc.db2.Trigger
url: jdbc:db2://localhost:50010/testdb
url: jdbc:db2://localhost:50010/sample
username: db2inst1
password: password
sql: select * from db2_types
Expand Down
2 changes: 1 addition & 1 deletion plugin-jdbc-db2/src/test/resources/flows/read_db2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace: io.kestra.jdbc.db2
tasks:
- id: read
type: io.kestra.plugin.jdbc.db2.Query
url: jdbc:db2://localhost:50010/testdb
url: jdbc:db2://localhost:50010/sample
username: db2inst1
password: password
sql: select * from db2_types
Expand Down

0 comments on commit b1b8193

Please sign in to comment.