Skip to content

Commit

Permalink
[Security Solution] Removing cypress folder (#197273)
Browse files Browse the repository at this point in the history
## Summary

Deleting the Cypress folder that was added in `test_serverless` as a
POC.

Currently is not used and this can create misunderstandings regarding
ownership of it.

---------

Co-authored-by: kibanamachine <[email protected]>
(cherry picked from commit 86e6c74)

# Conflicts:
#	.buildkite/pipelines/pull_request/security_solution/defend_workflows.yml
#	.github/CODEOWNERS
  • Loading branch information
MadameSheema committed Nov 7, 2024
1 parent af3ddd0 commit 1043deb
Show file tree
Hide file tree
Showing 30 changed files with 2,098 additions and 723 deletions.
6 changes: 3 additions & 3 deletions .buildkite/ftr_security_serverless_configs.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
disabled:
# Base config files, only necessary to inform config finding script
- x-pack/test_serverless/functional/test_suites/security/cypress/security_config.base.ts
- x-pack/test_serverless/functional/test_suites/security/cypress/cypress.config.ts
- x-pack/test/security_solution_api_integration/config/serverless/config.base.ts
- x-pack/test/security_solution_api_integration/config/serverless/config.base.essentials.ts
- x-pack/test/security_solution_api_integration/config/serverless/config.base.edr_workflows.ts
- x-pack/test/defend_workflows_cypress/serverless_config.base.ts
- x-pack/test/osquery_cypress/serverless_config.base.ts

# Cypress configs, for now these are still run manually
- x-pack/test/defend_workflows_cypress/serverless_config.ts
- x-pack/test/osquery_cypress/serverless_cli_config.ts
- x-pack/test_serverless/functional/test_suites/security/cypress/security_config.ts
- x-pack/test/security_solution_cypress/serverless_config.ts


# Playwright
- x-pack/test/security_solution_playwright/serverless_config.ts

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,20 @@ steps:
automatic:
- exit_status: '-1'
limit: 1

- command: .buildkite/scripts/steps/functional/defend_workflows_serverless.sh
label: 'Defend Workflows Cypress Tests on Serverless'
agents:
enableNestedVirtualization: true
localSsds: 1
localSsdInterface: nvme
machineType: n2-standard-4
depends_on:
- build
- quick_checks
timeout_in_minutes: 60
parallelism: 14
retry:
automatic:
- exit_status: '-1'
limit: 1

This file was deleted.

2,021 changes: 2,021 additions & 0 deletions .github/CODEOWNERS

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion x-pack/plugins/osquery/cypress/cypress_base.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import path from 'path';
import { safeLoad as loadYaml } from 'js-yaml';
import { readFileSync } from 'fs';
import type { YamlRoleDefinitions } from '@kbn/test-suites-serverless/shared/lib';
import { setupUserDataLoader } from '@kbn/test-suites-serverless/functional/test_suites/security/cypress/support/setup_data_loader_tasks';
import { samlAuthentication } from '@kbn/security-solution-plugin/public/management/cypress/support/saml_authentication';
import { setupUserDataLoader } from './support/setup_data_loader_tasks';
import { getFailedSpecVideos } from './support/filter_videos';

const ROLES_YAML_FILE_PATH = path.join(
Expand Down
11 changes: 11 additions & 0 deletions x-pack/plugins/osquery/cypress/support/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,16 @@ registerCypressGrep();
import type { SecuritySolutionDescribeBlockFtrConfig } from '@kbn/security-solution-plugin/scripts/run_cypress/utils';
import { login } from '@kbn/security-solution-plugin/public/management/cypress/tasks/login';

import type { LoadedRoleAndUser } from '@kbn/test-suites-serverless/shared/lib';
import type { ServerlessRoleName } from './roles';

import { waitUntil } from '../tasks/wait_until';
import { isCloudServerless, isServerless } from '../tasks/serverless';

export interface LoadUserAndRoleCyTaskOptions {
name: ServerlessRoleName;
}

declare global {
// eslint-disable-next-line @typescript-eslint/no-namespace
namespace Cypress {
Expand All @@ -49,6 +54,12 @@ declare global {
}

interface Chainable {
task(
name: 'loadUserAndRole',
arg: LoadUserAndRoleCyTaskOptions,
options?: Partial<Loggable & Timeoutable>
): Chainable<LoadedRoleAndUser>;

getBySel(...args: Parameters<Cypress.Chainable['get']>): Chainable<JQuery<HTMLElement>>;

getBySelContains(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
*/

import { createRuntimeServices } from '@kbn/security-solution-plugin/scripts/endpoint/common/stack_services';
import { LoadUserAndRoleCyTaskOptions } from '../cypress';
import {
import { SecurityRoleAndUserLoader } from '@kbn/test-suites-serverless/shared/lib';
import type {
LoadedRoleAndUser,
SecurityRoleAndUserLoader,
YamlRoleDefinitions,
} from '../../../../../shared/lib';
} from '@kbn/test-suites-serverless/shared/lib';
import type { LoadUserAndRoleCyTaskOptions } from './e2e';

interface AdditionalDefinitions {
roleDefinitions?: YamlRoleDefinitions;
Expand All @@ -33,18 +33,15 @@ export const setupUserDataLoader = (
});

const roleAndUserLoaderPromise: Promise<SecurityRoleAndUserLoader> = stackServicesPromise.then(
({ kbnClient, log }) => {
return new SecurityRoleAndUserLoader(kbnClient, log, roleDefinitions);
}
({ kbnClient, log }) => new SecurityRoleAndUserLoader(kbnClient, log, roleDefinitions)
);

on('task', {
/**
* Loads a user/role into Kibana. Used from `login()` task.
* @param name
*/
loadUserAndRole: async ({ name }: LoadUserAndRoleCyTaskOptions): Promise<LoadedRoleAndUser> => {
return (await roleAndUserLoaderPromise).load(name, additionalRoleName);
},
loadUserAndRole: async ({ name }: LoadUserAndRoleCyTaskOptions): Promise<LoadedRoleAndUser> =>
(await roleAndUserLoaderPromise).load(name, additionalRoleName),
});
};
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { FtrConfigProviderContext } from '@kbn/test';

export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const svlSharedConfig = await readConfigFile(
require.resolve('../../../../shared/config.base.ts')
require.resolve('@kbn/test-suites-serverless/shared/config.base')
);

return {
Expand Down
4 changes: 1 addition & 3 deletions x-pack/test/defend_workflows_cypress/serverless_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ import { DefendWorkflowsCypressCliTestRunner } from './runner';

export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const defendWorkflowsCypressConfig = await readConfigFile(
require.resolve(
'@kbn/test-suites-serverless/functional/test_suites/security/cypress/security_config.base'
)
require.resolve('./serverless_config.base.ts')
);
const config = defendWorkflowsCypressConfig.getAll();
const hostIp = getLocalhostRealIp();
Expand Down
4 changes: 1 addition & 3 deletions x-pack/test/osquery_cypress/serverless_cli_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ import { startOsqueryCypress } from './runner';

export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const securitySolutionCypressConfig = await readConfigFile(
require.resolve(
'@kbn/test-suites-serverless/functional/test_suites/security/cypress/security_config.base'
)
require.resolve('./serverless_config.base.ts')
);

return {
Expand Down
35 changes: 35 additions & 0 deletions x-pack/test/osquery_cypress/serverless_config.base.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { FtrConfigProviderContext } from '@kbn/test';

export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const svlSharedConfig = await readConfigFile(
require.resolve('@kbn/test-suites-serverless/shared/config.base')
);

return {
...svlSharedConfig.getAll(),
esTestCluster: {
...svlSharedConfig.get('esTestCluster'),
serverArgs: [
...svlSharedConfig.get('esTestCluster.serverArgs'),
// define custom es server here
// API Keys is enabled at the top level
],
},
kbnTestServer: {
...svlSharedConfig.get('kbnTestServer'),
serverArgs: [
...svlSharedConfig.get('kbnTestServer.serverArgs'),
'--csp.strict=false',
'--csp.warnLegacyBrowsers=false',
'--serverless=security',
],
},
};
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 1043deb

Please sign in to comment.