Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DAT-19145 Basic template to setup Informix #933

Merged
merged 36 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
fb25bfd
DAT-19145 Basic template to setup Informix
rberezen Dec 6, 2024
c842bf1
Added docker config
rberezen Dec 6, 2024
2789879
Added informix to the db matrix
rberezen Dec 6, 2024
cb67719
Added informix to the list of default dbs
rberezen Dec 6, 2024
0633594
More changes
rberezen Dec 6, 2024
eb8cc33
Fixed formatting
rberezen Dec 6, 2024
528a748
Added healthcheck
rberezen Dec 6, 2024
c9e61c7
Reverted src/test/resources/H2/lbcat.mv.db to the state from commit 1…
rberezen Dec 6, 2024
bcf7f2f
Used INIT_FILE: "informix-init.sql"
rberezen Dec 7, 2024
20a22bd
Changed db to testdb
rberezen Dec 7, 2024
19e667d
changed healthcheck
rberezen Dec 7, 2024
4b4ae29
ANother try
rberezen Dec 7, 2024
cfa5467
Added 12 and 14 versions
rberezen Dec 9, 2024
dd9a372
Fixed typo
rberezen Dec 9, 2024
6a93177
Adjusted to run informix docker for v12
rberezen Dec 9, 2024
c940101
Added back v14 docker setup
rberezen Dec 9, 2024
512697b
DAT-19146 fixing informix tests. Some tests are still failing, see pr…
Tamelianovych Dec 11, 2024
f683dba
DAT-19146 removed extra dependency
Tamelianovych Dec 11, 2024
4f57c07
DAT-19146 test volume informix db
Tamelianovych Dec 11, 2024
e2281bd
DAT-19146 test volume informix db
Tamelianovych Dec 11, 2024
1283591
DAT-19146 fixing tests
Tamelianovych Dec 12, 2024
9f26e65
DAT-19146 fixing tests
Tamelianovych Dec 13, 2024
943b1c6
script fix
rberezen Dec 13, 2024
9febbbf
Merge remote-tracking branch 'origin/DAT-19145' into DAT-19146
Tamelianovych Dec 16, 2024
0b4313c
DAT-19146 changes after code review
Tamelianovych Dec 16, 2024
d55db91
DAT-19146 fixing compose file
Tamelianovych Dec 16, 2024
0993242
DAT-19146 fixing script
Tamelianovych Dec 16, 2024
0084fe8
DAT-19146 fixing two tests
Tamelianovych Dec 16, 2024
7efe1e0
DAT-19146 fixing script
Tamelianovych Dec 16, 2024
0568e55
DAT-19146 fixing script
Tamelianovych Dec 16, 2024
44cbaeb
DAT-19146 fixing load data tests
Tamelianovych Dec 16, 2024
91cd699
Merge branch 'main' into DAT-19145
PavloTytarchuk Dec 17, 2024
57d5d9a
Merge branch 'DAT-19145' into DAT-19146
PavloTytarchuk Dec 17, 2024
22375d8
Merge pull request #935 from liquibase/DAT-19146
Tamelianovych Dec 17, 2024
0b8132d
DAT-19146-related adding ticket numbers to info
Tamelianovych Dec 17, 2024
7ae57ce
Merge branch 'main' into DAT-19145
Tamelianovych Dec 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ on:
"hsqldb-2.5",
"firebird-3",
"firebird-4",
"db2-luw"
"db2-luw",
"informix-12.10",
"informix-14.10"
]

jobs:
Expand All @@ -118,7 +120,7 @@ jobs:
"postgres-12","postgres-13","postgres-14","postgres-15","postgres-16","mariadb-10.2","mariadb-10.3","mariadb-10.4","mariadb-10.5","mariadb-10.6",
"mariadb-10.7","mssql-2017","H2Database-2.2","crdb-23.1","crdb-23.2","crdb-24.1",
"edb-postgres-12","edb-postgres-13","edb-postgres-14","edb-postgres-15","edb-postgres-16",
"edb-edb-12","edb-edb-13","edb-edb-14","edb-edb-15","edb-edb-16","derby","sqlite","hsqldb-2.4","hsqldb-2.5","firebird-3","firebird-4","db2-luw"]' }}
"edb-edb-12","edb-edb-13","edb-edb-14","edb-edb-15","edb-edb-16","derby","sqlite","hsqldb-2.4","hsqldb-2.5","firebird-3","firebird-4","db2-luw","informix-12.10","informix-14.10"]' }}
testClasses: ${{ inputs.testClasses || 'LiquibaseHarnessSuiteTest' }}
steps:
- uses: actions/checkout@v4
Expand Down
5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,11 @@
<artifactId>mssql-jdbc</artifactId>
<version>12.8.1.jre11</version>
</dependency>
<dependency>
<groupId>com.ibm.informix</groupId>
<artifactId>jdbc</artifactId>
<version>4.50.11</version>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ class FoundationalTest extends Specification {
if (shouldOpenNewConnection(connection, "sqlite")) {
newConnection = DriverManager.getConnection(testInput.url, testInput.username, testInput.password)
resultSet = newConnection.createStatement().executeQuery("SELECT * FROM DATABASECHANGELOG")
} else if (shouldOpenNewConnection(connection, "informix")) {
resultSet = ((JdbcConnection) connection).createStatement().executeQuery("SELECT * FROM DATABASECHANGELOG")
} else {
resultSet = ((JdbcConnection) connection).createStatement().executeQuery("SELECT * FROM DATABASECHANGELOG")
connection.autoCommit ?: connection.commit()
Expand Down
10 changes: 8 additions & 2 deletions src/test/resources/automation-runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,16 @@ case $db in
test_command mvn -ntp -Dtest=$tc -DdbName=firebird -DdbVersion=4 test
;;
"db2-luw")
test_command mvn -ntp -Dtest=$tc -DdbName=db2-luw test
;;
test_command mvn -ntp -Dtest=$tc -DdbName=db2-luw test
;;
"snowflake")
test_command mvn -ntp -Dtest=$tc -DdbName=snowflake -DrollbackStrategy=rollbackByTag test
;;
"informix-12.10")
test_command mvn -ntp -Dtest=$tc -DdbName=informix -DdbVersion=12 test
;;
"informix-14.10")
test_command mvn -ntp -Dtest=$tc -DdbName=informix -DdbVersion=14 test
;;
esac

6 changes: 6 additions & 0 deletions src/test/resources/docker/create-infra.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ case $db in
exit 0
;;

# informix needs a bit more time to start
"informix-12.10"|"informix-14.10")
docker compose up -d $db
sleep 60
;;

# standard startup
*)
docker compose up -d $db
Expand Down
29 changes: 29 additions & 0 deletions src/test/resources/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,35 @@ services:
depends_on:
- crdb-24.1

informix-12.10:
image: ibmcom/informix-developer-database:12.10.FC12W1DE
container_name: informix-db
hostname: ifx
ports:
- "9088:9088"
environment:
LICENSE: "accept"
SIZE: "custom"
restart: always
privileged: true
volumes:
- "./informix-init.sql:/opt/ibm/data/sch_init_informix.custom.sql"

informix-14.10:
image: icr.io/informix/informix-developer-database:14.10.FC7W1DE
container_name: informix-db
hostname: ifx
ports:
- "9088:9088"
environment:
LICENSE: "accept"
INIT_FILE: "informix-init.sql"
DBDATE: "Y4MD-"
restart: always
privileged: true
volumes:
- "./informix-init.sql:/opt/ibm/config/informix-init.sql"

# Titan (https://titan-data.io) is managing these images for our CI/CD process. If you want to run them locally you'll have to
# populate init script (hsqldb-init.sql) for this platform manually or install titan and pull image pre-populated with data

Expand Down
59 changes: 59 additions & 0 deletions src/test/resources/docker/informix-init.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
CREATE DATABASE testdb WITH LOG MODE ANSI;

-- Use BEGIN WORK to start a transaction
BEGIN WORK;

-- Drop and create authors table
DROP TABLE IF EXISTS informix.authors;
CREATE TABLE informix.authors (
id SERIAL PRIMARY KEY,
first_name VARCHAR(50) NOT NULL,
last_name VARCHAR(50) NOT NULL,
email VARCHAR(100) NOT NULL,
birthdate DATE NOT NULL,
added DATETIME YEAR TO FRACTION(5) DEFAULT CURRENT YEAR TO FRACTION(5)
);

-- Insert data into authors table
INSERT INTO informix.authors (id, first_name, last_name, email, birthdate, added)
VALUES (1, 'Eileen', 'Lubowitz', '[email protected]', DATE('1991-03-04'), '2004-05-30 02:08:25');
INSERT INTO informix.authors (id, first_name, last_name, email, birthdate, added)
VALUES (2, 'Tamia', 'Mayert', '[email protected]', DATE('2016-03-27'), '2014-03-21 02:52:00');
INSERT INTO informix.authors (id, first_name, last_name, email, birthdate, added)
VALUES (3, 'Cyril', 'Funk', '[email protected]', DATE('1988-04-21'), '2011-06-24 18:17:48');
INSERT INTO informix.authors (id, first_name, last_name, email, birthdate, added)
VALUES (4, 'Nicolas', 'Buckridge', '[email protected]', DATE('2017-02-03'), '2019-04-22 02:04:41');
INSERT INTO informix.authors (id, first_name, last_name, email, birthdate, added)
VALUES (5, 'Jayden', 'Walter', '[email protected]', DATE('2010-02-27'), '1990-02-04 02:32:00');

-- Commit the transaction for authors table
COMMIT WORK;

-- Start a new transaction
BEGIN WORK;

-- Drop and create posts table
DROP TABLE IF EXISTS informix.posts;
CREATE TABLE informix.posts (
id SERIAL,
author_id INT NOT NULL,
title VARCHAR(255) NOT NULL DEFAULT 'title_test',
description VARCHAR(255) NOT NULL,
content VARCHAR(255) NOT NULL,
inserted_date DATE
);

-- Insert data into posts table
INSERT INTO informix.posts (id, author_id, title, description, content, inserted_date)
VALUES (1, 1, 'temporibus', 'voluptatum', 'Fugit non et doloribus repudiandae.', DATE('2015-11-18'));
INSERT INTO informix.posts (id, author_id, title, description, content, inserted_date)
VALUES (2, 2, 'ea', 'aut', 'Tempora molestias maiores provident molestiae sint possimus quasi.', DATE('1975-06-08'));
INSERT INTO informix.posts (id, author_id, title, description, content, inserted_date)
VALUES (3, 3, 'illum', 'rerum', 'Delectus recusandae sit officiis dolor.', DATE('1975-02-25'));
INSERT INTO informix.posts (id, author_id, title, description, content, inserted_date)
VALUES (4, 4, 'itaque', 'deleniti', 'Magni nam optio id recusandae.', DATE('2010-07-28'));
INSERT INTO informix.posts (id, author_id, title, description, content, inserted_date)
VALUES (5, 5, 'ad', 'similique', 'Rerum tempore quis ut nesciunt qui excepturi est.', DATE('2006-10-09'));

-- Commit the transaction for posts table
COMMIT WORK;
15 changes: 15 additions & 0 deletions src/test/resources/harness-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -308,3 +308,18 @@ databasesUnderTest:
url: jdbc:firebirdsql://localhost:3050/lbcat
username: lbuser
password: LiquibasePass1

- name: informix
prefix: docker
version: 12
url: jdbc:informix-sqli://localhost:9088/testdb:INFORMIXSERVER=informix;
username: informix
password: in4mix

- name: informix
prefix: docker
version: 14
url: jdbc:informix-sqli://localhost:9088/testdb:INFORMIXSERVER=informix;
username: informix
password: in4mix

Loading