Skip to content

Commit

Permalink
[8.x] [Automatic Import] Add serverless availability cypress test (el…
Browse files Browse the repository at this point in the history
…astic#202872) (elastic#203207)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Automatic Import] Add serverless availability cypress test
(elastic#202872)](elastic#202872)

<!--- Backport version: 8.9.8 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Bharat
Pasupula","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-12-05T20:25:07Z","message":"[Automatic
Import] Add serverless availability cypress test
(elastic#202872)","sha":"5145d76fb1159b7a574eafaacbcf57e51cf00273","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["test","release_note:skip","v9.0.0","backport:prev-minor","Team:Security-Scalability","Feature:AutomaticImport"],"number":202872,"url":"https://github.com/elastic/kibana/pull/202872","mergeCommit":{"message":"[Automatic
Import] Add serverless availability cypress test
(elastic#202872)","sha":"5145d76fb1159b7a574eafaacbcf57e51cf00273"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/202872","number":202872,"mergeCommit":{"message":"[Automatic
Import] Add serverless availability cypress test
(elastic#202872)","sha":"5145d76fb1159b7a574eafaacbcf57e51cf00273"}}]}]
BACKPORT-->
  • Loading branch information
bhapas authored Dec 6, 2024
1 parent c1d707c commit da176d3
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 @@ -1582,6 +1582,7 @@ x-pack/test/api_integration/apis/management/index_management/inference_endpoints
/x-pack/plugins/security_solution/public/assistant @elastic/security-generative-ai
/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/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 da176d3

Please sign in to comment.