Skip to content

Commit

Permalink
add cypress test case for ingestion pipeline trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
aniketkatkar97 committed Feb 6, 2024
1 parent e592578 commit 3027cf8
Show file tree
Hide file tree
Showing 2 changed files with 94 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ export const TEST_CASE_NAME = `0%test-case-${uuid()}`;
export const TABLE_FQN = `${DATABASE_SERVICE.entity.databaseSchema}.${DATABASE_SERVICE.entity.name}`;
export const TEST_SUITE_FQN = `${TABLE_FQN}.testSuite`;

export const INGESTION_PIPELINE_NAME = `0-cy-ingestion-pipeline-${uuid()}`;

export const OBSERVABILITY_CREATION_DETAILS = {
table: {
triggerDisplayName: 'Table',
Expand Down Expand Up @@ -74,6 +76,53 @@ export const OBSERVABILITY_CREATION_DETAILS = {
},
],
},
ingestionPipeline: {
triggerDisplayName: 'Ingestion Pipeline',
filters: [
{
name: 'Ingestion Pipeline Name',
inputSelector: 'fqn-list-select',
inputValue: INGESTION_PIPELINE_NAME,
exclude: false,
},
{
name: 'Domain',
inputSelector: 'domain-select',
inputValue: DOMAIN_CREATION_DETAILS.name,
exclude: false,
},
{
name: 'Owner Name',
inputSelector: 'owner-name-select',
inputValue: `${USER_DETAILS.firstName}${USER_DETAILS.lastName}`,
exclude: true,
},
],
actions: [
{
name: 'Get Ingestion Pipeline Status Updates',
inputs: [
{
inputSelector: 'pipeline-status-select',
inputValue: 'Queued',
},
],
exclude: false,
},
],
destinations: [
{
mode: 'internal',
category: 'Owners',
type: 'Email',
},
{
mode: 'external',
category: 'Email',
inputValue: 'test@example.com',
},
],
},
testCase: {
triggerDisplayName: 'Test Case',
filters: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,12 @@ import {
toastNotification,
verifyResponseStatusCode,
} from '../../common/common';
import {
createEntityTable,
createSingleLevelEntity,
hardDeleteService,
} from '../../common/EntityUtils';
import { createEntityTable, hardDeleteService } from '../../common/EntityUtils';
import {
ALERT_DESCRIPTION,
ALERT_NAME,
ALERT_UPDATED_DESCRIPTION,
INGESTION_PIPELINE_NAME,
OBSERVABILITY_CREATION_DETAILS,
TABLE_FQN,
TEST_CASE_NAME,
Expand Down Expand Up @@ -108,9 +105,42 @@ describe('Observability Alert Flow', () => {
});

// Create a pipeline
createSingleLevelEntity({
token,
...PIPELINE_SERVICE,
cy.request({
method: 'POST',
url: `/api/v1/services/${PIPELINE_SERVICE.serviceType}`,
headers: { Authorization: `Bearer ${token}` },
body: PIPELINE_SERVICE.service,
}).then((pipelineServiceResponse) => {
data.pipelineService = pipelineServiceResponse.body;

cy.request({
method: 'POST',
url: `/api/v1/${PIPELINE_SERVICE.entityType}`,
headers: { Authorization: `Bearer ${token}` },
body: PIPELINE_SERVICE.entity,
});

// Create a ingestion pipeline
cy.request({
method: 'POST',
url: `/api/v1/services/ingestionPipelines`,
headers: { Authorization: `Bearer ${token}` },
body: {
airflowConfig: {},
loggerLevel: 'INFO',
name: INGESTION_PIPELINE_NAME,
pipelineType: 'metadata',
service: {
id: data.pipelineService.id,
type: 'pipelineService',
},
sourceConfig: {
config: {},
},
},
}).then((ingestionPipelineResponse) => {
data.ingestionPipeline = ingestionPipelineResponse.body;
});
});

// Create a new user
Expand Down Expand Up @@ -154,6 +184,13 @@ describe('Observability Alert Flow', () => {
headers: { Authorization: `Bearer ${token}` },
});

// Delete ingestion pipeline
cy.request({
method: 'DELETE',
url: `/api/v1/services/ingestionPipelines/${data.ingestionPipeline.id}?hardDelete=true`,
headers: { Authorization: `Bearer ${token}` },
});

// Delete created services
hardDeleteService({
token,
Expand Down

0 comments on commit 3027cf8

Please sign in to comment.