Skip to content

Commit

Permalink
DB2 integration test re-enable (#559)
Browse files Browse the repository at this point in the history
* DB2 has a jdbc driver in maven repository
* Re-enable db2 integration tests
  • Loading branch information
gmokki authored Jul 24, 2022
1 parent 074bb14 commit 095691c
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 64 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
strategy:
matrix:
java: [ '11', '17' ]
db: [ 'h2', 'mariadb', 'postgresql', 'mysql', 'sqlserver', 'oracle' ]
db: [ 'h2', 'mariadb', 'postgresql', 'mysql', 'sqlserver', 'db2', 'oracle' ]
runs-on: ubuntu-latest
env:
SPRING_PROFILES_ACTIVE: nflow.db.${{ matrix.db }}
Expand Down
19 changes: 0 additions & 19 deletions nflow-jetty/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -145,23 +145,4 @@
<scope>test</scope>
</dependency>
</dependencies>
<profiles>
<profile>
<id>db2</id>
<activation>
<file>
<exists>${basedir}/../db2jcc4.jar</exists>
</file>
</activation>
<dependencies>
<dependency>
<groupId>com.ibm.db2</groupId>
<artifactId>db2jcc4</artifactId>
<version>4.24.92</version>
<scope>system</scope>
<systemPath>${basedir}/../db2jcc4.jar</systemPath>
</dependency>
</dependencies>
</profile>
</profiles>
</project>
19 changes: 0 additions & 19 deletions nflow-netty/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,23 +77,4 @@
<scope>test</scope>
</dependency>
</dependencies>
<profiles>
<profile>
<id>db2</id>
<activation>
<file>
<exists>${basedir}/../db2jcc4.jar</exists>
</file>
</activation>
<dependencies>
<dependency>
<groupId>com.ibm.db2</groupId>
<artifactId>db2jcc4</artifactId>
<version>4.24.92</version>
<scope>system</scope>
<systemPath>${basedir}/../db2jcc4.jar</systemPath>
</dependency>
</dependencies>
</profile>
</profiles>
</project>
23 changes: 4 additions & 19 deletions nflow-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@
<groupId>com.oracle.database.jdbc</groupId>
<artifactId>ojdbc11</artifactId>
</dependency>
<dependency>
<groupId>com.ibm.db2</groupId>
<artifactId>jcc</artifactId>
</dependency>
</dependencies>
<repositories>
<repository>
Expand All @@ -79,25 +83,6 @@
<url>https://public.nexus.pentaho.org/content/groups/omni/</url>
</repository>
</repositories>
<profiles>
<profile>
<id>db2</id>
<activation>
<file>
<exists>${basedir}/../db2jcc4.jar</exists>
</file>
</activation>
<dependencies>
<dependency>
<groupId>com.ibm.db2</groupId>
<artifactId>db2jcc4</artifactId>
<version>4.24.92</version>
<scope>system</scope>
<systemPath>${basedir}/../db2jcc4.jar</systemPath>
</dependency>
</dependencies>
</profile>
</profiles>
<build>
<plugins>
<plugin>
Expand Down
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
<commons.lang3.version>3.12.0</commons.lang3.version>
<core-utils.version>1.4</core-utils.version>
<coveralls.version>4.3.0</coveralls.version>
<db2-jcc.version>11.5.7.0</db2-jcc.version>
<el.version>3.0.0</el.version>
<frontend-maven.version>1.12.1</frontend-maven.version>
<guice.version>5.1.0</guice.version>
Expand Down Expand Up @@ -778,6 +779,11 @@
<artifactId>ojdbc11</artifactId>
<version>${ojdbc.version}</version>
</dependency>
<dependency>
<groupId>com.ibm.db2</groupId>
<artifactId>jcc</artifactId>
<version>${db2-jcc.version}</version>
</dependency>
<!-- misc -->
<dependency>
<groupId>org.apache.commons</groupId>
Expand Down
7 changes: 1 addition & 6 deletions scripts/setup-db-db2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ case $DB_VERSION in
;;
esac

$tool run --pull=always --rm --name db2 --entrypoint /bin/sh ibmcom/db2:$DB_VERSION -c "cat /opt/ibm/db2/V*/java/db2jcc4.jar" > db2jcc4.jar

$tool run --rm --name db2 --cap-add IPC_LOCK --cap-add IPC_OWNER -e 'instance_name=root' -e 'DB2INST1_PASSWORD=nflow' -e 'LICENSE=accept' -e 'DBNAME=nflow' --publish 50000:50000 --detach ibmcom/db2:$DB_VERSION db2start
$tool run --pull=always --rm --name db2 --cap-add IPC_LOCK --cap-add IPC_OWNER -e PERSISTENT_HOME=false -e DB2INST1_PASSWORD=nflow -e LICENSE=accept -e DBNAME=nflow -e ARCHIVE_LOGS=false --publish 50000:50000 --detach ibmcom/db2:$DB_VERSION

fgrep -m1 'Setup has completed' <(timeout 240 $tool logs -f db2)

#$tool exec -it db2 su - db2inst1 -c '/opt/ibm/db2/V*/bin/db2 -tvs "CREATE DATABASE nflow USING CODESET UTF-8 TERRITORY us;"'
#$tool exec -it db2 su - db2inst1 -c '/opt/ibm/db2/V*/bin/db2 -tvs "ACTIVATE DATABASE nflow;"'

0 comments on commit 095691c

Please sign in to comment.