Skip to content

Commit

Permalink
[Automatic Import] Add serverless availability cypress test (elastic#…
Browse files Browse the repository at this point in the history
  • Loading branch information
bhapas authored and Samiul-TheSoccerFan committed Dec 10, 2024
1 parent 1be9ee3 commit 4579e33
Show file tree
Hide file tree
Showing 7 changed files with 85 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
steps:
- command: .buildkite/scripts/steps/functional/security_serverless_automatic_import.sh
label: 'Serverless Automatic Import - Security Solution Cypress Tests'
agents:
machineType: n2-standard-4
preemptible: true
depends_on:
- build
- quick_checks
- checks
- linting
- linting_with_types
- check_types
- check_oas_snapshot
timeout_in_minutes: 60
parallelism: 1
retry:
automatic:
- exit_status: '-1'
limit: 1
3 changes: 3 additions & 0 deletions .buildkite/scripts/pipelines/pull_request/pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,9 @@ const getPipeline = (filename: string, removeSteps = true) => {
pipeline.push(
getPipeline('.buildkite/pipelines/pull_request/security_solution/ai_assistant.yml')
);
pipeline.push(
getPipeline('.buildkite/pipelines/pull_request/security_solution/automatic_import.yml')
);
pipeline.push(
getPipeline('.buildkite/pipelines/pull_request/security_solution/detection_engine.yml')
);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

set -euo pipefail

source .buildkite/scripts/steps/functional/common.sh

export JOB=kibana-security-solution-chrome
export KIBANA_INSTALL_DIR=${KIBANA_BUILD_LOCATION}

echo "--- Automatic Import Cypress Tests on Serverless"

cd x-pack/test/security_solution_cypress

set +e
BK_ANALYTICS_API_KEY=$(vault_get security-solution-ci sec-sol-cypress-bk-api-key)

BK_ANALYTICS_API_KEY=$BK_ANALYTICS_API_KEY yarn cypress:automatic_import:run:serverless; status=$?; yarn junit:merge || :; exit $status
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -2148,6 +2148,7 @@ x-pack/test_serverless/functional/test_suites/security/index.mki_only.ts @elasti
/x-pack/plugins/security_solution/public/attack_discovery @elastic/security-generative-ai
/x-pack/test/security_solution_cypress/cypress/e2e/ai_assistant @elastic/security-generative-ai
/x-pack/plugins/security_solution_ess/public/upselling/pages/attack_discovery @elastic/security-generative-ai
/x-pack/test/security_solution_cypress/cypress/e2e/automatic_import @elastic/security-scalability

# Security Solution cross teams ownership
/x-pack/test/security_solution_cypress/cypress/fixtures @elastic/security-detections-response @elastic/security-threat-hunting
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* 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 { ASSISTANT_BUTTON, CREATE_INTEGRATION_LANDING_PAGE } from '../../screens/automatic_import';
import { login } from '../../tasks/login';

describe(
'App Features for Security Essentials',
{
tags: ['@serverless'],
env: {
ftrConfig: {
productTypes: [
{ product_line: 'security', product_tier: 'essentials' },
{ product_line: 'endpoint', product_tier: 'essentials' },
],
},
},
},
() => {
beforeEach(() => {
login();
});

it('should not have Automatic Import available', () => {
cy.visit(CREATE_INTEGRATION_LANDING_PAGE);
cy.get(ASSISTANT_BUTTON).should('not.exist');
});
}
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* 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.
*/

export const CREATE_INTEGRATION_LANDING_PAGE = '/app/integrations/create';
export const ASSISTANT_BUTTON = 'assistantButton';
1 change: 1 addition & 0 deletions x-pack/test/security_solution_cypress/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"cypress:detection_engine:run:serverless": "yarn cypress:serverless --spec './cypress/e2e/detection_response/detection_engine/!(exceptions)/**/*.cy.ts'",
"cypress:detection_engine:exceptions:run:serverless": "yarn cypress:serverless --spec './cypress/e2e/detection_response/detection_engine/exceptions/**/*.cy.ts'",
"cypress:ai_assistant:run:serverless": "yarn cypress:serverless --spec './cypress/e2e/ai_assistant/**/*.cy.ts'",
"cypress:automatic_import:run:serverless": "yarn cypress:serverless --spec './cypress/e2e/automatic_import/**/*.cy.ts'",
"cypress:investigations:run:serverless": "yarn cypress:serverless --spec './cypress/e2e/investigations/**/*.cy.ts'",
"cypress:explore:run:serverless": "yarn cypress:serverless --spec './cypress/e2e/explore/**/*.cy.ts'",
"cypress:changed-specs-only:serverless": "yarn cypress:serverless --changed-specs-only --env burn=5",
Expand Down

0 comments on commit 4579e33

Please sign in to comment.