diff --git a/.buildkite/pipeline-resource-definitions/security-solution-quality-gate/kibana-serverless-security-solution-quality-gate-defend-workflows.yml b/.buildkite/pipeline-resource-definitions/security-solution-quality-gate/kibana-serverless-security-solution-quality-gate-defend-workflows.yml index 32cd883223c18..b6898c0b87c17 100644 --- a/.buildkite/pipeline-resource-definitions/security-solution-quality-gate/kibana-serverless-security-solution-quality-gate-defend-workflows.yml +++ b/.buildkite/pipeline-resource-definitions/security-solution-quality-gate/kibana-serverless-security-solution-quality-gate-defend-workflows.yml @@ -17,6 +17,7 @@ spec: spec: repository: elastic/kibana pipeline_file: .buildkite/pipelines/security_solution_quality_gate/mki_security_solution_defend_workflows.yml + skip_intermediate_builds: false provider_settings: build_branches: false build_pull_requests: false diff --git a/.buildkite/pipeline-resource-definitions/security-solution-quality-gate/kibana-serverless-security-solution-quality-gate-detection-engine.yml b/.buildkite/pipeline-resource-definitions/security-solution-quality-gate/kibana-serverless-security-solution-quality-gate-detection-engine.yml index 2316a9c543d3c..c6ec39a9b69a0 100644 --- a/.buildkite/pipeline-resource-definitions/security-solution-quality-gate/kibana-serverless-security-solution-quality-gate-detection-engine.yml +++ b/.buildkite/pipeline-resource-definitions/security-solution-quality-gate/kibana-serverless-security-solution-quality-gate-detection-engine.yml @@ -17,6 +17,7 @@ spec: spec: repository: elastic/kibana pipeline_file: .buildkite/pipelines/security_solution_quality_gate/mki_security_solution_detection_engine.yml + skip_intermediate_builds: false provider_settings: build_branches: false build_pull_requests: false diff --git a/.buildkite/pipeline-resource-definitions/security-solution-quality-gate/kibana-serverless-security-solution-quality-gate-entity-analytics.yml b/.buildkite/pipeline-resource-definitions/security-solution-quality-gate/kibana-serverless-security-solution-quality-gate-entity-analytics.yml index 809e2587f659f..294bda432e6ef 100644 --- a/.buildkite/pipeline-resource-definitions/security-solution-quality-gate/kibana-serverless-security-solution-quality-gate-entity-analytics.yml +++ b/.buildkite/pipeline-resource-definitions/security-solution-quality-gate/kibana-serverless-security-solution-quality-gate-entity-analytics.yml @@ -17,6 +17,7 @@ spec: spec: repository: elastic/kibana pipeline_file: .buildkite/pipelines/security_solution_quality_gate/mki_security_solution_entity_analytics.yml + skip_intermediate_builds: false provider_settings: build_branches: false build_pull_requests: false diff --git a/.buildkite/pipeline-resource-definitions/security-solution-quality-gate/kibana-serverless-security-solution-quality-gate-explore.yml b/.buildkite/pipeline-resource-definitions/security-solution-quality-gate/kibana-serverless-security-solution-quality-gate-explore.yml index f1667273282fb..87c33534347ed 100644 --- a/.buildkite/pipeline-resource-definitions/security-solution-quality-gate/kibana-serverless-security-solution-quality-gate-explore.yml +++ b/.buildkite/pipeline-resource-definitions/security-solution-quality-gate/kibana-serverless-security-solution-quality-gate-explore.yml @@ -17,6 +17,7 @@ spec: spec: repository: elastic/kibana pipeline_file: .buildkite/pipelines/security_solution_quality_gate/mki_security_solution_explore.yml + skip_intermediate_builds: false provider_settings: build_branches: false build_pull_requests: false diff --git a/.buildkite/pipeline-resource-definitions/security-solution-quality-gate/kibana-serverless-security-solution-quality-gate-gen-ai.yml b/.buildkite/pipeline-resource-definitions/security-solution-quality-gate/kibana-serverless-security-solution-quality-gate-gen-ai.yml index cca1ab2ae4b42..d80c4bfe3acc1 100644 --- a/.buildkite/pipeline-resource-definitions/security-solution-quality-gate/kibana-serverless-security-solution-quality-gate-gen-ai.yml +++ b/.buildkite/pipeline-resource-definitions/security-solution-quality-gate/kibana-serverless-security-solution-quality-gate-gen-ai.yml @@ -17,6 +17,7 @@ spec: spec: repository: elastic/kibana pipeline_file: .buildkite/pipelines/security_solution_quality_gate/mki_security_solution_gen_ai.yml + skip_intermediate_builds: false provider_settings: build_branches: false build_pull_requests: false diff --git a/.buildkite/pipeline-resource-definitions/security-solution-quality-gate/kibana-serverless-security-solution-quality-gate-investigations.yml b/.buildkite/pipeline-resource-definitions/security-solution-quality-gate/kibana-serverless-security-solution-quality-gate-investigations.yml index 7f4c67c1c14d3..0ba63a9762f95 100644 --- a/.buildkite/pipeline-resource-definitions/security-solution-quality-gate/kibana-serverless-security-solution-quality-gate-investigations.yml +++ b/.buildkite/pipeline-resource-definitions/security-solution-quality-gate/kibana-serverless-security-solution-quality-gate-investigations.yml @@ -17,6 +17,7 @@ spec: spec: repository: elastic/kibana pipeline_file: .buildkite/pipelines/security_solution_quality_gate/mki_security_solution_investigations.yml + skip_intermediate_builds: false provider_settings: build_branches: false build_pull_requests: false diff --git a/.buildkite/pipeline-resource-definitions/security-solution-quality-gate/kibana-serverless-security-solution-quality-gate-rule-management.yml b/.buildkite/pipeline-resource-definitions/security-solution-quality-gate/kibana-serverless-security-solution-quality-gate-rule-management.yml index 8d2d4d4039e06..4579e8961fffb 100644 --- a/.buildkite/pipeline-resource-definitions/security-solution-quality-gate/kibana-serverless-security-solution-quality-gate-rule-management.yml +++ b/.buildkite/pipeline-resource-definitions/security-solution-quality-gate/kibana-serverless-security-solution-quality-gate-rule-management.yml @@ -17,6 +17,7 @@ spec: spec: repository: elastic/kibana pipeline_file: .buildkite/pipelines/security_solution_quality_gate/mki_security_solution_rule_management.yml + skip_intermediate_builds: false provider_settings: build_branches: false build_pull_requests: false diff --git a/.buildkite/pipelines/security_solution/api_integration.yml b/.buildkite/pipelines/security_solution/api_integration.yml index 399a8b996c88b..0ce0e4a1902f6 100644 --- a/.buildkite/pipelines/security_solution/api_integration.yml +++ b/.buildkite/pipelines/security_solution/api_integration.yml @@ -1,6 +1,6 @@ steps: - command: .buildkite/scripts/pipelines/security_solution_quality_gate/upload_image_metadata.sh - label: 'Upload runtime info' + label: "Upload runtime info" key: upload_runtime_info agents: image: family/kibana-ubuntu-2004 @@ -11,533 +11,13 @@ steps: timeout_in_minutes: 300 retry: automatic: - - exit_status: '-1' + - exit_status: "-1" limit: 2 - - group: 'Execute Tests' - key: test_execution - steps: - - label: Running exception_workflows:essentials:qa:serverless - command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh exception_workflows:essentials:qa:serverless - key: exception_workflows:essentials:qa:serverless - agents: - image: family/kibana-ubuntu-2004 - imageProject: elastic-images-qa - provider: gcp - machineType: n2-standard-4 - preemptible: true - timeout_in_minutes: 120 - retry: - automatic: - - exit_status: '*' - limit: 2 + - command: "cat .buildkite/pipelines/security_solution/api_integration_serverless_release.yml | buildkite-agent pipeline upload" + label: 'Upload Release pipeline' + if: "build.env('KIBANA_MKI_QUALITY_GATE') == '1'" - - label: Running exception_operators_date_numeric_types:essentials:qa:serverless - command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh exception_operators_date_numeric_types:essentials:qa:serverless - key: exception_operators_date_numeric_types:essentials:qa:serverless - agents: - image: family/kibana-ubuntu-2004 - imageProject: elastic-images-qa - provider: gcp - machineType: n2-standard-4 - preemptible: true - timeout_in_minutes: 120 - retry: - automatic: - - exit_status: '*' - limit: 2 - - - label: Running exception_operators_keyword:essentials:qa:serverless - command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh exception_operators_keyword:essentials:qa:serverless - key: exception_operators_keyword:essentials:qa:serverless - agents: - image: family/kibana-ubuntu-2004 - imageProject: elastic-images-qa - provider: gcp - machineType: n2-standard-4 - preemptible: true - timeout_in_minutes: 120 - retry: - automatic: - - exit_status: '*' - limit: 2 - - - label: Running exception_operators_ips:essentials:qa:serverless - command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh exception_operators_ips:essentials:qa:serverless - key: exception_operators_ips:essentials:qa:serverless - agents: - image: family/kibana-ubuntu-2004 - imageProject: elastic-images-qa - provider: gcp - machineType: n2-standard-4 - preemptible: true - timeout_in_minutes: 120 - retry: - automatic: - - exit_status: '*' - limit: 2 - - - label: Running exception_operators_long:essentials:qa:serverless - command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh exception_operators_long:essentials:qa:serverless - key: exception_operators_long:essentials:qa:serverless - agents: - image: family/kibana-ubuntu-2004 - imageProject: elastic-images-qa - provider: gcp - machineType: n2-standard-4 - preemptible: true - timeout_in_minutes: 120 - retry: - automatic: - - exit_status: '1' - limit: 2 - - - label: Running exception_operators_text:essentials:qa:serverless - command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh exception_operators_text:essentials:qa:serverless - key: exception_operators_text:essentials:qa:serverless - agents: - image: family/kibana-ubuntu-2004 - imageProject: elastic-images-qa - provider: gcp - machineType: n2-standard-4 - preemptible: true - timeout_in_minutes: 120 - retry: - automatic: - - exit_status: '1' - limit: 2 - - - label: Running alerts:qa:serverless - command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh alerts:qa:serverless - key: alerts:qa:serverless - agents: - image: family/kibana-ubuntu-2004 - imageProject: elastic-images-qa - provider: gcp - machineType: n2-standard-4 - preemptible: true - timeout_in_minutes: 120 - retry: - automatic: - - exit_status: '1' - limit: 2 - - - label: Running alerts:essentials:qa:serverless - command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh alerts:essentials:qa:serverless - key: alerts:essentials:qa:serverless - agents: - image: family/kibana-ubuntu-2004 - imageProject: elastic-images-qa - provider: gcp - machineType: n2-standard-4 - preemptible: true - timeout_in_minutes: 120 - retry: - automatic: - - exit_status: '1' - limit: 2 - - - label: Running actions:qa:serverless - command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh actions:qa:serverless - key: actions:qa:serverless - agents: - image: family/kibana-ubuntu-2004 - imageProject: elastic-images-qa - provider: gcp - machineType: n2-standard-4 - preemptible: true - timeout_in_minutes: 120 - retry: - automatic: - - exit_status: '1' - limit: 2 - - - label: Running genai:qa:serverless - command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh genai:qa:serverless - key: genai:qa:serverless - agents: - image: family/kibana-ubuntu-2004 - imageProject: elastic-images-qa - provider: gcp - machineType: n2-standard-4 - preemptible: true - timeout_in_minutes: 120 - retry: - automatic: - - exit_status: "1" - limit: 2 - - - label: Running rule_execution_logic:qa:serverless - command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh rule_execution_logic:qa:serverless - key: rule_execution_logic:qa:serverless - agents: - image: family/kibana-ubuntu-2004 - imageProject: elastic-images-qa - provider: gcp - machineType: n2-standard-4 - preemptible: true - timeout_in_minutes: 120 - retry: - automatic: - - exit_status: '1' - limit: 2 - - - label: Running rule_patch:qa:serverless - command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh rule_patch:qa:serverless - key: rule_patch:qa:serverless - agents: - image: family/kibana-ubuntu-2004 - imageProject: elastic-images-qa - provider: gcp - machineType: n2-standard-4 - preemptible: true - timeout_in_minutes: 120 - retry: - automatic: - - exit_status: '1' - limit: 2 - - - label: Running rule_patch:essentials:qa:serverless - command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh rule_patch:essentials:qa:serverless - key: rule_patch:essentials:qa:serverless - agents: - image: family/kibana-ubuntu-2004 - imageProject: elastic-images-qa - provider: gcp - machineType: n2-standard-4 - preemptible: true - timeout_in_minutes: 120 - retry: - automatic: - - exit_status: '1' - limit: 2 - - - label: Running rule_update:qa:serverless - command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh rule_update:qa:serverless - key: rule_update:qa:serverless - agents: - image: family/kibana-ubuntu-2004 - imageProject: elastic-images-qa - provider: gcp - machineType: n2-standard-4 - preemptible: true - timeout_in_minutes: 120 - retry: - automatic: - - exit_status: '1' - limit: 2 - - - label: Running rule_update:essentials:qa:serverless - command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh rule_update:essentials:qa:serverless - key: rule_update:essentials:qa:serverless - agents: - image: family/kibana-ubuntu-2004 - imageProject: elastic-images-qa - provider: gcp - machineType: n2-standard-4 - preemptible: true - timeout_in_minutes: 120 - retry: - automatic: - - exit_status: '1' - limit: 2 - - - label: Running rules_management:essentials:qa:serverless - command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh rules_management:essentials:qa:serverless - key: rules_management:essentials:qa:serverless - agents: - image: family/kibana-ubuntu-2004 - imageProject: elastic-images-qa - provider: gcp - machineType: n2-standard-4 - preemptible: true - timeout_in_minutes: 120 - retry: - automatic: - - exit_status: '1' - limit: 2 - - - label: Running prebuilt_rules_management:qa:serverless - command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh prebuilt_rules_management:qa:serverless - key: prebuilt_rules_management:qa:serverless - agents: - image: family/kibana-ubuntu-2004 - imageProject: elastic-images-qa - provider: gcp - machineType: n2-standard-4 - preemptible: true - timeout_in_minutes: 120 - retry: - automatic: - - exit_status: '1' - limit: 2 - - - label: Running prebuilt_rules_bundled_prebuilt_rules_package:qa:serverless - command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh prebuilt_rules_bundled_prebuilt_rules_package:qa:serverless - key: prebuilt_rules_bundled_prebuilt_rules_package:qa:serverless - agents: - image: family/kibana-ubuntu-2004 - imageProject: elastic-images-qa - provider: gcp - machineType: n2-standard-4 - preemptible: true - timeout_in_minutes: 120 - retry: - automatic: - - exit_status: '1' - limit: 2 - - - label: Running prebuilt_rules_large_prebuilt_rules_package:qa:serverless - command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh prebuilt_rules_large_prebuilt_rules_package:qa:serverless - key: prebuilt_rules_large_prebuilt_rules_package:qa:serverless - agents: - image: family/kibana-ubuntu-2004 - imageProject: elastic-images-qa - provider: gcp - machineType: n2-standard-4 - preemptible: true - timeout_in_minutes: 120 - retry: - automatic: - - exit_status: '1' - limit: 2 - - - label: Running prebuilt_rules_update_prebuilt_rules_package:qa:serverless - command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh prebuilt_rules_update_prebuilt_rules_package:qa:serverless - key: prebuilt_rules_update_prebuilt_rules_package:qa:serverless - agents: - image: family/kibana-ubuntu-2004 - imageProject: elastic-images-qa - provider: gcp - machineType: n2-standard-4 - preemptible: true - timeout_in_minutes: 120 - retry: - automatic: - - exit_status: '1' - limit: 2 - - - label: Running rule_bulk_actions:qa:serverless - command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh rule_bulk_actions:qa:serverless - key: rule_bulk_actions:qa:serverless - agents: - image: family/kibana-ubuntu-2004 - imageProject: elastic-images-qa - provider: gcp - machineType: n2-standard-4 - preemptible: true - timeout_in_minutes: 120 - retry: - automatic: - - exit_status: '1' - limit: 2 - - - label: Running rule_read:qa:serverless - command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh rule_read:qa:serverless - key: rule_read:qa:serverless - agents: - image: family/kibana-ubuntu-2004 - imageProject: elastic-images-qa - provider: gcp - machineType: n2-standard-4 - preemptible: true - timeout_in_minutes: 120 - retry: - automatic: - - exit_status: '1' - limit: 2 - - - label: Running rule_import_export:essentials:qa:serverless - command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh rule_import_export:essentials:qa:serverless - key: rule_import_export:essentials:qa:serverless - agents: - image: family/kibana-ubuntu-2004 - imageProject: elastic-images-qa - provider: gcp - machineType: n2-standard-4 - preemptible: true - timeout_in_minutes: 120 - retry: - automatic: - - exit_status: '1' - limit: 2 - - - label: Running rule_import_export:qa:serverless - command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh rule_import_export:qa:serverless - key: rule_import_export:qa:serverless - agents: - image: family/kibana-ubuntu-2004 - imageProject: elastic-images-qa - provider: gcp - machineType: n2-standard-4 - preemptible: true - timeout_in_minutes: 120 - retry: - automatic: - - exit_status: '1' - limit: 2 - - - - label: Running rule_management:qa:serverless - command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh rule_management:qa:serverless - key: rule_management:qa:serverless - agents: - image: family/kibana-ubuntu-2004 - imageProject: elastic-images-qa - provider: gcp - machineType: n2-standard-4 - preemptible: true - timeout_in_minutes: 120 - retry: - automatic: - - exit_status: '1' - limit: 2 - - - label: Running rule_read:essentials:qa:serverless - command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh rule_read:essentials:qa:serverless - key: rule_read:essentials:qa:serverless - agents: - image: family/kibana-ubuntu-2004 - imageProject: elastic-images-qa - provider: gcp - machineType: n2-standard-4 - preemptible: true - timeout_in_minutes: 120 - retry: - automatic: - - exit_status: '1' - limit: 2 - - - label: Running rule_creation:qa:serverless - command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh rule_creation:qa:serverless - key: rule_creation:qa:serverless - agents: - image: family/kibana-ubuntu-2004 - imageProject: elastic-images-qa - provider: gcp - machineType: n2-standard-4 - preemptible: true - timeout_in_minutes: 120 - retry: - automatic: - - exit_status: '1' - limit: 2 - - - label: Running rule_creation:essentials:qa:serverless - command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh rule_creation:essentials:qa:serverless - key: rule_creation:essentials:qa:serverless - agents: - image: family/kibana-ubuntu-2004 - imageProject: elastic-images-qa - provider: gcp - machineType: n2-standard-4 - preemptible: true - timeout_in_minutes: 120 - retry: - automatic: - - exit_status: '1' - limit: 2 - - - label: Running rule_delete:qa:serverless - command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh rule_delete:qa:serverless - key: rule_delete:qa:serverless - agents: - image: family/kibana-ubuntu-2004 - imageProject: elastic-images-qa - provider: gcp - machineType: n2-standard-4 - preemptible: true - timeout_in_minutes: 120 - retry: - automatic: - - exit_status: '1' - limit: 2 - - - label: Running rule_delete:essentials:qa:serverless - command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh rule_delete:essentials:qa:serverless - key: rule_delete:essentials:qa:serverless - agents: - image: family/kibana-ubuntu-2004 - imageProject: elastic-images-qa - provider: gcp - machineType: n2-standard-4 - preemptible: true - timeout_in_minutes: 120 - retry: - automatic: - - exit_status: '1' - limit: 2 - - - label: Running exception_lists_items:qa:serverless - command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh exception_lists_items:qa:serverless - key: exception_lists_items:qa:serverless - agents: - image: family/kibana-ubuntu-2004 - imageProject: elastic-images-qa - provider: gcp - machineType: n2-standard-4 - preemptible: true - timeout_in_minutes: 120 - retry: - automatic: - - exit_status: '1' - limit: 2 - - - label: Running lists_items:qa:serverless - command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh lists_items:qa:serverless - key: lists_items:qa:serverless - agents: - image: family/kibana-ubuntu-2004 - imageProject: elastic-images-qa - provider: gcp - machineType: n2-standard-4 - preemptible: true - timeout_in_minutes: 120 - retry: - automatic: - - exit_status: '1' - limit: 2 - - - label: Running user_roles:qa:serverless - command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh user_roles:qa:serverless - key: user_roles:qa:serverless - agents: - image: family/kibana-ubuntu-2004 - imageProject: elastic-images-qa - provider: gcp - machineType: n2-standard-4 - preemptible: true - timeout_in_minutes: 120 - retry: - automatic: - - exit_status: '1' - limit: 2 - - - label: Running telemetry:qa:serverless - command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh telemetry:qa:serverless - key: telemetry:qa:serverless - agents: - image: family/kibana-ubuntu-2004 - imageProject: elastic-images-qa - provider: gcp - machineType: n2-standard-4 - preemptible: true - timeout_in_minutes: 120 - retry: - automatic: - - exit_status: '1' - limit: 2 - - label: Running entity_analytics:qa:serverless - command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh entity_analytics:qa:serverless - key: entity_analytics:qa:serverless - agents: - image: family/kibana-ubuntu-2004 - imageProject: elastic-images-qa - provider: gcp - machineType: n2-standard-4 - preemptible: true - timeout_in_minutes: 120 - retry: - automatic: - - exit_status: '1' - limit: 2 + - command: "cat .buildkite/pipelines/security_solution/api_integration_serverless_periodic.yml | buildkite-agent pipeline upload" + label: 'Upload Periodic Serverless Pipeline' + if: "build.env('KIBANA_MKI_QUALITY_GATE') != '1'" diff --git a/.buildkite/pipelines/security_solution/api_integration_serverless_periodic.yml b/.buildkite/pipelines/security_solution/api_integration_serverless_periodic.yml new file mode 100644 index 0000000000000..fc994511cd109 --- /dev/null +++ b/.buildkite/pipelines/security_solution/api_integration_serverless_periodic.yml @@ -0,0 +1,528 @@ +steps: + - group: "API Integration Serverless Periodic Tests" + key: test_execution + steps: + - label: Running exception_workflows:essentials:qa:serverless + command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh exception_workflows:essentials:qa:serverless + key: exception_workflows:essentials:qa:serverless + agents: + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true + timeout_in_minutes: 120 + retry: + automatic: + - exit_status: "*" + limit: 2 + + - label: Running exception_operators_date_numeric_types:essentials:qa:serverless + command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh exception_operators_date_numeric_types:essentials:qa:serverless + key: exception_operators_date_numeric_types:essentials:qa:serverless + agents: + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true + timeout_in_minutes: 120 + retry: + automatic: + - exit_status: "*" + limit: 2 + + - label: Running exception_operators_keyword:essentials:qa:serverless + command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh exception_operators_keyword:essentials:qa:serverless + key: exception_operators_keyword:essentials:qa:serverless + agents: + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true + timeout_in_minutes: 120 + retry: + automatic: + - exit_status: "*" + limit: 2 + + - label: Running exception_operators_ips:essentials:qa:serverless + command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh exception_operators_ips:essentials:qa:serverless + key: exception_operators_ips:essentials:qa:serverless + agents: + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true + timeout_in_minutes: 120 + retry: + automatic: + - exit_status: "*" + limit: 2 + + - label: Running exception_operators_long:essentials:qa:serverless + command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh exception_operators_long:essentials:qa:serverless + key: exception_operators_long:essentials:qa:serverless + agents: + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true + timeout_in_minutes: 120 + retry: + automatic: + - exit_status: "1" + limit: 2 + + - label: Running exception_operators_text:essentials:qa:serverless + command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh exception_operators_text:essentials:qa:serverless + key: exception_operators_text:essentials:qa:serverless + agents: + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true + timeout_in_minutes: 120 + retry: + automatic: + - exit_status: "1" + limit: 2 + + - label: Running alerts:qa:serverless + command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh alerts:qa:serverless + key: alerts:qa:serverless + agents: + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true + timeout_in_minutes: 120 + retry: + automatic: + - exit_status: "1" + limit: 2 + + - label: Running alerts:essentials:qa:serverless + command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh alerts:essentials:qa:serverless + key: alerts:essentials:qa:serverless + agents: + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true + timeout_in_minutes: 120 + retry: + automatic: + - exit_status: "1" + limit: 2 + + - label: Running actions:qa:serverless + command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh actions:qa:serverless + key: actions:qa:serverless + agents: + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true + timeout_in_minutes: 120 + retry: + automatic: + - exit_status: "1" + limit: 2 + + - label: Running genai:qa:serverless + command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh genai:qa:serverless + key: genai:qa:serverless + agents: + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true + timeout_in_minutes: 120 + retry: + automatic: + - exit_status: "1" + limit: 2 + + - label: Running rule_execution_logic:qa:serverless + command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh rule_execution_logic:qa:serverless + key: rule_execution_logic:qa:serverless + agents: + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true + timeout_in_minutes: 120 + retry: + automatic: + - exit_status: "1" + limit: 2 + + - label: Running rule_patch:qa:serverless + command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh rule_patch:qa:serverless + key: rule_patch:qa:serverless + agents: + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true + timeout_in_minutes: 120 + retry: + automatic: + - exit_status: "1" + limit: 2 + + - label: Running rule_patch:essentials:qa:serverless + command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh rule_patch:essentials:qa:serverless + key: rule_patch:essentials:qa:serverless + agents: + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true + timeout_in_minutes: 120 + retry: + automatic: + - exit_status: "1" + limit: 2 + + - label: Running rule_update:qa:serverless + command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh rule_update:qa:serverless + key: rule_update:qa:serverless + agents: + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true + timeout_in_minutes: 120 + retry: + automatic: + - exit_status: "1" + limit: 2 + + - label: Running rule_update:essentials:qa:serverless + command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh rule_update:essentials:qa:serverless + key: rule_update:essentials:qa:serverless + agents: + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true + timeout_in_minutes: 120 + retry: + automatic: + - exit_status: "1" + limit: 2 + + - label: Running rules_management:essentials:qa:serverless + command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh rules_management:essentials:qa:serverless + key: rules_management:essentials:qa:serverless + agents: + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true + timeout_in_minutes: 120 + retry: + automatic: + - exit_status: "1" + limit: 2 + + - label: Running prebuilt_rules_management:qa:serverless + command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh prebuilt_rules_management:qa:serverless + key: prebuilt_rules_management:qa:serverless + agents: + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true + timeout_in_minutes: 120 + retry: + automatic: + - exit_status: "1" + limit: 2 + + - label: Running prebuilt_rules_bundled_prebuilt_rules_package:qa:serverless + command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh prebuilt_rules_bundled_prebuilt_rules_package:qa:serverless + key: prebuilt_rules_bundled_prebuilt_rules_package:qa:serverless + agents: + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true + timeout_in_minutes: 120 + retry: + automatic: + - exit_status: "1" + limit: 2 + + - label: Running prebuilt_rules_large_prebuilt_rules_package:qa:serverless + command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh prebuilt_rules_large_prebuilt_rules_package:qa:serverless + key: prebuilt_rules_large_prebuilt_rules_package:qa:serverless + agents: + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true + timeout_in_minutes: 120 + retry: + automatic: + - exit_status: "1" + limit: 2 + + - label: Running prebuilt_rules_update_prebuilt_rules_package:qa:serverless + command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh prebuilt_rules_update_prebuilt_rules_package:qa:serverless + key: prebuilt_rules_update_prebuilt_rules_package:qa:serverless + agents: + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true + timeout_in_minutes: 120 + retry: + automatic: + - exit_status: "1" + limit: 2 + + - label: Running rule_bulk_actions:qa:serverless + command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh rule_bulk_actions:qa:serverless + key: rule_bulk_actions:qa:serverless + agents: + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true + timeout_in_minutes: 120 + retry: + automatic: + - exit_status: "1" + limit: 2 + + - label: Running rule_read:qa:serverless + command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh rule_read:qa:serverless + key: rule_read:qa:serverless + agents: + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true + timeout_in_minutes: 120 + retry: + automatic: + - exit_status: "1" + limit: 2 + + - label: Running rule_import_export:essentials:qa:serverless + command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh rule_import_export:essentials:qa:serverless + key: rule_import_export:essentials:qa:serverless + agents: + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true + timeout_in_minutes: 120 + retry: + automatic: + - exit_status: "1" + limit: 2 + + - label: Running rule_import_export:qa:serverless + command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh rule_import_export:qa:serverless + key: rule_import_export:qa:serverless + agents: + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true + timeout_in_minutes: 120 + retry: + automatic: + - exit_status: "1" + limit: 2 + + - label: Running rule_management:qa:serverless + command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh rule_management:qa:serverless + key: rule_management:qa:serverless + agents: + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true + timeout_in_minutes: 120 + retry: + automatic: + - exit_status: "1" + limit: 2 + + - label: Running rule_read:essentials:qa:serverless + command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh rule_read:essentials:qa:serverless + key: rule_read:essentials:qa:serverless + agents: + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true + timeout_in_minutes: 120 + retry: + automatic: + - exit_status: "1" + limit: 2 + + - label: Running rule_creation:qa:serverless + command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh rule_creation:qa:serverless + key: rule_creation:qa:serverless + agents: + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true + timeout_in_minutes: 120 + retry: + automatic: + - exit_status: "1" + limit: 2 + + - label: Running rule_creation:essentials:qa:serverless + command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh rule_creation:essentials:qa:serverless + key: rule_creation:essentials:qa:serverless + agents: + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true + timeout_in_minutes: 120 + retry: + automatic: + - exit_status: "1" + limit: 2 + + - label: Running rule_delete:qa:serverless + command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh rule_delete:qa:serverless + key: rule_delete:qa:serverless + agents: + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true + timeout_in_minutes: 120 + retry: + automatic: + - exit_status: "1" + limit: 2 + + - label: Running rule_delete:essentials:qa:serverless + command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh rule_delete:essentials:qa:serverless + key: rule_delete:essentials:qa:serverless + agents: + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true + timeout_in_minutes: 120 + retry: + automatic: + - exit_status: "1" + limit: 2 + + - label: Running exception_lists_items:qa:serverless + command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh exception_lists_items:qa:serverless + key: exception_lists_items:qa:serverless + agents: + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true + timeout_in_minutes: 120 + retry: + automatic: + - exit_status: "1" + limit: 2 + + - label: Running lists_items:qa:serverless + command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh lists_items:qa:serverless + key: lists_items:qa:serverless + agents: + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true + timeout_in_minutes: 120 + retry: + automatic: + - exit_status: "1" + limit: 2 + + - label: Running user_roles:qa:serverless + command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh user_roles:qa:serverless + key: user_roles:qa:serverless + agents: + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true + timeout_in_minutes: 120 + retry: + automatic: + - exit_status: "1" + limit: 2 + + - label: Running telemetry:qa:serverless + command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh telemetry:qa:serverless + key: telemetry:qa:serverless + agents: + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true + timeout_in_minutes: 120 + retry: + automatic: + - exit_status: "1" + limit: 2 + + - label: Running entity_analytics:qa:serverless + command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh entity_analytics:qa:serverless + key: entity_analytics:qa:serverless + agents: + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true + timeout_in_minutes: 120 + retry: + automatic: + - exit_status: "1" + limit: 2 diff --git a/.buildkite/pipelines/security_solution/api_integration_serverless_release.yml b/.buildkite/pipelines/security_solution/api_integration_serverless_release.yml index f1b9d002209d0..045f4b5b662db 100644 --- a/.buildkite/pipelines/security_solution/api_integration_serverless_release.yml +++ b/.buildkite/pipelines/security_solution/api_integration_serverless_release.yml @@ -1,111 +1,151 @@ steps: - - group: 'API Integration Serverless Release Tests' + - group: "API Integration Serverless Release Tests" key: test_execution steps: - - label: Running integration tests for Serverless Exception Workflows - command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh exception_workflows:qa:serverless:release - key: exception_workflows:qa:serverless:release + - label: Running exception_workflows:essentials:qa:serverless:release + command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh exception_workflows:essentials:qa:serverless:release + key: exception_workflows:essentials:qa:serverless:release agents: - queue: n2-4-spot + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true timeout_in_minutes: 120 retry: automatic: - - exit_status: '*' + - exit_status: "*" limit: 2 - - label: Running exception_operators_date_numeric_types:qa:serverless:release - command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh exception_operators_date_numeric_types:qa:serverless:release - key: exception_operators_date_numeric_types:qa:serverless:release + - label: Running exception_operators_date_numeric_types:essentials:qa:serverless:release + command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh exception_operators_date_numeric_types:essentials:qa:serverless:release + key: exception_operators_date_numeric_types:essentials:qa:serverless:release agents: - queue: n2-4-spot + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true timeout_in_minutes: 120 retry: automatic: - - exit_status: '*' + - exit_status: "*" limit: 2 - - label: Running exception_operators_keyword:qa:serverless:release - command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh exception_operators_keyword:qa:serverless:release - key: exception_operators_keyword:qa:serverless:release + - label: Running exception_operators_keyword:essentials:qa:serverless:release + command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh exception_operators_keyword:essentials:qa:serverless:release + key: exception_operators_keyword:essentials:qa:serverless:release agents: - queue: n2-4-spot + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true timeout_in_minutes: 120 retry: automatic: - - exit_status: '*' + - exit_status: "*" limit: 2 - - label: Running exception_operators_ips:qa:serverless:release - command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh exception_operators_ips:qa:serverless:release - key: exception_operators_ips:qa:serverless:release + - label: Running exception_operators_ips:essentials:qa:serverless:release + command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh exception_operators_ips:essentials:qa:serverless:release + key: exception_operators_ips:essentials:qa:serverless:release agents: - queue: n2-4-spot + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true timeout_in_minutes: 120 retry: automatic: - - exit_status: '*' + - exit_status: "*" limit: 2 - - label: Running exception_operators_long:qa:serverless:release + - label: Running exception_operators_long:essentials:qa:serverless:release command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh exception_operators_long:qa:serverless:release - key: exception_operators_long:qa:serverless:release + key: exception_operators_long:essentials:qa:serverless:release agents: - queue: n2-4-spot + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true timeout_in_minutes: 120 retry: automatic: - - exit_status: '1' + - exit_status: "1" limit: 2 - - label: Running exception_operators_text:qa:serverless:release - command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh exception_operators_text:qa:serverless:release - key: exception_operators_text:qa:serverless:release + - label: Running exception_operators_text:essentials:qa:serverless:release + command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh exception_operators_text:essentials:qa:serverless:release + key: exception_operators_text:essentials:qa:serverless:release agents: - queue: n2-4-spot + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true timeout_in_minutes: 120 retry: automatic: - - exit_status: '1' + - exit_status: "1" limit: 2 - label: Running alerts:qa:serverless:release command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh alerts:qa:serverless:release key: alerts:qa:serverless:release agents: - queue: n2-4-spot + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true timeout_in_minutes: 120 retry: automatic: - - exit_status: '1' + - exit_status: "1" limit: 2 - label: Running alerts:essentials:qa:serverless:release command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh alerts:essentials:qa:serverless:release key: alerts:essentials:qa:serverless:release agents: - queue: n2-4-spot + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true timeout_in_minutes: 120 retry: automatic: - - exit_status: '1' + - exit_status: "1" limit: 2 - label: Running actions:qa:serverless:release command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh actions:qa:serverless:release key: actions:qa:serverless:release agents: - queue: n2-4-spot + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true timeout_in_minutes: 120 retry: automatic: - - exit_status: '1' + - exit_status: "1" limit: 2 - label: Running genai:qa:serverless:release command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh genai:qa:serverless:release key: genai:qa:serverless:release agents: - queue: n2-4-spot + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true timeout_in_minutes: 120 retry: automatic: @@ -116,273 +156,373 @@ steps: command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh rule_execution_logic:qa:serverless:release key: rule_execution_logic:qa:serverless:release agents: - queue: n2-4-spot + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true timeout_in_minutes: 120 retry: automatic: - - exit_status: '1' + - exit_status: "1" limit: 2 - label: Running rule_patch:qa:serverless:release command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh rule_patch:qa:serverless:release key: rule_patch:qa:serverless:release agents: - queue: n2-4-spot + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true timeout_in_minutes: 120 retry: automatic: - - exit_status: '1' + - exit_status: "1" limit: 2 - label: Running rule_patch:essentials:qa:serverless:release command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh rule_patch:essentials:qa:serverless:release key: rule_patch:essentials:qa:serverless:release agents: - queue: n2-4-spot + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true timeout_in_minutes: 120 retry: automatic: - - exit_status: '1' + - exit_status: "1" limit: 2 - label: Running rule_update:qa:serverless:release command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh rule_update:qa:serverless:release key: rule_update:qa:serverless:release agents: - queue: n2-4-spot + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true timeout_in_minutes: 120 retry: automatic: - - exit_status: '1' + - exit_status: "1" limit: 2 - label: Running rule_update:essentials:qa:serverless:release command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh rule_update:essentials:qa:serverless:release key: rule_update:essentials:qa:serverless:release agents: - queue: n2-4-spot + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true timeout_in_minutes: 120 retry: automatic: - - exit_status: '1' + - exit_status: "1" limit: 2 - label: Running rules_management:essentials:qa:serverless:release command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh rules_management:essentials:qa:serverless:release key: rules_management:essentials:qa:serverless:release agents: - queue: n2-4-spot + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true timeout_in_minutes: 120 retry: automatic: - - exit_status: '1' + - exit_status: "1" limit: 2 - label: Running prebuilt_rules_management:qa:serverless:release command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh prebuilt_rules_management:qa:serverless:release key: prebuilt_rules_management:qa:serverless:release agents: - queue: n2-4-spot + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true timeout_in_minutes: 120 retry: automatic: - - exit_status: '1' + - exit_status: "1" limit: 2 - label: Running prebuilt_rules_bundled_prebuilt_rules_package:qa:serverless:release command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh prebuilt_rules_bundled_prebuilt_rules_package:qa:serverless:release key: prebuilt_rules_bundled_prebuilt_rules_package:qa:serverless:release agents: - queue: n2-4-spot + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true timeout_in_minutes: 120 retry: automatic: - - exit_status: '1' + - exit_status: "1" limit: 2 - label: Running prebuilt_rules_large_prebuilt_rules_package:qa:serverless:release command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh prebuilt_rules_large_prebuilt_rules_package:qa:serverless:release key: prebuilt_rules_large_prebuilt_rules_package:qa:serverless:release agents: - queue: n2-4-spot + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true timeout_in_minutes: 120 retry: automatic: - - exit_status: '1' + - exit_status: "1" limit: 2 - label: Running prebuilt_rules_update_prebuilt_rules_package:qa:serverless:release command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh prebuilt_rules_update_prebuilt_rules_package:qa:serverless:release key: prebuilt_rules_update_prebuilt_rules_package:qa:serverless:release agents: - queue: n2-4-spot + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true timeout_in_minutes: 120 retry: automatic: - - exit_status: '1' + - exit_status: "1" limit: 2 - label: Running rule_bulk_actions:qa:serverless:release command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh rule_bulk_actions:qa:serverless:release key: rule_bulk_actions:qa:serverless:release agents: - queue: n2-4-spot + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true timeout_in_minutes: 120 retry: automatic: - - exit_status: '1' + - exit_status: "1" limit: 2 - label: Running rule_read:qa:serverless:release command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh rule_read:qa:serverless:release key: rule_read:qa:serverless:release agents: - queue: n2-4-spot + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true timeout_in_minutes: 120 retry: automatic: - - exit_status: '1' + - exit_status: "1" limit: 2 - label: Running rule_import_export:essentials:qa:serverless:release command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh rule_import_export:essentials:qa:serverless:release key: rule_import_export:essentials:qa:serverless:release agents: - queue: n2-4-spot + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true timeout_in_minutes: 120 retry: automatic: - - exit_status: '1' + - exit_status: "1" limit: 2 - label: Running rule_import_export:qa:serverless:release command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh rule_import_export:qa:serverless:release key: rule_import_export:qa:serverless:release agents: - queue: n2-4-spot + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true timeout_in_minutes: 120 retry: automatic: - - exit_status: '1' + - exit_status: "1" limit: 2 - - label: Running rule_management:qa:serverless:release command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh rule_management:qa:serverless:release key: rule_management:qa:serverless:release agents: - queue: n2-4-spot + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true timeout_in_minutes: 120 retry: automatic: - - exit_status: '1' + - exit_status: "1" limit: 2 - label: Running rule_read:essentials:qa:serverless:release command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh rule_read:essentials:qa:serverless:release key: rule_read:essentials:qa:serverless:release agents: - queue: n2-4-spot + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true timeout_in_minutes: 120 retry: automatic: - - exit_status: '1' + - exit_status: "1" limit: 2 - label: Running rule_creation:qa:serverless:release command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh rule_creation:qa:serverless:release key: rule_creation:qa:serverless:release agents: - queue: n2-4-spot + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true timeout_in_minutes: 120 retry: automatic: - - exit_status: '1' + - exit_status: "1" limit: 2 - label: Running rule_creation:essentials:qa:serverless:release command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh rule_creation:essentials:qa:serverless:release key: rule_creation:essentials:qa:serverless:release agents: - queue: n2-4-spot + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true timeout_in_minutes: 120 retry: automatic: - - exit_status: '1' + - exit_status: "1" limit: 2 - label: Running rule_delete:qa:serverless:release command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh rule_delete:qa:serverless:release key: rule_delete:qa:serverless:release agents: - queue: n2-4-spot + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true timeout_in_minutes: 120 retry: automatic: - - exit_status: '1' + - exit_status: "1" limit: 2 - label: Running rule_delete:essentials:qa:serverless:release command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh rule_delete:essentials:qa:serverless:release key: rule_delete:essentials:qa:serverless:release agents: - queue: n2-4-spot + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true timeout_in_minutes: 120 retry: automatic: - - exit_status: '1' + - exit_status: "1" limit: 2 - label: Running exception_lists_items:qa:serverless:release command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh exception_lists_items:qa:serverless:release key: exception_lists_items:qa:serverless:release agents: - queue: n2-4-spot + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true timeout_in_minutes: 120 retry: automatic: - - exit_status: '1' + - exit_status: "1" limit: 2 - label: Running lists_items:qa:serverless:release command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh lists_items:qa:serverless:release key: lists_items:qa:serverless:release agents: - queue: n2-4-spot + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true timeout_in_minutes: 120 retry: automatic: - - exit_status: '1' + - exit_status: "1" limit: 2 - label: Running user_roles:qa:serverless:release command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh user_roles:qa:serverless:release key: user_roles:qa:serverless:release agents: - queue: n2-4-spot + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true timeout_in_minutes: 120 retry: automatic: - - exit_status: '1' + - exit_status: "1" limit: 2 - label: Running telemetry:qa:serverless:release command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh telemetry:qa:serverless:release key: telemetry:qa:serverless:release agents: - queue: n2-4-spot + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true timeout_in_minutes: 120 retry: automatic: - - exit_status: '1' + - exit_status: "1" limit: 2 + - label: Running entity_analytics:qa:serverless:release command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh entity_analytics:qa:serverless:release key: entity_analytics:qa:serverless:release agents: - queue: n2-4-spot + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-qa + provider: gcp + machineType: n2-standard-4 + preemptible: true timeout_in_minutes: 120 retry: automatic: - - exit_status: '1' + - exit_status: "1" limit: 2 diff --git a/.buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh b/.buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh index 6b2706c10067b..23231465932dd 100755 --- a/.buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh +++ b/.buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh @@ -5,6 +5,8 @@ if [ -z "$1" ] exit 1 fi +set -euo pipefail + source .buildkite/scripts/common/util.sh .buildkite/scripts/bootstrap.sh @@ -12,120 +14,8 @@ buildkite-agent meta-data set "${BUILDKITE_JOB_ID}_is_test_execution_step" "true source .buildkite/scripts/pipelines/security_solution_quality_gate/prepare_vault_entries.sh -cd x-pack/test/security_solution_api_integration -set +e - -# Generate a random 5-digit number -random_number=$((10000 + $RANDOM % 90000)) -# Check the healthcheck of the proxy service -response=$(curl -s -o /dev/null -w "%{http_code}" "$PROXY_URL/healthcheck") -echo "Proxy Healthcheck Response code: $response" - -if [ "$response" -eq 200 ]; then - # Proxy service is up and running. Use the proxy to handle the projects. - CREATE_URL="$PROXY_URL/projects" - RESET_CREDS_URL="$PROXY_URL/projects/{project_id}/_reset-internal-credentials" - DELETE_URL="$PROXY_URL/projects/{project_id}" - AUTH="Basic $(vault_get security-solution-quality-gate-proxy base_64_encoded_auth)" -else - # Proxy service is not available. Use default single org execution mode using cloud QA directly. - CREATE_URL="$QA_CONSOLE_URL/api/v1/serverless/projects/security" - RESET_CREDS_URL="$QA_CONSOLE_URL/api/v1/serverless/projects/security/{project_id}/_reset-internal-credentials" - DELETE_URL="$QA_CONSOLE_URL/api/v1/serverless/projects/security/{project_id}" - AUTH="ApiKey $CLOUD_QA_API_KEY" -fi - - -if [ -z "${KIBANA_MKI_IMAGE_COMMIT+x}" ]; then - # There is no provided commit to be used so running against whatever image - # is already qualified in Cloud QA. - ENVIRONMENT_DETAILS=$(curl --location "$CREATE_URL" \ - --header "Authorization: $AUTH" \ - --header 'Content-Type: application/json' \ - --data '{ - "name": "ftr-integration-tests-'$random_number'", - "region_id": "aws-eu-west-1"}' | jq '.') -else - # A commit is provided so it will be used to run the tests against this qualified image. - KBN_COMMIT_HASH=${KIBANA_MKI_IMAGE_COMMIT:0:12} - ENVIRONMENT_DETAILS=$(curl --location "$CREATE_URL" \ - --header "Authorization: $AUTH" \ - --header 'Content-Type: application/json' \ - --data '{ - "name": "ftr-integration-tests-'$random_number'", - "region_id": "aws-eu-west-1", - "overrides": { - "kibana": { - "docker_image" : "docker.elastic.co/kibana-ci/kibana-serverless:git-'$KBN_COMMIT_HASH'" - } - } - }' | jq '.') -fi - -if [ "$response" -eq 200 ]; then - # Proxy is up and running so reading the ES and KB endpoints from the proxy response. - ES_URL=$(echo $ENVIRONMENT_DETAILS | jq -r '.elasticsearch_endpoint') - KB_URL=$(echo $ENVIRONMENT_DETAILS | jq -r '.kibana_endpoint') - ID=$(echo $ENVIRONMENT_DETAILS | jq -r '.project_id') -else - # Proxy is unavailable so reading the ES and KB endpoints from the cloud QA response. - ES_URL=$(echo $ENVIRONMENT_DETAILS | jq -r '.endpoints.elasticsearch') - KB_URL=$(echo $ENVIRONMENT_DETAILS | jq -r '.endpoints.kibana') - ID=$(echo $ENVIRONMENT_DETAILS | jq -r '.id') -fi -NAME=$(echo $ENVIRONMENT_DETAILS | jq -r '.name') - -# Wait five seconds for the project to appear -sleep 5 - -# Resetting the credentials of the elastic user in the project -RESET_CREDENTIALS_URL=$(echo "$RESET_CREDS_URL" | sed "s/{project_id}/$ID/g") -CREDS_BODY=$(curl -s --location --request POST "$RESET_CREDENTIALS_URL" \ - --header "Authorization: $AUTH" \ - --header 'Content-Type: application/json' | jq '.') -USERNAME=$(echo $CREDS_BODY | jq -r '.username') -PASSWORD=$(echo $CREDS_BODY | jq -r '.password') -PROJECT_AUTH=$(echo "$USERNAME:$PASSWORD") - -# Checking if Elasticsearch has status green -while : ; do - STATUS=$(curl -u $PROJECT_AUTH --location "$ES_URL:443/_cluster/health?wait_for_status=green&timeout=50s" | jq -r '.status') - if [ "$STATUS" != "green" ]; then - echo "Sleeping for 40s to wait for ES status to be green..." - sleep 40 - else - echo "Elasticsearch has status green." - break - fi -done - -# Checking if Kibana is available -while : ; do - STATUS=$(curl -u $PROJECT_AUTH --location "$KB_URL:443/api/status" | jq -r '.status.overall.level') - if [ "$STATUS" != "available" ]; then - echo "Sleeping for 15s to wait for Kibana to be available..." - sleep 15 - else - echo "Kibana is available." - break - fi -done - -# Removing the https:// part of the url provided in order to use it in the command below. -FORMATTED_ES_URL="${ES_URL/https:\/\//}" -FORMATTED_KB_URL="${KB_URL/https:\/\//}" - -# Find a way to remove this in the future -# This is used in order to wait for the environment to be ready. -sleep 150 - -echo "--- Triggering API tests for $1" -TEST_CLOUD=1 TEST_ES_URL="https://$USERNAME:$PASSWORD@$FORMATTED_ES_URL:443" TEST_KIBANA_URL="https://$USERNAME:$PASSWORD@$FORMATTED_KB_URL:443" yarn run $1 +echo "--- Running test script $1" +TARGET_SCRIPT=$1 node .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/start_api_ftr_execution cmd_status=$? echo "Exit code with status: $cmd_status" - -DELETE_PROJECT_URL=$(echo "$DELETE_URL" | sed "s/{project_id}/$ID/g") -curl --location --request DELETE "$DELETE_PROJECT_URL" \ - --header "Authorization: $AUTH" - exit $cmd_status diff --git a/.buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api_ftr_execution.ts b/.buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api_ftr_execution.ts new file mode 100644 index 0000000000000..75e8371df15da --- /dev/null +++ b/.buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api_ftr_execution.ts @@ -0,0 +1,160 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { run } from '@kbn/dev-cli-runner'; +import { ToolingLog } from '@kbn/tooling-log'; +import { exec } from 'child_process'; +import crypto from 'crypto'; + +import type { ProjectHandler } from '@kbn/security-solution-plugin/scripts/run_cypress/project_handler/project_handler'; +import { CloudHandler } from '@kbn/security-solution-plugin/scripts/run_cypress/project_handler/cloud_project_handler'; +import { ProxyHandler } from '@kbn/security-solution-plugin/scripts/run_cypress/project_handler/proxy_project_handler'; +import { + proxyHealthcheck, + waitForEsStatusGreen, + waitForKibanaAvailable, + waitForEsAccess, +} from '@kbn/security-solution-plugin/scripts/run_cypress/parallel_serverless'; + +const BASE_ENV_URL = `${process.env.QA_CONSOLE_URL}`; +const PROJECT_NAME_PREFIX = 'kibana-ftr-api-integration-security-solution'; + +// Function to execute a command and return a Promise with the status code +function executeCommand(command: string, envVars: any, workDir: string): Promise { + return new Promise((resolve, reject) => { + const childProcess = exec(command, { env: envVars, cwd: workDir }, (error, stdout, stderr) => { + if (error) { + console.error(`exec error: ${error}`); + process.exitCode = error.code; + } + }); + + // Listen and print stdout data + childProcess.stdout?.on('data', (data) => { + console.log(data); + }); + + // Listen and print stderr data + childProcess.stderr?.on('data', (data) => { + console.log(data); + }); + + // Listen for process exit + childProcess.on('exit', (code) => { + console.log(`Node process for target ${process.env.TARGET_SCRIPT} exits with code : ${code}`); + if (code !== 0) { + reject(code); + return; + } + resolve(code); + }); + }); +} + +export const cli = () => { + run( + async (context) => { + const log = new ToolingLog({ + level: 'info', + writeTo: process.stdout, + }); + + const PROXY_URL = process.env.PROXY_URL ? process.env.PROXY_URL : undefined; + const PROXY_SECRET = process.env.PROXY_SECRET ? process.env.PROXY_SECRET : undefined; + const PROXY_CLIENT_ID = process.env.PROXY_CLIENT_ID ? process.env.PROXY_CLIENT_ID : undefined; + const API_KEY = process.env.CLOUD_QA_API_KEY ? process.env.CLOUD_QA_API_KEY : undefined; + + log.info(`PROXY_URL is defined : ${PROXY_URL !== undefined}`); + log.info(`PROXY_CLIENT_ID is defined : ${PROXY_CLIENT_ID !== undefined}`); + log.info(`PROXY_SECRET is defined : ${PROXY_SECRET !== undefined}`); + log.info(`API_KEY is defined : ${API_KEY !== undefined}`); + + let cloudHandler: ProjectHandler; + if (PROXY_URL && PROXY_CLIENT_ID && PROXY_SECRET && (await proxyHealthcheck(PROXY_URL))) { + log.info('Proxy service is up and running, so the tests will run using the proxyHandler.'); + cloudHandler = new ProxyHandler(PROXY_URL, PROXY_CLIENT_ID, PROXY_SECRET); + } else if (API_KEY) { + log.info('Proxy service is unavailable, so the tests will run using the cloudHandler.'); + cloudHandler = new CloudHandler(API_KEY, BASE_ENV_URL); + } else { + log.info('PROXY_URL or API KEY which are needed to create project could not be retrieved.'); + + return process.exit(1); + } + + const id = crypto.randomBytes(8).toString('hex'); + const PROJECT_NAME = `${PROJECT_NAME_PREFIX}-${id}`; + + // Creating project for the test to run + const project = await cloudHandler.createSecurityProject(PROJECT_NAME); + log.info(project); + + if (!project) { + log.error('Failed to create project.'); + + return process.exit(1); + } + let statusCode: number = 0; + try { + // Reset credentials for elastic user + const credentials = await cloudHandler.resetCredentials(project.id, id); + + if (!credentials) { + log.error('Credentials could not be reset.'); + + return process.exit(1); + } + + // Wait for project to be initialized + await cloudHandler.waitForProjectInitialized(project.id); + + // Base64 encode the credentials in order to invoke ES and KB APIs + const auth = btoa(`${credentials.username}:${credentials.password}`); + + // Wait for elasticsearch status to go green. + await waitForEsStatusGreen(project.es_url, auth, id); + + // Wait until Kibana is available + await waitForKibanaAvailable(project.kb_url, auth, id); + + // Wait for Elasticsearch to be accessible + await waitForEsAccess(project.es_url, auth, id); + + const FORMATTED_ES_URL = project.es_url.replace('https://', ''); + const FORMATTED_KB_URL = project.kb_url.replace('https://', ''); + + const command = `yarn run ${process.env.TARGET_SCRIPT}`; + const testCloud = 1; + const testEsUrl = `https://${credentials.username}:${credentials.password}@${FORMATTED_ES_URL}`; + const testKibanaUrl = `https://${credentials.username}:${credentials.password}@${FORMATTED_KB_URL}`; + const workDir = 'x-pack/test/security_solution_api_integration'; + const envVars = { + ...process.env, + TEST_CLOUD: testCloud.toString(), + TEST_ES_URL: testEsUrl, + TEST_KIBANA_URL: testKibanaUrl, + }; + + statusCode = await executeCommand(command, envVars, workDir); + } catch (err) { + log.error('An error occured when running the test script.'); + log.error(err); + } finally { + // Delete serverless project + log.info(`${id} : Deleting project ${PROJECT_NAME}...`); + await cloudHandler.deleteSecurityProject(project.id, PROJECT_NAME); + } + process.exit(statusCode); + }, + { + flags: { + allowUnexpected: true, + }, + } + ); +}; diff --git a/.buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/start_api_ftr_execution.js b/.buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/start_api_ftr_execution.js new file mode 100644 index 0000000000000..2ee5715a0fe2b --- /dev/null +++ b/.buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/start_api_ftr_execution.js @@ -0,0 +1,10 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +require('../../../../../src/setup_node_env'); +require('./api_ftr_execution').cli(); diff --git a/x-pack/plugins/security_solution/scripts/run_cypress/parallel_serverless.ts b/x-pack/plugins/security_solution/scripts/run_cypress/parallel_serverless.ts index 0790601d8614c..57a5e9705e7cf 100644 --- a/x-pack/plugins/security_solution/scripts/run_cypress/parallel_serverless.ts +++ b/x-pack/plugins/security_solution/scripts/run_cypress/parallel_serverless.ts @@ -43,7 +43,11 @@ const DEFAULT_CONFIGURATION: Readonly = [ const PROJECT_NAME_PREFIX = 'kibana-cypress-security-solution-ephemeral'; const BASE_ENV_URL = `${process.env.QA_CONSOLE_URL}`; -let log: ToolingLog; +let log: ToolingLog = new ToolingLog({ + level: 'info', + writeTo: process.stdout, +}); + const API_HEADERS = Object.freeze({ 'kbn-xsrf': 'cypress-creds', 'x-elastic-internal-origin': 'security-solution', @@ -66,7 +70,7 @@ const getApiKeyFromElasticCloudJsonFile = (): string | undefined => { }; // Check if proxy service is up and running executing a healthcheck call. -function proxyHealthcheck(proxyUrl: string): Promise { +export function proxyHealthcheck(proxyUrl: string): Promise { const fetchHealthcheck = async (attemptNum: number) => { log.info(`Retry number ${attemptNum} to check if Elasticsearch is green.`); @@ -89,7 +93,7 @@ function proxyHealthcheck(proxyUrl: string): Promise { } // Wait until elasticsearch status goes green -function waitForEsStatusGreen(esUrl: string, auth: string, runnerId: string): Promise { +export function waitForEsStatusGreen(esUrl: string, auth: string, runnerId: string): Promise { const fetchHealthStatusAttempt = async (attemptNum: number) => { log.info(`Retry number ${attemptNum} to check if Elasticsearch is green.`); @@ -120,7 +124,11 @@ function waitForEsStatusGreen(esUrl: string, auth: string, runnerId: string): Pr } // Wait until Kibana is available -function waitForKibanaAvailable(kbUrl: string, auth: string, runnerId: string): Promise { +export function waitForKibanaAvailable( + kbUrl: string, + auth: string, + runnerId: string +): Promise { const fetchKibanaStatusAttempt = async (attemptNum: number) => { log.info(`Retry number ${attemptNum} to check if kibana is available.`); const response = await axios @@ -154,7 +162,7 @@ function waitForKibanaAvailable(kbUrl: string, auth: string, runnerId: string): } // Wait for Elasticsearch to be accessible -function waitForEsAccess(esUrl: string, auth: string, runnerId: string): Promise { +export function waitForEsAccess(esUrl: string, auth: string, runnerId: string): Promise { const fetchEsAccessAttempt = async (attemptNum: number) => { log.info(`Retry number ${attemptNum} to check if can be accessed.`); @@ -239,11 +247,6 @@ const getProductTypes = ( export const cli = () => { run( async (context) => { - log = new ToolingLog({ - level: 'info', - writeTo: process.stdout, - }); - // Checking if API key is either provided via env variable or in ~/.elastic.cloud.json // This works for either local executions or fallback in case proxy service is unavailable. if (!process.env.CLOUD_QA_API_KEY && !getApiKeyFromElasticCloudJsonFile()) { diff --git a/x-pack/plugins/security_solution/scripts/run_cypress/project_handler/cloud_project_handler.ts b/x-pack/plugins/security_solution/scripts/run_cypress/project_handler/cloud_project_handler.ts index 89166701ee206..dd1e2c8762909 100644 --- a/x-pack/plugins/security_solution/scripts/run_cypress/project_handler/cloud_project_handler.ts +++ b/x-pack/plugins/security_solution/scripts/run_cypress/project_handler/cloud_project_handler.ts @@ -28,15 +28,18 @@ export class CloudHandler extends ProjectHandler { // Method to invoke the create project API for serverless. async createSecurityProject( projectName: string, - productTypes: ProductType[], - commit: string + productTypes?: ProductType[], + commit?: string ): Promise { const body: CreateProjectRequestBody = { name: projectName, region_id: DEFAULT_REGION, - product_types: productTypes, }; + if (productTypes) { + body.product_types = productTypes; + } + if (process.env.KIBANA_MKI_IMAGE_COMMIT || commit) { const override = commit ? commit : process.env.KIBANA_MKI_IMAGE_COMMIT; const kibanaOverrideImage = `${override?.substring(0, 12)}`; diff --git a/x-pack/plugins/security_solution/scripts/run_cypress/project_handler/project_handler.ts b/x-pack/plugins/security_solution/scripts/run_cypress/project_handler/project_handler.ts index 199df9c4fb4c0..f84bc6d9961ce 100644 --- a/x-pack/plugins/security_solution/scripts/run_cypress/project_handler/project_handler.ts +++ b/x-pack/plugins/security_solution/scripts/run_cypress/project_handler/project_handler.ts @@ -65,8 +65,8 @@ export class ProjectHandler { // Method to invoke the create project API for serverless. async createSecurityProject( projectName: string, - productTypes: ProductType[], - commit: string + productTypes?: ProductType[], + commit?: string ): Promise { throw new Error(this.DEFAULT_ERROR_MSG); } diff --git a/x-pack/plugins/security_solution/scripts/run_cypress/project_handler/proxy_project_handler.ts b/x-pack/plugins/security_solution/scripts/run_cypress/project_handler/proxy_project_handler.ts index 08e5b418b83ac..b438849d85b4c 100644 --- a/x-pack/plugins/security_solution/scripts/run_cypress/project_handler/proxy_project_handler.ts +++ b/x-pack/plugins/security_solution/scripts/run_cypress/project_handler/proxy_project_handler.ts @@ -28,15 +28,18 @@ export class ProxyHandler extends ProjectHandler { // Method to invoke the create project API for serverless. async createSecurityProject( projectName: string, - productTypes: ProductType[], - commit: string + productTypes?: ProductType[], + commit?: string ): Promise { const body: CreateProjectRequestBody = { name: projectName, region_id: DEFAULT_REGION, - product_types: productTypes, }; + if (productTypes) { + body.product_types = productTypes; + } + if (process.env.KIBANA_MKI_IMAGE_COMMIT || commit) { const override = commit ? commit : process.env.KIBANA_MKI_IMAGE_COMMIT; const kibanaOverrideImage = `${override?.substring(0, 12)}`; diff --git a/x-pack/test/security_solution_api_integration/package.json b/x-pack/test/security_solution_api_integration/package.json index ff58c521ccd15..0bc8eadbb5fe5 100644 --- a/x-pack/test/security_solution_api_integration/package.json +++ b/x-pack/test/security_solution_api_integration/package.json @@ -223,7 +223,7 @@ "prebuilt_rules_large_prebuilt_rules_package:server:serverless": "npm run initialize-server:rm prebuilt_rules/large_prebuilt_rules_package serverless", "prebuilt_rules_large_prebuilt_rules_package:runner:serverless": "npm run run-tests:rm prebuilt_rules/large_prebuilt_rules_package serverless serverlessEnv", "prebuilt_rules_large_prebuilt_rules_package:qa:serverless": "npm run run-tests:rm prebuilt_rules/large_prebuilt_rules_package serverless qaPeriodicEnv", - "prebuilt_rules_large_prebuilt_rules_package:qa:serverles:release": "npm run run-tests:rm prebuilt_rules/large_prebuilt_rules_package serverlessQA qaEnv", + "prebuilt_rules_large_prebuilt_rules_package:qa:serverless:release": "npm run run-tests:rm prebuilt_rules/large_prebuilt_rules_package serverlessQA qaEnv", "prebuilt_rules_large_prebuilt_rules_package:server:ess": "npm run initialize-server:rm prebuilt_rules/large_prebuilt_rules_package ess", "prebuilt_rules_large_prebuilt_rules_package:runner:ess": "npm run run-tests:rm prebuilt_rules/large_prebuilt_rules_package ess essEnv", diff --git a/x-pack/test/security_solution_api_integration/scripts/index.js b/x-pack/test/security_solution_api_integration/scripts/index.js index 6cc8dd1ef5c7a..52f4964aa5111 100644 --- a/x-pack/test/security_solution_api_integration/scripts/index.js +++ b/x-pack/test/security_solution_api_integration/scripts/index.js @@ -47,5 +47,11 @@ const child = spawn('node', [command, '--config', configPath, ...grepArgs, ...ar }); child.on('close', (code) => { - console.log(`child process exited with code ${code}`); + console.log(`[index.js] child process closed with code ${code}`); +}); + +// Listen for process exit +child.on('exit', (code) => { + console.log(`[index.js] child process exited with code ${code}`); + process.exit(code); });