mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-11-12 00:41:32 +00:00
* Fix #5831: Add pipeline to testsuite * Fix #5831: Add pipeline to testsuite
This commit is contained in:
parent
b70f49e5a8
commit
8943e3bb7d
@ -3,9 +3,11 @@ package org.openmetadata.catalog.jdbi3;
|
|||||||
import static org.openmetadata.catalog.Entity.TEST_SUITE;
|
import static org.openmetadata.catalog.Entity.TEST_SUITE;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import org.openmetadata.catalog.Entity;
|
||||||
import org.openmetadata.catalog.resources.dqtests.TestSuiteResource;
|
import org.openmetadata.catalog.resources.dqtests.TestSuiteResource;
|
||||||
import org.openmetadata.catalog.tests.TestSuite;
|
import org.openmetadata.catalog.tests.TestSuite;
|
||||||
import org.openmetadata.catalog.type.EntityReference;
|
import org.openmetadata.catalog.type.EntityReference;
|
||||||
|
import org.openmetadata.catalog.type.Relationship;
|
||||||
import org.openmetadata.catalog.util.EntityUtil;
|
import org.openmetadata.catalog.util.EntityUtil;
|
||||||
|
|
||||||
public class TestSuiteRepository extends EntityRepository<TestSuite> {
|
public class TestSuiteRepository extends EntityRepository<TestSuite> {
|
||||||
@ -26,6 +28,7 @@ public class TestSuiteRepository extends EntityRepository<TestSuite> {
|
|||||||
@Override
|
@Override
|
||||||
public TestSuite setFields(TestSuite entity, EntityUtil.Fields fields) throws IOException {
|
public TestSuite setFields(TestSuite entity, EntityUtil.Fields fields) throws IOException {
|
||||||
entity.setOwner(fields.contains("owner") ? getOwner(entity) : null);
|
entity.setOwner(fields.contains("owner") ? getOwner(entity) : null);
|
||||||
|
entity.setPipeline(fields.contains("pipelines") ? getIngestionPipeline(entity) : null);
|
||||||
return entity;
|
return entity;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -50,6 +53,10 @@ public class TestSuiteRepository extends EntityRepository<TestSuite> {
|
|||||||
storeOwner(entity, entity.getOwner());
|
storeOwner(entity, entity.getOwner());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private EntityReference getIngestionPipeline(TestSuite testSuite) throws IOException {
|
||||||
|
return getToEntityRef(testSuite.getId(), Relationship.CONTAINS, Entity.INGESTION_PIPELINE, false);
|
||||||
|
}
|
||||||
|
|
||||||
public class TestSuiteUpdater extends EntityUpdater {
|
public class TestSuiteUpdater extends EntityUpdater {
|
||||||
public TestSuiteUpdater(TestSuite original, TestSuite updated, Operation operation) {
|
public TestSuiteUpdater(TestSuite original, TestSuite updated, Operation operation) {
|
||||||
super(original, updated, operation);
|
super(original, updated, operation);
|
||||||
|
|||||||
@ -337,7 +337,6 @@ public class TestSuiteResource extends EntityResource<TestSuite, TestSuiteReposi
|
|||||||
private TestSuite getTestSuite(CreateTestSuite create, String user) throws IOException {
|
private TestSuite getTestSuite(CreateTestSuite create, String user) throws IOException {
|
||||||
return copy(new TestSuite(), create, user)
|
return copy(new TestSuite(), create, user)
|
||||||
.withDescription(create.getDescription())
|
.withDescription(create.getDescription())
|
||||||
.withScheduleInterval(create.getScheduleInterval())
|
|
||||||
.withDisplayName(create.getDisplayName())
|
.withDisplayName(create.getDisplayName())
|
||||||
.withName(create.getName());
|
.withName(create.getName());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"$id": "https://open-metadata.org/schema/entity/services/ingestionPipelines/dashboardServiceMetadataPipeline.json",
|
"$id": "https://open-metadata.org/schema/metadataIngestion/dashboardServiceMetadataPipeline.json",
|
||||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||||
"title": "DashboardServiceMetadataPipeline",
|
"title": "DashboardServiceMetadataPipeline",
|
||||||
"description": "DashboardService Metadata Pipeline Configuration.",
|
"description": "DashboardService Metadata Pipeline Configuration.",
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"$id": "https://open-metadata.org//schema/entity/services/ingestionPipelines/databaseServiceMetadataPipeline.json",
|
"$id": "https://open-metadata.org/schema/metadataIngestion/databaseServiceMetadataPipeline.json",
|
||||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||||
"title": "DatabaseServiceMetadataPipeline",
|
"title": "DatabaseServiceMetadataPipeline",
|
||||||
"description": "DatabaseService Metadata Pipeline Configuration.",
|
"description": "DatabaseService Metadata Pipeline Configuration.",
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"$id": "https://open-metadata.org/schema/entity/services/ingestionPipelines/databaseServiceProfilerPipeline.json",
|
"$id": "https://open-metadata.org/schema/metadataIngestion/databaseServiceProfilerPipeline.json",
|
||||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||||
"title": "DatabaseServiceProfilerPipeline",
|
"title": "DatabaseServiceProfilerPipeline",
|
||||||
"description": "DatabaseService Profiler Pipeline Configuration.",
|
"description": "DatabaseService Profiler Pipeline Configuration.",
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"$id": "https://open-metadata.org/schema/entity/services/ingestionPipelines/databaseServiceQueryLineagePipeline.json",
|
"$id": "https://open-metadata.org/schema/metadataIngestion/databaseServiceQueryLineagePipeline.json",
|
||||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||||
"title": "DatabaseServiceQueryLineagePipeline",
|
"title": "DatabaseServiceQueryLineagePipeline",
|
||||||
"description": "DatabaseService Query Lineage Pipeline Configuration.",
|
"description": "DatabaseService Query Lineage Pipeline Configuration.",
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"$id": "https://open-metadata.org/schema/entity/services/ingestionPipelines/databaseServiceQueryUsagePipeline.json",
|
"$id": "https://open-metadata.org/schema/metadataIngestion/databaseServiceQueryUsagePipeline.json",
|
||||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||||
"title": "DatabaseServiceQueryUsagePipeline",
|
"title": "DatabaseServiceQueryUsagePipeline",
|
||||||
"description": "DatabaseService Query Usage Pipeline Configuration.",
|
"description": "DatabaseService Query Usage Pipeline Configuration.",
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"$id": "https://open-metadata.org/schema/entities/services/ingestionPipelines/messagingServiceMetadataPipeline.json",
|
"$id": "https://open-metadata.org/schema/metadataIngestion/messagingServiceMetadataPipeline.json",
|
||||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||||
"title": "MessagingServiceMetadataPipeline",
|
"title": "MessagingServiceMetadataPipeline",
|
||||||
"description": "MessagingService Metadata Pipeline Configuration.",
|
"description": "MessagingService Metadata Pipeline Configuration.",
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"$id": "https://open-metadata.org/schema/entity/services/ingestionPipelines/mlmodelServiceMetadataPipeline.json",
|
"$id": "https://open-metadata.org/schema/metadataIngestion/mlmodelServiceMetadataPipeline.json",
|
||||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||||
"title": "MlModelServiceMetadataPipeline",
|
"title": "MlModelServiceMetadataPipeline",
|
||||||
"description": "MlModelService Metadata Pipeline Configuration.",
|
"description": "MlModelService Metadata Pipeline Configuration.",
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"$id": "https://open-metadata.org/schema/entity/services/ingestionPipelines/pipelineServiceMetadataPipeline.json",
|
"$id": "https://open-metadata.org/schema/metadataIngestion/pipelineServiceMetadataPipeline.json",
|
||||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||||
"title": "PipelineServiceMetadataPipeline",
|
"title": "PipelineServiceMetadataPipeline",
|
||||||
"description": "PipelineService Metadata Pipeline Configuration.",
|
"description": "PipelineService Metadata Pipeline Configuration.",
|
||||||
|
|||||||
@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"$id": "https://open-metadata.org/schema/metadataIngestion/testSuitePipeline.json",
|
||||||
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||||
|
"title": "TestSuitePipeline",
|
||||||
|
"description": "TestSuite Pipeline Configuration.",
|
||||||
|
"definitions": {
|
||||||
|
"pipelineMetadataConfigType": {
|
||||||
|
"description": "Pipeline Source Config Metadata Pipeline type",
|
||||||
|
"type": "string",
|
||||||
|
"enum": ["TestSuite"],
|
||||||
|
"default": "TestSuite"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"properties": {
|
||||||
|
"type": {
|
||||||
|
"description": "Pipeline type",
|
||||||
|
"$ref": "#/definitions/pipelineMetadataConfigType",
|
||||||
|
"default": "TestSuite"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": false
|
||||||
|
}
|
||||||
@ -35,9 +35,10 @@
|
|||||||
},
|
},
|
||||||
"default": null
|
"default": null
|
||||||
},
|
},
|
||||||
"scheduleInterval": {
|
"pipeline": {
|
||||||
"description": "TestSuite schedule interval in cron format.",
|
"description": "References to pipelines deployed for this database service to extract metadata, usage, lineage etc..",
|
||||||
"type": "string"
|
"$ref": "../type/entityReference.json",
|
||||||
|
"default": null
|
||||||
},
|
},
|
||||||
"owner": {
|
"owner": {
|
||||||
"description": "Owner of this TestCase definition.",
|
"description": "Owner of this TestCase definition.",
|
||||||
|
|||||||
@ -58,7 +58,6 @@ public class TestSuiteResourceTest extends EntityResourceTest<TestSuite, CreateT
|
|||||||
throws HttpResponseException {
|
throws HttpResponseException {
|
||||||
assertEquals(request.getName(), createdEntity.getName());
|
assertEquals(request.getName(), createdEntity.getName());
|
||||||
assertEquals(request.getDescription(), createdEntity.getDescription());
|
assertEquals(request.getDescription(), createdEntity.getDescription());
|
||||||
assertEquals(request.getScheduleInterval(), createdEntity.getScheduleInterval());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -66,7 +65,6 @@ public class TestSuiteResourceTest extends EntityResourceTest<TestSuite, CreateT
|
|||||||
throws HttpResponseException {
|
throws HttpResponseException {
|
||||||
assertEquals(expected.getName(), updated.getName());
|
assertEquals(expected.getName(), updated.getName());
|
||||||
assertEquals(expected.getDescription(), updated.getDescription());
|
assertEquals(expected.getDescription(), updated.getDescription());
|
||||||
assertEquals(expected.getScheduleInterval(), updated.getScheduleInterval());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user