fix(tests): use another db name on webserver to avoid colliding with repositories

This commit is contained in:
brian.mulier
2025-11-26 13:52:38 +01:00
committed by brian-mulier-p
parent e37e2b0166
commit 15da58dbf4
3 changed files with 9 additions and 9 deletions

View File

@@ -6,9 +6,11 @@ services:
MYSQL_USER: kestra
MYSQL_PASSWORD: k3str4
MYSQL_ROOT_PASSWORD: "p4ssw0rd"
command:
- --log-bin-trust-function-creators=1
- --sort-buffer-size=10485760
entrypoint: |
sh -c "
echo \"CREATE DATABASE IF NOT EXISTS kestra_unit_webserver;GRANT ALL PRIVILEGES ON kestra_unit_webserver.* TO 'kestra'@'%' WITH GRANT OPTION;\" > /docker-entrypoint-initdb.d/init.sql;
/usr/local/bin/docker-entrypoint.sh --log-bin-trust-function-creators=1 --innodb_ft_min_token_size=1 --ft_min_word_len=1 --sort-buffer-size=10485760
"
ports:
- 3306:3306
restart: on-failure
@@ -34,4 +36,4 @@ services:
# - "4318:4318" # OTLP HTTP receiver
# - "14250:14250" # Receive from external otel-collector, optional
# environment:
# - COLLECTOR_OTLP_ENABLED=true
# - COLLECTOR_OTLP_ENABLED=true

View File

@@ -12,6 +12,7 @@ import org.jooq.impl.DSL;
import javax.sql.DataSource;
import java.util.List;
import java.util.Optional;
import static io.kestra.core.utils.Rethrow.throwPredicate;
@@ -43,10 +44,7 @@ public class JdbcTestUtils {
.meta()
.getTables()
.stream()
.filter(throwPredicate(table -> (table.getSchema().getName().equals(dataSource.getConnection().getCatalog())) ||
table.getSchema().getName().equals("public") || // for Postgres
table.getSchema().getName().equals("dbo") // for SQLServer
))
.filter(throwPredicate(table -> (table.getSchema().getName().equals(Optional.ofNullable(dataSource.getConnection().getSchema()).orElse(dataSource.getConnection().getCatalog())))))
.filter(table -> tableConfigs.getTableConfigs().stream().anyMatch(conf -> conf.table().equalsIgnoreCase(table.getName())))
.toList();
});

View File

@@ -185,7 +185,7 @@ kestra:
datasources:
h2:
url: jdbc:h2:mem:public;TIME ZONE=UTC;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE
url: jdbc:h2:mem:public_webserver;TIME ZONE=UTC;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE
username: sa
password: ""
driverClassName: org.h2.Driver