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:
|
node-version:
|
||||||
- 16.x
|
- 16.x
|
||||||
steps:
|
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
|
- name: Wait for the labeler
|
||||||
uses: lewagon/wait-on-check-action@0179dfc359f90a703c41240506f998ee1603f9ea #v1.0.0
|
uses: lewagon/wait-on-check-action@0179dfc359f90a703c41240506f998ee1603f9ea #v1.0.0
|
||||||
if: ${{ github.event_name == 'pull_request_target' }}
|
if: ${{ github.event_name == 'pull_request_target' }}
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<properties>
|
<properties>
|
||||||
<dropwizard.swagger.version>2.1.6-1</dropwizard.swagger.version>
|
<dropwizard.swagger.version>2.1.4-1</dropwizard.swagger.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<artifactId>common</artifactId>
|
<artifactId>common</artifactId>
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
<artifactId>openmetadata-service</artifactId>
|
<artifactId>openmetadata-service</artifactId>
|
||||||
|
|
||||||
<properties>
|
<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.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.coverage.jacoco.xmlReportPaths>${project.basedir}/target/site/jacoco-aggregate/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
|
||||||
<sonar.tests>${project.basedir}/src/test/java</sonar.tests>
|
<sonar.tests>${project.basedir}/src/test/java</sonar.tests>
|
||||||
@ -480,17 +480,6 @@
|
|||||||
<artifactId>woodstox-core</artifactId>
|
<artifactId>woodstox-core</artifactId>
|
||||||
<version>${woodstox.version}</version>
|
<version>${woodstox.version}</version>
|
||||||
</dependency>
|
</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>
|
</dependencies>
|
||||||
|
|
||||||
<profiles>
|
<profiles>
|
||||||
@ -647,7 +636,7 @@
|
|||||||
<parallel>classes</parallel>
|
<parallel>classes</parallel>
|
||||||
<threadCount>1</threadCount>
|
<threadCount>1</threadCount>
|
||||||
<forkCount>2C</forkCount>
|
<forkCount>2C</forkCount>
|
||||||
<argLine>-Xmx1024m</argLine>
|
<argLine>-Xmx512m</argLine>
|
||||||
</configuration>
|
</configuration>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
|
@ -72,22 +72,28 @@ public class ElasticSearchIndexDefinition {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void createIndexes(ElasticSearchConfiguration esConfig) {
|
public void createIndexes(ElasticSearchConfiguration esConfig) {
|
||||||
|
if (searchClient != null) {
|
||||||
for (ElasticSearchIndexType elasticSearchIndexType : ElasticSearchIndexType.values()) {
|
for (ElasticSearchIndexType elasticSearchIndexType : ElasticSearchIndexType.values()) {
|
||||||
searchClient.createIndex(elasticSearchIndexType, esConfig.getSearchIndexMappingLanguage().value());
|
searchClient.createIndex(elasticSearchIndexType, esConfig.getSearchIndexMappingLanguage().value());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void updateIndexes(ElasticSearchConfiguration esConfig) {
|
public void updateIndexes(ElasticSearchConfiguration esConfig) {
|
||||||
|
if (searchClient != null) {
|
||||||
for (ElasticSearchIndexType elasticSearchIndexType : ElasticSearchIndexType.values()) {
|
for (ElasticSearchIndexType elasticSearchIndexType : ElasticSearchIndexType.values()) {
|
||||||
searchClient.updateIndex(elasticSearchIndexType, esConfig.getSearchIndexMappingLanguage().value());
|
searchClient.updateIndex(elasticSearchIndexType, esConfig.getSearchIndexMappingLanguage().value());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void dropIndexes() {
|
public void dropIndexes() {
|
||||||
|
if (searchClient != null) {
|
||||||
for (ElasticSearchIndexType elasticSearchIndexType : ElasticSearchIndexType.values()) {
|
for (ElasticSearchIndexType elasticSearchIndexType : ElasticSearchIndexType.values()) {
|
||||||
searchClient.deleteIndex(elasticSearchIndexType);
|
searchClient.deleteIndex(elasticSearchIndexType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static Map<String, Object> getIndexMappingSchema(Set<String> entities) {
|
public static Map<String, Object> getIndexMappingSchema(Set<String> entities) {
|
||||||
if (entities.contains("*")) {
|
if (entities.contains("*")) {
|
||||||
|
@ -59,10 +59,13 @@ public class IndexUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static SearchClient getSearchClient(ElasticSearchConfiguration esConfig, CollectionDAO dao) {
|
public static SearchClient getSearchClient(ElasticSearchConfiguration esConfig, CollectionDAO dao) {
|
||||||
|
if (esConfig != null) {
|
||||||
return esConfig.getSearchType().equals(SearchType.OPENSEARCH)
|
return esConfig.getSearchType().equals(SearchType.OPENSEARCH)
|
||||||
? new OpenSearchClientImpl(esConfig, dao)
|
? new OpenSearchClientImpl(esConfig, dao)
|
||||||
: new ElasticSearchClientImpl(esConfig, dao);
|
: new ElasticSearchClientImpl(esConfig, dao);
|
||||||
}
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is used lazily to populate ES Mapping fields and corresponding Entity Fields getting common fields in
|
* This method is used lazily to populate ES Mapping fields and corresponding Entity Fields getting common fields in
|
||||||
|
@ -249,8 +249,7 @@ public final class TablesInitializer {
|
|||||||
jdbi.installPlugin(new SqlObjectPlugin());
|
jdbi.installPlugin(new SqlObjectPlugin());
|
||||||
jdbi.getConfig(SqlObjects.class)
|
jdbi.getConfig(SqlObjects.class)
|
||||||
.setSqlLocator(new ConnectionAwareAnnotationSqlLocator(config.getDataSourceFactory().getDriverClass()));
|
.setSqlLocator(new ConnectionAwareAnnotationSqlLocator(config.getDataSourceFactory().getDriverClass()));
|
||||||
SearchClient searchClient;
|
SearchClient searchClient =
|
||||||
searchClient =
|
|
||||||
IndexUtil.getSearchClient(config.getElasticSearchConfiguration(), jdbi.onDemand(CollectionDAO.class));
|
IndexUtil.getSearchClient(config.getElasticSearchConfiguration(), jdbi.onDemand(CollectionDAO.class));
|
||||||
ElasticSearchIndexDefinition esIndexDefinition;
|
ElasticSearchIndexDefinition esIndexDefinition;
|
||||||
|
|
||||||
|
@ -116,7 +116,6 @@ public class GlossaryResourceTest extends EntityResourceTest<Glossary, CreateGlo
|
|||||||
GLOSSARY2_TERM1 = glossaryTermResourceTest.createEntity(createGlossaryTerm, ADMIN_AUTH_HEADERS);
|
GLOSSARY2_TERM1 = glossaryTermResourceTest.createEntity(createGlossaryTerm, ADMIN_AUTH_HEADERS);
|
||||||
GLOSSARY2_TERM1_LABEL = EntityUtil.toTagLabel(GLOSSARY2_TERM1);
|
GLOSSARY2_TERM1_LABEL = EntityUtil.toTagLabel(GLOSSARY2_TERM1);
|
||||||
validateTagLabel(GLOSSARY2_TERM1_LABEL);
|
validateTagLabel(GLOSSARY2_TERM1_LABEL);
|
||||||
System.out.println("Setup glossaries done");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@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:
|
adminConnectors:
|
||||||
- type: http
|
- type: http
|
||||||
port: 0
|
port: 0
|
||||||
|
requestLog:
|
||||||
|
type: external
|
||||||
|
|
||||||
# Above configuration for running http is fine for dev and testing.
|
# Above configuration for running http is fine for dev and testing.
|
||||||
# For production setup, where UI app will hit apis through DPS it
|
# For production setup, where UI app will hit apis through DPS it
|
||||||
@ -87,10 +89,8 @@ server:
|
|||||||
|
|
||||||
# Logging settings.
|
# Logging settings.
|
||||||
logging:
|
logging:
|
||||||
level: INFO
|
level: OFF
|
||||||
appenders:
|
appenders: []
|
||||||
- type: console
|
|
||||||
logFormat: "%level %logger{5} - %msg%n"
|
|
||||||
|
|
||||||
database:
|
database:
|
||||||
# the name of the JDBC driver, h2 is used for testing
|
# the name of the JDBC driver, h2 is used for testing
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
<properties>
|
<properties>
|
||||||
<maven.compiler.source>11</maven.compiler.source>
|
<maven.compiler.source>11</maven.compiler.source>
|
||||||
<maven.compiler.target>11</maven.compiler.target>
|
<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>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user