Skip to content

Commit

Permalink
Revert "Use admin cert and key when deleting system indices for cypre…
Browse files Browse the repository at this point in the history
…ss test cleanup (opensearch-project#1174)"

This reverts commit a343286.

Signed-off-by: Craig Perkins <[email protected]>
  • Loading branch information
cwperks committed Oct 31, 2024
1 parent 740655b commit d2456f4
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 78 deletions.
12 changes: 0 additions & 12 deletions cypress/plugins/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@
/**
* @type {Cypress.PluginConfig}
*/

const fs = require("fs");
const path = require("path");

module.exports = (on) => {
// const options = {
// webpackOptions: {
Expand All @@ -46,12 +42,4 @@ module.exports = (on) => {
// };
//
// on("file:preprocessor", wp(options));
on("task", {
readCertAndKey() {
const cert = fs.readFileSync(path.resolve(__dirname, "../resources/kirk.pem"));
const key = fs.readFileSync(path.resolve(__dirname, "../resources/kirk-key.pem"));

return { cert, key };
},
});
};
28 changes: 0 additions & 28 deletions cypress/resources/kirk-key.pem

This file was deleted.

27 changes: 0 additions & 27 deletions cypress/resources/kirk.pem

This file was deleted.

12 changes: 1 addition & 11 deletions cypress/utils/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,17 +99,7 @@ Cypress.Commands.add("login", () => {
Cypress.Commands.add("deleteAllIndices", () => {
cy.log("Deleting all indexes");
cy.request("DELETE", `${Cypress.env("openSearchUrl")}/index*,sample*,opensearch_dashboards*`);
cy.task("readCertAndKey").then(({ cert, key }) => {
cy.request({
method: "DELETE",
url: `${Cypress.env("openSearchUrl")}/.opendistro-ism*?expand_wildcards=all`,
headers: {},
agentOptions: {
cert,
key,
},
});
});
cy.request("DELETE", `${Cypress.env("openSearchUrl")}/.opendistro-ism*?expand_wildcards=all`);
});

Cypress.Commands.add("deleteADSystemIndices", () => {
Expand Down

0 comments on commit d2456f4

Please sign in to comment.