mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-06-27 04:22:05 +00:00
Fix tests logging; do not initialize the search client if the search … (#12681)
* Fix tests logging; do not initialize the search client if the search config is not present * Fix logging and parallelization defaults 1C * Fix logging and parallelization defaults 1C * Fix logging and parallelization defaults 1C * Fix logging and parallelization defaults 1C * Fix logging and parallelization defaults 1C * Fix logging and parallelization defaults 1C
This commit is contained in:
parent
098625c549
commit
878fda47a1
10
.github/workflows/maven-build.yml
vendored
10
.github/workflows/maven-build.yml
vendored
@ -58,16 +58,6 @@ jobs:
|
||||
node-version:
|
||||
- 16.x
|
||||
steps:
|
||||
- name: Free Disk Space (Ubuntu)
|
||||
uses: jlumbroso/free-disk-space@main
|
||||
with:
|
||||
tool-cache: false
|
||||
android: true
|
||||
dotnet: true
|
||||
haskell: true
|
||||
large-packages: true
|
||||
swap-storage: true
|
||||
docker-images: false
|
||||
- name: Wait for the labeler
|
||||
uses: lewagon/wait-on-check-action@0179dfc359f90a703c41240506f998ee1603f9ea #v1.0.0
|
||||
if: ${{ github.event_name == 'pull_request_target' }}
|
||||
|
@ -22,7 +22,7 @@
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<properties>
|
||||
<dropwizard.swagger.version>2.1.6-1</dropwizard.swagger.version>
|
||||
<dropwizard.swagger.version>2.1.4-1</dropwizard.swagger.version>
|
||||
</properties>
|
||||
|
||||
<artifactId>common</artifactId>
|
||||
|
@ -11,7 +11,7 @@
|
||||
<artifactId>openmetadata-service</artifactId>
|
||||
|
||||
<properties>
|
||||
<dropwizard.swagger.version>2.1.6-1</dropwizard.swagger.version>
|
||||
<dropwizard.swagger.version>2.0.12-1</dropwizard.swagger.version>
|
||||
<sonar.junit.reportPaths>${project.basedir}/target/surefire-reports</sonar.junit.reportPaths>
|
||||
<sonar.coverage.jacoco.xmlReportPaths>${project.basedir}/target/site/jacoco-aggregate/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
|
||||
<sonar.tests>${project.basedir}/src/test/java</sonar.tests>
|
||||
@ -480,17 +480,6 @@
|
||||
<artifactId>woodstox-core</artifactId>
|
||||
<version>${woodstox.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.reflections</groupId>
|
||||
<artifactId>reflections</artifactId>
|
||||
<version>0.10.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.swagger</groupId>
|
||||
<artifactId>swagger-annotations</artifactId>
|
||||
<version>1.6.11</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<profiles>
|
||||
@ -647,7 +636,7 @@
|
||||
<parallel>classes</parallel>
|
||||
<threadCount>1</threadCount>
|
||||
<forkCount>2C</forkCount>
|
||||
<argLine>-Xmx1024m</argLine>
|
||||
<argLine>-Xmx512m</argLine>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
|
@ -72,20 +72,26 @@ public class ElasticSearchIndexDefinition {
|
||||
}
|
||||
|
||||
public void createIndexes(ElasticSearchConfiguration esConfig) {
|
||||
for (ElasticSearchIndexType elasticSearchIndexType : ElasticSearchIndexType.values()) {
|
||||
searchClient.createIndex(elasticSearchIndexType, esConfig.getSearchIndexMappingLanguage().value());
|
||||
if (searchClient != null) {
|
||||
for (ElasticSearchIndexType elasticSearchIndexType : ElasticSearchIndexType.values()) {
|
||||
searchClient.createIndex(elasticSearchIndexType, esConfig.getSearchIndexMappingLanguage().value());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void updateIndexes(ElasticSearchConfiguration esConfig) {
|
||||
for (ElasticSearchIndexType elasticSearchIndexType : ElasticSearchIndexType.values()) {
|
||||
searchClient.updateIndex(elasticSearchIndexType, esConfig.getSearchIndexMappingLanguage().value());
|
||||
if (searchClient != null) {
|
||||
for (ElasticSearchIndexType elasticSearchIndexType : ElasticSearchIndexType.values()) {
|
||||
searchClient.updateIndex(elasticSearchIndexType, esConfig.getSearchIndexMappingLanguage().value());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void dropIndexes() {
|
||||
for (ElasticSearchIndexType elasticSearchIndexType : ElasticSearchIndexType.values()) {
|
||||
searchClient.deleteIndex(elasticSearchIndexType);
|
||||
if (searchClient != null) {
|
||||
for (ElasticSearchIndexType elasticSearchIndexType : ElasticSearchIndexType.values()) {
|
||||
searchClient.deleteIndex(elasticSearchIndexType);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -59,9 +59,12 @@ public class IndexUtil {
|
||||
}
|
||||
|
||||
public static SearchClient getSearchClient(ElasticSearchConfiguration esConfig, CollectionDAO dao) {
|
||||
return esConfig.getSearchType().equals(SearchType.OPENSEARCH)
|
||||
? new OpenSearchClientImpl(esConfig, dao)
|
||||
: new ElasticSearchClientImpl(esConfig, dao);
|
||||
if (esConfig != null) {
|
||||
return esConfig.getSearchType().equals(SearchType.OPENSEARCH)
|
||||
? new OpenSearchClientImpl(esConfig, dao)
|
||||
: new ElasticSearchClientImpl(esConfig, dao);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -249,8 +249,7 @@ public final class TablesInitializer {
|
||||
jdbi.installPlugin(new SqlObjectPlugin());
|
||||
jdbi.getConfig(SqlObjects.class)
|
||||
.setSqlLocator(new ConnectionAwareAnnotationSqlLocator(config.getDataSourceFactory().getDriverClass()));
|
||||
SearchClient searchClient;
|
||||
searchClient =
|
||||
SearchClient searchClient =
|
||||
IndexUtil.getSearchClient(config.getElasticSearchConfiguration(), jdbi.onDemand(CollectionDAO.class));
|
||||
ElasticSearchIndexDefinition esIndexDefinition;
|
||||
|
||||
|
@ -116,7 +116,6 @@ public class GlossaryResourceTest extends EntityResourceTest<Glossary, CreateGlo
|
||||
GLOSSARY2_TERM1 = glossaryTermResourceTest.createEntity(createGlossaryTerm, ADMIN_AUTH_HEADERS);
|
||||
GLOSSARY2_TERM1_LABEL = EntityUtil.toTagLabel(GLOSSARY2_TERM1);
|
||||
validateTagLabel(GLOSSARY2_TERM1_LABEL);
|
||||
System.out.println("Setup glossaries done");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -0,0 +1 @@
|
||||
log4j.rootLogger=OFF
|
15
openmetadata-service/src/test/resources/logback.xml
Normal file
15
openmetadata-service/src/test/resources/logback.xml
Normal file
@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
||||
<level>ERROR</level>
|
||||
</filter>
|
||||
<encoder>
|
||||
<pattern>[%thread] %-5level %logger{5} - %msg%n
|
||||
</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
<root level="ERROR">
|
||||
<appender-ref ref="STDOUT" />
|
||||
</root>
|
||||
</configuration>
|
@ -22,6 +22,8 @@ server:
|
||||
adminConnectors:
|
||||
- type: http
|
||||
port: 0
|
||||
requestLog:
|
||||
type: external
|
||||
|
||||
# Above configuration for running http is fine for dev and testing.
|
||||
# For production setup, where UI app will hit apis through DPS it
|
||||
@ -87,10 +89,8 @@ server:
|
||||
|
||||
# Logging settings.
|
||||
logging:
|
||||
level: INFO
|
||||
appenders:
|
||||
- type: console
|
||||
logFormat: "%level %logger{5} - %msg%n"
|
||||
level: OFF
|
||||
appenders: []
|
||||
|
||||
database:
|
||||
# the name of the JDBC driver, h2 is used for testing
|
||||
|
@ -14,7 +14,7 @@
|
||||
<properties>
|
||||
<maven.compiler.source>11</maven.compiler.source>
|
||||
<maven.compiler.target>11</maven.compiler.target>
|
||||
<dropwizard.swagger.version>2.1.6-1</dropwizard.swagger.version>
|
||||
<dropwizard.swagger.version>2.0.12-1</dropwizard.swagger.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
Loading…
x
Reference in New Issue
Block a user