Skip to content

Commit

Permalink
Remove Destination related Cypress tests
Browse files Browse the repository at this point in the history
Signed-off-by: Mohammad Qureshi <[email protected]>
  • Loading branch information
qreshi committed Apr 19, 2022
1 parent 824830f commit 6593f11
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 181 deletions.
7 changes: 0 additions & 7 deletions cypress/fixtures/sample_destination_chime.json

This file was deleted.

10 changes: 0 additions & 10 deletions cypress/fixtures/sample_destination_custom_webhook.json

This file was deleted.

1 change: 0 additions & 1 deletion cypress/integration/bucket_level_monitor_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import { INDEX, PLUGIN_NAME } from '../support/constants';
import sampleAggregationQuery from '../fixtures/sample_aggregation_query';
import sampleDestination from '../fixtures/sample_destination_custom_webhook';
import sampleExtractionQueryMonitor from '../fixtures/sample_extraction_query_bucket_level_monitor';
import sampleVisualEditorMonitor from '../fixtures/sample_visual_editor_bucket_level_monitor';

Expand Down
1 change: 0 additions & 1 deletion cypress/integration/cluster_metrics_monitor_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* SPDX-License-Identifier: Apache-2.0
*/

import sampleDestination from '../fixtures/sample_destination_custom_webhook';
import sampleClusterMetricsMonitor from '../fixtures/sample_cluster_metrics_monitor.json';
import { INDEX, PLUGIN_NAME } from '../../cypress/support/constants';

Expand Down
137 changes: 0 additions & 137 deletions cypress/integration/destination_spec.js

This file was deleted.

2 changes: 0 additions & 2 deletions cypress/integration/query_level_monitor_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import _ from 'lodash';
import { INDEX, PLUGIN_NAME } from '../support/constants';
import sampleQueryLevelMonitor from '../fixtures/sample_query_level_monitor';
import sampleQueryLevelMonitorWithAlwaysTrueTrigger from '../fixtures/sample_query_level_monitor_with_always_true_trigger';
import sampleDestination from '../fixtures/sample_destination_custom_webhook.json';

const SAMPLE_MONITOR = 'sample_query_level_monitor';
const UPDATED_MONITOR = 'updated_query_level_monitor';
Expand Down Expand Up @@ -314,7 +313,6 @@ describe('Query-Level Monitors', () => {
after(() => {
// Delete all existing monitors and destinations
cy.deleteAllMonitors();
cy.deleteAllDestinations();

// Delete sample data
cy.deleteIndexByName(`${INDEX.SAMPLE_DATA_ECOMMERCE}`);
Expand Down
23 changes: 0 additions & 23 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,6 @@ Cypress.Commands.add('createMonitor', (monitorJSON) => {
cy.request('POST', `${Cypress.env('opensearch')}${API.MONITOR_BASE}`, monitorJSON);
});

Cypress.Commands.add('createDestination', (destinationJSON) => {
cy.request('POST', `${Cypress.env('opensearch')}${API.DESTINATION_BASE}`, destinationJSON);
});

Cypress.Commands.add('createAndExecuteMonitor', (monitorJSON) => {
cy.request('POST', `${Cypress.env('opensearch')}${API.MONITOR_BASE}`, monitorJSON).then(
(response) => {
Expand Down Expand Up @@ -138,25 +134,6 @@ Cypress.Commands.add('deleteAllMonitors', () => {
});
});

Cypress.Commands.add('deleteAllDestinations', () => {
cy.request({
method: 'GET',
url: `${Cypress.env('opensearch')}${API.DESTINATION_BASE}?size=200`,
failOnStatusCode: false, // In case there is no alerting config index in cluster, where the status code is 404
}).then((response) => {
if (response.status === 200) {
for (let i = 0; i < response.body.totalDestinations; i++) {
cy.request(
'DELETE',
`${Cypress.env('opensearch')}${API.DESTINATION_BASE}/${response.body.destinations[i].id}`
);
}
} else {
cy.log('Failed to get all destinations.', response);
}
});
});

Cypress.Commands.add('createIndexByName', (indexName) => {
cy.request('PUT', `${Cypress.env('opensearch')}/${indexName}`);
});
Expand Down

0 comments on commit 6593f11

Please sign in to comment.