From b02c73509972cf6f76d86512e85d58ce169b875e Mon Sep 17 00:00:00 2001 From: Konrad Szwarc Date: Tue, 7 Jan 2025 10:39:49 +0100 Subject: [PATCH] [EDR Workflows][Osquery] Re enable Cypress execution in CI/QA (#205478) --- .../plugins/shared/osquery/cypress/cypress_base.config.ts | 4 ++-- .../plugins/shared/osquery/cypress/e2e/all/cases.cy.ts | 4 ++-- x-pack/platform/plugins/shared/osquery/package.json | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/x-pack/platform/plugins/shared/osquery/cypress/cypress_base.config.ts b/x-pack/platform/plugins/shared/osquery/cypress/cypress_base.config.ts index 7594d33496ddc..b9e60e48ba630 100644 --- a/x-pack/platform/plugins/shared/osquery/cypress/cypress_base.config.ts +++ b/x-pack/platform/plugins/shared/osquery/cypress/cypress_base.config.ts @@ -27,7 +27,7 @@ export const getCypressBaseConfig = ( { reporter: '../../../../../node_modules/cypress-multi-reporters', reporterOptions: { - configFile: './reporter_config.json', + configFile: './cypress/reporter_config.json', }, defaultCommandTimeout: 60000, @@ -53,7 +53,7 @@ export const getCypressBaseConfig = ( }, e2e: { - specPattern: './e2e/**/*.cy.ts', + specPattern: './cypress/e2e/**/*.cy.ts', experimentalRunAllSpecs: true, experimentalMemoryManagement: true, numTestsKeptInMemory: 3, diff --git a/x-pack/platform/plugins/shared/osquery/cypress/e2e/all/cases.cy.ts b/x-pack/platform/plugins/shared/osquery/cypress/e2e/all/cases.cy.ts index 0f12414149126..aed0fa2388135 100644 --- a/x-pack/platform/plugins/shared/osquery/cypress/e2e/all/cases.cy.ts +++ b/x-pack/platform/plugins/shared/osquery/cypress/e2e/all/cases.cy.ts @@ -48,7 +48,7 @@ describe('Add to Cases', () => { it('should add result a case and not have add to timeline in result', () => { addLiveQueryToCase(liveQueryId, caseId); - cy.contains(`${caseTitle} has been updated`); + cy.contains(`Case ${caseTitle} updated`); viewRecentCaseAndCheckResults(); cy.contains(liveQueryQuery); @@ -80,7 +80,7 @@ describe('Add to Cases', () => { it('should add result a case and have add to timeline in result', () => { addLiveQueryToCase(liveQueryId, caseId); - cy.contains(`${caseTitle} has been updated`); + cy.contains(`Case ${caseTitle} updated`); viewRecentCaseAndCheckResults(); cy.contains("SELECT * FROM os_version where name='Ubuntu';"); diff --git a/x-pack/platform/plugins/shared/osquery/package.json b/x-pack/platform/plugins/shared/osquery/package.json index fda5a3830020b..38a52123c522a 100644 --- a/x-pack/platform/plugins/shared/osquery/package.json +++ b/x-pack/platform/plugins/shared/osquery/package.json @@ -7,13 +7,13 @@ "scripts": { "cypress:burn": "yarn cypress:run --env burn=2 --headed", "cypress:changed-specs-only": "yarn cypress:run --changed-specs-only --env burn=2", - "cypress": "NODE_OPTIONS=--openssl-legacy-provider node ../../../../solutions/security/plugins/security_solution/scripts/start_cypress_parallel --config-file ../../platform/plugins/shared/osquery/cypress/serverless_cypress.config.ts --ftr-config-file ../../../../../x-pack/test/osquery_cypress/cli_config", + "cypress": "NODE_OPTIONS=--openssl-legacy-provider node ../../../../solutions/security/plugins/security_solution/scripts/start_cypress_parallel --config-file ../../platform/plugins/shared/osquery/cypress/cypress.config.ts --ftr-config-file ../../../../../x-pack/test/osquery_cypress/cli_config", "cypress:open": "yarn cypress open", "cypress:run": "yarn cypress run", "cypress:serverless": "NODE_OPTIONS=--openssl-legacy-provider node ../../../../solutions/security/plugins/security_solution/scripts/start_cypress_parallel --config-file ../../platform/plugins/shared/osquery/cypress/serverless_cypress.config.ts --ftr-config-file ../../../../../x-pack/test/osquery_cypress/serverless_cli_config", "cypress:serverless:open": "yarn cypress:serverless open", "cypress:serverless:run": "yarn cypress:serverless run", - "cypress:qa:serverless": "NODE_OPTIONS=--openssl-legacy-provider node ../../../../solutions/security/plugins/security_solution/scripts/start_cypress_parallel_serverless --config-file ../../platform/plugins/shared/osquery/cypress/serverless_cypress.config.ts --onBeforeHook ../../../../test/osquery_cypress/runner_qa.ts", + "cypress:qa:serverless": "NODE_OPTIONS=--openssl-legacy-provider node ../../../../solutions/security/plugins/security_solution/scripts/start_cypress_parallel_serverless --config-file ../../platform/plugins/shared/osquery/cypress/serverless_cypress_qa.config.ts --onBeforeHook ../../../../test/osquery_cypress/runner_qa.ts", "cypress:qa:serverless:run": "yarn cypress:qa:serverless run", "nyc": "../../../../../node_modules/.bin/nyc report --reporter=text-summary", "junit:merge": "../../../../../node_modules/.bin/mochawesome-merge ../../../target/kibana-osquery/cypress/results/mochawesome*.json > ../../../target/kibana-osquery/cypress/results/output.json && ../../../node_modules/.bin/marge ../../../target/kibana-osquery/cypress/results/output.json --reportDir ../../../target/kibana-osquery/cypress/results && yarn junit:transform && mkdir -p ../../../target/junit && cp ../../../target/kibana-osquery/cypress/results/*.xml ../../../target/junit/",