mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-11-02 11:39:12 +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 java.io.IOException;
|
||||
import org.openmetadata.catalog.Entity;
|
||||
import org.openmetadata.catalog.resources.dqtests.TestSuiteResource;
|
||||
import org.openmetadata.catalog.tests.TestSuite;
|
||||
import org.openmetadata.catalog.type.EntityReference;
|
||||
import org.openmetadata.catalog.type.Relationship;
|
||||
import org.openmetadata.catalog.util.EntityUtil;
|
||||
|
||||
public class TestSuiteRepository extends EntityRepository<TestSuite> {
|
||||
@ -26,6 +28,7 @@ public class TestSuiteRepository extends EntityRepository<TestSuite> {
|
||||
@Override
|
||||
public TestSuite setFields(TestSuite entity, EntityUtil.Fields fields) throws IOException {
|
||||
entity.setOwner(fields.contains("owner") ? getOwner(entity) : null);
|
||||
entity.setPipeline(fields.contains("pipelines") ? getIngestionPipeline(entity) : null);
|
||||
return entity;
|
||||
}
|
||||
|
||||
@ -50,6 +53,10 @@ public class TestSuiteRepository extends EntityRepository<TestSuite> {
|
||||
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 TestSuiteUpdater(TestSuite original, TestSuite updated, Operation 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 {
|
||||
return copy(new TestSuite(), create, user)
|
||||
.withDescription(create.getDescription())
|
||||
.withScheduleInterval(create.getScheduleInterval())
|
||||
.withDisplayName(create.getDisplayName())
|
||||
.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#",
|
||||
"title": "DashboardServiceMetadataPipeline",
|
||||
"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#",
|
||||
"title": "DatabaseServiceMetadataPipeline",
|
||||
"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#",
|
||||
"title": "DatabaseServiceProfilerPipeline",
|
||||
"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#",
|
||||
"title": "DatabaseServiceQueryLineagePipeline",
|
||||
"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#",
|
||||
"title": "DatabaseServiceQueryUsagePipeline",
|
||||
"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#",
|
||||
"title": "MessagingServiceMetadataPipeline",
|
||||
"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#",
|
||||
"title": "MlModelServiceMetadataPipeline",
|
||||
"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#",
|
||||
"title": "PipelineServiceMetadataPipeline",
|
||||
"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
|
||||
},
|
||||
"scheduleInterval": {
|
||||
"description": "TestSuite schedule interval in cron format.",
|
||||
"type": "string"
|
||||
"pipeline": {
|
||||
"description": "References to pipelines deployed for this database service to extract metadata, usage, lineage etc..",
|
||||
"$ref": "../type/entityReference.json",
|
||||
"default": null
|
||||
},
|
||||
"owner": {
|
||||
"description": "Owner of this TestCase definition.",
|
||||
|
||||
@ -58,7 +58,6 @@ public class TestSuiteResourceTest extends EntityResourceTest<TestSuite, CreateT
|
||||
throws HttpResponseException {
|
||||
assertEquals(request.getName(), createdEntity.getName());
|
||||
assertEquals(request.getDescription(), createdEntity.getDescription());
|
||||
assertEquals(request.getScheduleInterval(), createdEntity.getScheduleInterval());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -66,7 +65,6 @@ public class TestSuiteResourceTest extends EntityResourceTest<TestSuite, CreateT
|
||||
throws HttpResponseException {
|
||||
assertEquals(expected.getName(), updated.getName());
|
||||
assertEquals(expected.getDescription(), updated.getDescription());
|
||||
assertEquals(expected.getScheduleInterval(), updated.getScheduleInterval());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user