mirror of
https://github.com/datahub-project/datahub.git
synced 2025-10-27 08:54:32 +00:00
Logging and test models fixes (#7884)
This commit is contained in:
parent
e9c2f9afcc
commit
2ffa39f009
@ -3,8 +3,8 @@ buildscript {
|
||||
// Releases: https://github.com/linkedin/rest.li/blob/master/CHANGELOG.md
|
||||
ext.pegasusVersion = '29.22.16'
|
||||
ext.mavenVersion = '3.6.3'
|
||||
ext.springVersion = '5.3.20'
|
||||
ext.springBootVersion = '2.7.10'
|
||||
ext.springVersion = '5.3.27'
|
||||
ext.springBootVersion = '2.7.11'
|
||||
ext.openTelemetryVersion = '1.18.0'
|
||||
ext.neo4jVersion = '4.4.9'
|
||||
ext.graphQLJavaVersion = '19.0'
|
||||
@ -15,8 +15,8 @@ buildscript {
|
||||
ext.jettyVersion = '9.4.46.v20220331'
|
||||
ext.playVersion = '2.8.18'
|
||||
ext.log4jVersion = '2.19.0'
|
||||
ext.slf4jVersion = '1.7.32'
|
||||
ext.logbackClassic = '1.2.11'
|
||||
ext.slf4jVersion = '1.7.36'
|
||||
ext.logbackClassic = '1.2.12'
|
||||
ext.hadoop3Version = '3.3.5'
|
||||
|
||||
ext.docker_registry = 'linkedin'
|
||||
|
||||
@ -63,6 +63,7 @@ dependencies {
|
||||
testImplementation externalDependency.springBootTest
|
||||
testCompile externalDependency.mockito
|
||||
testCompile externalDependency.testng
|
||||
testRuntime externalDependency.logbackClassic
|
||||
}
|
||||
|
||||
bootJar {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
package com.linkedin.metadata.models;
|
||||
|
||||
import com.datahub.test.BrowsePaths;
|
||||
import com.datahub.test.TestBrowsePaths;
|
||||
import com.datahub.test.SearchFeatures;
|
||||
import com.datahub.test.Snapshot;
|
||||
import com.datahub.test.TestEntityInfo;
|
||||
@ -91,7 +91,7 @@ public class EntitySpecBuilderTest {
|
||||
final Map<String, AspectSpec> aspectSpecMap = testEntitySpec.getAspectSpecMap();
|
||||
assertEquals(4, aspectSpecMap.size());
|
||||
assertTrue(aspectSpecMap.containsKey("testEntityKey"));
|
||||
assertTrue(aspectSpecMap.containsKey("browsePaths"));
|
||||
assertTrue(aspectSpecMap.containsKey("testBrowsePaths"));
|
||||
assertTrue(aspectSpecMap.containsKey("testEntityInfo"));
|
||||
assertTrue(aspectSpecMap.containsKey("searchFeatures"));
|
||||
|
||||
@ -99,7 +99,7 @@ public class EntitySpecBuilderTest {
|
||||
validateTestEntityKey(aspectSpecMap.get("testEntityKey"));
|
||||
|
||||
// Assert on BrowsePaths Aspect
|
||||
validateBrowsePaths(aspectSpecMap.get("browsePaths"));
|
||||
validateBrowsePaths(aspectSpecMap.get("testBrowsePaths"));
|
||||
|
||||
// Assert on TestEntityInfo Aspect
|
||||
validateTestEntityInfo(aspectSpecMap.get("testEntityInfo"));
|
||||
@ -130,8 +130,8 @@ public class EntitySpecBuilderTest {
|
||||
|
||||
|
||||
private void validateBrowsePaths(final AspectSpec browsePathAspectSpec) {
|
||||
assertEquals("browsePaths", browsePathAspectSpec.getName());
|
||||
assertEquals(new BrowsePaths().schema().getFullName(), browsePathAspectSpec.getPegasusSchema().getFullName());
|
||||
assertEquals("testBrowsePaths", browsePathAspectSpec.getName());
|
||||
assertEquals(new TestBrowsePaths().schema().getFullName(), browsePathAspectSpec.getPegasusSchema().getFullName());
|
||||
assertEquals(1, browsePathAspectSpec.getSearchableFieldSpecs().size());
|
||||
assertEquals(SearchableAnnotation.FieldType.BROWSE_PATH, browsePathAspectSpec.getSearchableFieldSpecs().get(0)
|
||||
.getSearchableAnnotation().getFieldType());
|
||||
|
||||
@ -51,6 +51,7 @@ dependencies {
|
||||
testCompile externalDependency.mockServerClient
|
||||
testCompile externalDependency.testContainers
|
||||
testCompile externalDependency.httpAsyncClient
|
||||
testRuntime externalDependency.logbackClassic
|
||||
|
||||
swaggerCodegen 'io.swagger.codegen.v3:swagger-codegen-cli:3.0.33'
|
||||
}
|
||||
|
||||
@ -59,6 +59,8 @@ dependencies {
|
||||
testCompile project(':test-models')
|
||||
testImplementation externalDependency.springBootTest
|
||||
testImplementation project(':datahub-graphql-core')
|
||||
// logback >=1.3 required due to `testcontainers` only
|
||||
testImplementation 'ch.qos.logback:logback-classic:1.4.7'
|
||||
|
||||
testAnnotationProcessor externalDependency.lombok
|
||||
|
||||
|
||||
@ -7,8 +7,6 @@ import com.linkedin.metadata.config.search.SearchConfiguration;
|
||||
import com.linkedin.metadata.models.registry.ConfigEntityRegistry;
|
||||
import com.linkedin.metadata.models.registry.EntityRegistry;
|
||||
import com.linkedin.metadata.models.registry.EntityRegistryException;
|
||||
import com.linkedin.metadata.models.registry.MergedEntityRegistry;
|
||||
import com.linkedin.metadata.models.registry.SnapshotEntityRegistry;
|
||||
import com.linkedin.metadata.search.elasticsearch.indexbuilder.ESIndexBuilder;
|
||||
import com.linkedin.metadata.search.elasticsearch.update.ESBulkProcessor;
|
||||
import com.linkedin.metadata.version.GitVersion;
|
||||
@ -125,8 +123,7 @@ public class ESTestConfiguration {
|
||||
|
||||
@Bean(name = "entityRegistry")
|
||||
public EntityRegistry entityRegistry() throws EntityRegistryException {
|
||||
ConfigEntityRegistry configEntityRegistry = new ConfigEntityRegistry(
|
||||
return new ConfigEntityRegistry(
|
||||
ESTestConfiguration.class.getClassLoader().getResourceAsStream("entity-registry.yml"));
|
||||
return new MergedEntityRegistry(SnapshotEntityRegistry.getInstance()).apply(configEntityRegistry);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
package com.linkedin.metadata;
|
||||
|
||||
import com.datahub.test.BrowsePaths;
|
||||
import com.datahub.test.TestBrowsePaths;
|
||||
import com.datahub.test.KeyPartEnum;
|
||||
import com.datahub.test.SearchFeatures;
|
||||
import com.datahub.test.SimpleNestedRecord1;
|
||||
@ -52,7 +52,7 @@ public class TestEntityUtil {
|
||||
Urn urn = getTestEntityUrn();
|
||||
snapshot.setUrn(urn);
|
||||
|
||||
BrowsePaths browsePaths = new BrowsePaths().setPaths(new StringArray(ImmutableList.of("/a/b/c", "d/e/f")));
|
||||
TestBrowsePaths browsePaths = new TestBrowsePaths().setPaths(new StringArray(ImmutableList.of("/a/b/c", "d/e/f")));
|
||||
SearchFeatures searchFeatures = new SearchFeatures().setFeature1(2).setFeature2(1);
|
||||
|
||||
TestEntityAspectArray aspects = new TestEntityAspectArray(
|
||||
|
||||
19
metadata-io/src/test/resources/logback-test.xml
Normal file
19
metadata-io/src/test/resources/logback-test.xml
Normal file
@ -0,0 +1,19 @@
|
||||
<configuration debug="false" scan="true">
|
||||
|
||||
<appender name="STDOUT" target="System.out" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>%date{ISO8601} [%thread] %-5level %logger{36} - %msg%n</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
||||
<level>WARN</level>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<logger name="com.datastax.oss" level="ERROR" />
|
||||
<logger name="com.datastax.driver" level="FATAL" />
|
||||
|
||||
<root level="WARN">
|
||||
<appender-ref ref="STDOUT" />
|
||||
</root>
|
||||
|
||||
</configuration>
|
||||
@ -45,6 +45,7 @@ dependencies {
|
||||
implementation externalDependency.awsMskIamAuth
|
||||
|
||||
testImplementation externalDependency.springBootTest
|
||||
testRuntime externalDependency.logbackClassic
|
||||
}
|
||||
|
||||
task avroSchemaSources(type: Copy) {
|
||||
|
||||
@ -23,6 +23,7 @@ dependencies {
|
||||
annotationProcessor externalDependency.lombok
|
||||
runtime externalDependency.logbackClassic
|
||||
testCompile externalDependency.mockito
|
||||
testRuntime externalDependency.logbackClassic
|
||||
}
|
||||
|
||||
task avroSchemaSources(type: Copy) {
|
||||
|
||||
@ -37,6 +37,7 @@ dependencies {
|
||||
runtime externalDependency.log4j2Api
|
||||
runtime externalDependency.logbackClassic
|
||||
implementation externalDependency.awsMskIamAuth
|
||||
testRuntime externalDependency.logbackClassic
|
||||
}
|
||||
|
||||
configurations {
|
||||
|
||||
@ -4,9 +4,9 @@ namespace com.datahub.test
|
||||
* Shared aspect containing Browse Paths to be indexed for an entity.
|
||||
*/
|
||||
@Aspect = {
|
||||
"name": "browsePaths"
|
||||
"name": "testBrowsePaths"
|
||||
}
|
||||
record BrowsePaths {
|
||||
record TestBrowsePaths {
|
||||
/**
|
||||
* A list of valid browse paths for the entity.
|
||||
*
|
||||
@ -6,6 +6,6 @@ namespace com.datahub.test
|
||||
typeref TestEntityAspect = union[
|
||||
TestEntityKey,
|
||||
TestEntityInfo,
|
||||
BrowsePaths,
|
||||
TestBrowsePaths,
|
||||
SearchFeatures
|
||||
]
|
||||
@ -27,7 +27,7 @@ record PizzaSearchDocument {
|
||||
/**
|
||||
* The path parts to browse for this pizza.
|
||||
*/
|
||||
browsePaths: optional array[string]
|
||||
testBrowsePaths: optional array[string]
|
||||
|
||||
/**
|
||||
* Whether this pizza still exists.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user