From 81693310430e5b348b6769ef7bd100b40180fd5e Mon Sep 17 00:00:00 2001 From: dkirchan Date: Tue, 30 Apr 2024 16:09:04 +0300 Subject: [PATCH 01/15] WIP: curl to TS --- .../security_solution/api_integration.yml | 1028 ++++++++--------- .../api_integration/api-integration-tests.sh | 248 ++-- .../api_integration/api_ftr_execution.ts | 125 ++ .../start_api_ftr_execution.js | 9 + .../run_cypress/parallel_serverless.ts | 8 +- 5 files changed, 784 insertions(+), 634 deletions(-) create mode 100644 .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api_ftr_execution.ts create mode 100644 .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/start_api_ftr_execution.js diff --git a/.buildkite/pipelines/security_solution/api_integration.yml b/.buildkite/pipelines/security_solution/api_integration.yml index 399a8b996c88b..92552fc5608bd 100644 --- a/.buildkite/pipelines/security_solution/api_integration.yml +++ b/.buildkite/pipelines/security_solution/api_integration.yml @@ -27,517 +27,517 @@ steps: 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 + # 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/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..34bc6782c218f 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,134 @@ 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 -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 +node .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/start_api_ftr_execution +ts-node .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/start_api_ftr_execution + + +# 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 +# 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..697966c12e78a --- /dev/null +++ b/.buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api_ftr_execution.ts @@ -0,0 +1,125 @@ +/* + * 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 axios, { AxiosError } from 'axios'; +import { run } from '@kbn/dev-cli-runner'; +import { ToolingLog } from '@kbn/tooling-log'; +import { exec } from 'child_process'; +import crypto from 'crypto'; + +import type { + Credentials, + ProjectHandler, +} from '../../../../../x-pack/plugins/security_solution/scripts/run_cypress/project_handler/project_handler'; +import { CloudHandler } from '../../../../../x-pack/plugins/security_solution/scripts/run_cypress/project_handler/cloud_project_handler'; +import { ProxyHandler } from '../../../../../x-pack/plugins/security_solution/scripts/run_cypress/project_handler/proxy_project_handler'; +import { + proxyHealthcheck, + waitForEsStatusGreen, + waitForKibanaAvailable, + waitForEsAccess, +} from '../../../../../x-pack/plugins/security_solution/scripts/run_cypress/parallel_serverless'; + +const BASE_ENV_URL = `${process.env.QA_CONSOLE_URL}`; +const PROJECT_NAME_PREFIX = 'kibana-ftr-api-integration-security-solution'; + +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.'); + // eslint-disable-next-line no-process-exit + 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.'); + // eslint-disable-next-line no-process-exit + return process.exit(1); + } + + // Reset credentials for elastic user + const credentials = await cloudHandler.resetCredentials(project.id, id); + + if (!credentials) { + log.error('Credentials could not be reset.'); + // eslint-disable-next-line no-process-exit + 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); + + try { + log.info('test'); + exec('pwd', (error, stdout, stderr) => { + if (error) { + log.error(`exec error: ${error}`); + return; + } + + log.info(`stdout: ${stdout}`); + log.error(`stderr: ${stderr}`); + }); + } catch (ex) { + console.error('PR pipeline error', ex.message); + process.exit(1); + } + + // Delete serverless project + log.info(`${id} : Deleting project ${PROJECT_NAME}...`); + await cloudHandler.deleteSecurityProject(project.id, PROJECT_NAME); + }, + { + 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..f54323aec01aa --- /dev/null +++ b/.buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/start_api_ftr_execution.js @@ -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. + */ + +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..e45153c8e6a80 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 @@ -66,7 +66,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 +89,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 +120,7 @@ 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 +154,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.`); From f59b6ea3bf7e5cc2c6f8e9f90a3fcc3b6eeb5e26 Mon Sep 17 00:00:00 2001 From: dkirchan Date: Tue, 30 Apr 2024 17:49:19 +0300 Subject: [PATCH 02/15] Fixed intermediate builds skip for security quality gate in kibana --- ...security-solution-quality-gate-defend-workflows.yml | 1 + ...security-solution-quality-gate-detection-engine.yml | 1 + ...security-solution-quality-gate-entity-analytics.yml | 1 + ...rverless-security-solution-quality-gate-explore.yml | 1 + ...erverless-security-solution-quality-gate-gen-ai.yml | 1 + ...s-security-solution-quality-gate-investigations.yml | 1 + ...-security-solution-quality-gate-rule-management.yml | 1 + .../api_integration/api-integration-tests.sh | 2 +- .../scripts/run_cypress/parallel_serverless.ts | 10 +++++----- 9 files changed, 13 insertions(+), 6 deletions(-) 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/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 34bc6782c218f..50fddb81022e0 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 @@ -16,7 +16,7 @@ source .buildkite/scripts/pipelines/security_solution_quality_gate/prepare_vault node .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/start_api_ftr_execution -ts-node .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/start_api_ftr_execution +# ts-node .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/start_api_ftr_execution # cd x-pack/test/security_solution_api_integration 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 e45153c8e6a80..a3836202cbda1 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', @@ -239,10 +243,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. From c1a473ba6088812e49e1216ddfc9699d206e971b Mon Sep 17 00:00:00 2001 From: dkirchan Date: Tue, 30 Apr 2024 18:28:19 +0300 Subject: [PATCH 03/15] Running target script --- .../api_integration/api-integration-tests.sh | 2 +- .../api_integration/api_ftr_execution.ts | 39 ++++++++++++------- 2 files changed, 27 insertions(+), 14 deletions(-) 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 50fddb81022e0..8e9377636c193 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 @@ -15,7 +15,7 @@ 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 -node .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/start_api_ftr_execution +TARGET_SCRIPT=$1 node .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/start_api_ftr_execution # ts-node .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/start_api_ftr_execution 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 index 697966c12e78a..c16f4febb9287 100644 --- 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 @@ -6,16 +6,12 @@ * Side Public License, v 1. */ -// import axios, { AxiosError } from 'axios'; import { run } from '@kbn/dev-cli-runner'; import { ToolingLog } from '@kbn/tooling-log'; import { exec } from 'child_process'; import crypto from 'crypto'; -import type { - Credentials, - ProjectHandler, -} from '../../../../../x-pack/plugins/security_solution/scripts/run_cypress/project_handler/project_handler'; +import type { ProjectHandler } from '../../../../../x-pack/plugins/security_solution/scripts/run_cypress/project_handler/project_handler'; import { CloudHandler } from '../../../../../x-pack/plugins/security_solution/scripts/run_cypress/project_handler/cloud_project_handler'; import { ProxyHandler } from '../../../../../x-pack/plugins/security_solution/scripts/run_cypress/project_handler/proxy_project_handler'; import { @@ -98,14 +94,31 @@ export const cli = () => { try { log.info('test'); - exec('pwd', (error, stdout, stderr) => { - if (error) { - log.error(`exec error: ${error}`); - return; - } - - log.info(`stdout: ${stdout}`); - log.error(`stderr: ${stderr}`); + 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}:443`; + const testKibanaUrl = `https://${credentials.username}:${credentials.password}@${FORMATTED_KB_URL}:443`; + 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, + }; + const childProcess = exec(command, { env: envVars, cwd: workDir }); + + childProcess.stdout?.on('data', (data) => { + log.info(data); + }); + childProcess.stderr?.on('data', (data) => { + console.error(data); + }); + + childProcess.on('exit', (code) => { + console.log(`Exit code with status: ${code}`); }); } catch (ex) { console.error('PR pipeline error', ex.message); From b72754698212ede15dc4b94296578f8be461202e Mon Sep 17 00:00:00 2001 From: dkirchan Date: Tue, 30 Apr 2024 18:33:49 +0300 Subject: [PATCH 04/15] Fixed product type issue --- .../security_solution/api_integration.yml | 1033 ++++++++--------- .../api_integration/api-integration-tests.sh | 16 +- .../api_integration/api_ftr_execution.ts | 66 +- .../project_handler/cloud_project_handler.ts | 9 +- .../project_handler/project_handler.ts | 4 +- .../project_handler/proxy_project_handler.ts | 9 +- 6 files changed, 583 insertions(+), 554 deletions(-) diff --git a/.buildkite/pipelines/security_solution/api_integration.yml b/.buildkite/pipelines/security_solution/api_integration.yml index 92552fc5608bd..144f5f3051ad3 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,10 +11,10 @@ steps: timeout_in_minutes: 300 retry: automatic: - - exit_status: '-1' + - exit_status: "-1" limit: 2 - - group: 'Execute Tests' + - group: "Execute Tests" key: test_execution steps: - label: Running exception_workflows:essentials:qa:serverless @@ -27,517 +27,516 @@ steps: 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 + 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/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 8e9377636c193..3d9a53df554aa 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 @@ -14,23 +14,15 @@ 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 - +echo "--- Running test script $1" TARGET_SCRIPT=$1 node .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/start_api_ftr_execution -# ts-node .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/start_api_ftr_execution - +cmd_status=$? +echo "Exit code with status: $cmd_status" +exit $cmd_status # 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 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 index c16f4febb9287..69d6a23ac0ba7 100644 --- 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 @@ -24,6 +24,48 @@ import { 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 log = new ToolingLog({ + level: 'info', + writeTo: process.stdout, + }); + const childProcess = exec(command, { env: envVars, cwd: workDir }); + + // Listen for stdout data + childProcess.stdout?.on('data', (data) => { + log.info(data); + }); + + // Listen for stderr data + childProcess.stderr?.on('data', (data) => { + log.error(data); + }); + + // Listen for process exit + childProcess.on('exit', (code) => { + log.info(`Child process exits with code : ${code}`); + if (code !== 0) { + reject(code); + return; + } + resolve(code); + }); + + // exec(command, { env: envVars, cwd: workDir }, (error, stdout, stderr) => { + // console.log(`stdout: ${stdout}`); + // console.error(`stderr: ${stderr}`); + // if (error) { + // console.error(`exec error: ${error}`); + // reject(error.code); // Reject with the exit code + // return; + // } + // resolve(0); // Resolve with exit code 0 if command succeeds + // }); + }); +} + export const cli = () => { run( async (context) => { @@ -59,7 +101,7 @@ export const cli = () => { const PROJECT_NAME = `${PROJECT_NAME_PREFIX}-${id}`; // Creating project for the test to run - const project = await cloudHandler.createSecurityProject(PROJECT_NAME, [], ''); + const project = await cloudHandler.createSecurityProject(PROJECT_NAME); log.info(project); if (!project) { @@ -92,6 +134,7 @@ export const cli = () => { // Wait for Elasticsearch to be accessible await waitForEsAccess(project.es_url, auth, id); + let statusCode: number | undefined; try { log.info('test'); const FORMATTED_ES_URL = project.es_url.replace('https://', ''); @@ -99,8 +142,8 @@ export const cli = () => { const command = `yarn run ${process.env.TARGET_SCRIPT}`; const testCloud = 1; - const testEsUrl = `https://${credentials.username}:${credentials.password}@${FORMATTED_ES_URL}:443`; - const testKibanaUrl = `https://${credentials.username}:${credentials.password}@${FORMATTED_KB_URL}:443`; + 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, @@ -108,26 +151,15 @@ export const cli = () => { TEST_ES_URL: testEsUrl, TEST_KIBANA_URL: testKibanaUrl, }; - const childProcess = exec(command, { env: envVars, cwd: workDir }); - - childProcess.stdout?.on('data', (data) => { - log.info(data); - }); - childProcess.stderr?.on('data', (data) => { - console.error(data); - }); - - childProcess.on('exit', (code) => { - console.log(`Exit code with status: ${code}`); - }); + log.info(envVars); + statusCode = await executeCommand(command, envVars, workDir); } catch (ex) { console.error('PR pipeline error', ex.message); - process.exit(1); } - // Delete serverless project log.info(`${id} : Deleting project ${PROJECT_NAME}...`); await cloudHandler.deleteSecurityProject(project.id, PROJECT_NAME); + process.exit(statusCode); }, { flags: { 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)}`; From b6626e7d0f03fa5d39717756fb67c00bf56c9c81 Mon Sep 17 00:00:00 2001 From: dkirchan Date: Tue, 30 Apr 2024 22:13:31 +0300 Subject: [PATCH 05/15] Replaced logger with console.log for command execution --- .../api_integration/api_ftr_execution.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) 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 index 69d6a23ac0ba7..09d48967ee411 100644 --- 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 @@ -27,25 +27,21 @@ 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 log = new ToolingLog({ - level: 'info', - writeTo: process.stdout, - }); const childProcess = exec(command, { env: envVars, cwd: workDir }); // Listen for stdout data childProcess.stdout?.on('data', (data) => { - log.info(data); + console.log(data); }); // Listen for stderr data childProcess.stderr?.on('data', (data) => { - log.error(data); + console.log(data); }); // Listen for process exit childProcess.on('exit', (code) => { - log.info(`Child process exits with code : ${code}`); + console.log(`Child process exits with code : ${code}`); if (code !== 0) { reject(code); return; From 9e1070c8f95a70ac2e90b8947c2a97f383997bf7 Mon Sep 17 00:00:00 2001 From: dkirchan Date: Tue, 30 Apr 2024 22:16:24 +0300 Subject: [PATCH 06/15] Removed sensitive data --- .../api_integration/api_ftr_execution.ts | 46 ++++++++++--------- 1 file changed, 24 insertions(+), 22 deletions(-) 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 index 09d48967ee411..f18b879fe98cd 100644 --- 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 @@ -27,7 +27,15 @@ 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 }); + const childProcess = exec(command, { env: envVars, cwd: workDir }, (error, stdout, stderr) => { + if (error) { + console.error(`exec error: ${error}`); + process.exitCode = error.code; // Set exit code of the script to the child process exit code + return; + } + + console.log(`Output: ${stdout}`); + }); // Listen for stdout data childProcess.stdout?.on('data', (data) => { @@ -131,27 +139,21 @@ export const cli = () => { await waitForEsAccess(project.es_url, auth, id); let statusCode: number | undefined; - try { - log.info('test'); - 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, - }; - log.info(envVars); - statusCode = await executeCommand(command, envVars, workDir); - } catch (ex) { - console.error('PR pipeline error', ex.message); - } + 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); // Delete serverless project log.info(`${id} : Deleting project ${PROJECT_NAME}...`); await cloudHandler.deleteSecurityProject(project.id, PROJECT_NAME); From b5d25db4370aca24adee634786cc66a5f99e882e Mon Sep 17 00:00:00 2001 From: dkirchan Date: Wed, 1 May 2024 12:27:35 +0300 Subject: [PATCH 07/15] Fixed exist status code --- .../api_integration/api-integration-tests.sh | 118 ------------------ .../api_integration/api_ftr_execution.ts | 25 ++-- .../src/functional_test_runner/cli.ts | 2 +- .../scripts/index.js | 7 ++ 4 files changed, 18 insertions(+), 134 deletions(-) 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 3d9a53df554aa..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 @@ -19,121 +19,3 @@ TARGET_SCRIPT=$1 node .buildkite/scripts/pipelines/security_solution_quality_gat cmd_status=$? echo "Exit code with status: $cmd_status" exit $cmd_status - -# 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 -# 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 index f18b879fe98cd..4544a3c16a820 100644 --- 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 @@ -31,10 +31,7 @@ function executeCommand(command: string, envVars: any, workDir: string): Promise if (error) { console.error(`exec error: ${error}`); process.exitCode = error.code; // Set exit code of the script to the child process exit code - return; } - - console.log(`Output: ${stdout}`); }); // Listen for stdout data @@ -47,26 +44,24 @@ function executeCommand(command: string, envVars: any, workDir: string): Promise console.log(data); }); + // Listen for process exit + // childProcess.on('close', (code) => { + // if (code !== 0) { + // reject(code); + // return; + // } + // resolve(code); + // }); + // Listen for process exit childProcess.on('exit', (code) => { - console.log(`Child process exits with code : ${code}`); + console.log(`Node process for target ${process.env.TARGET_SCRIPT} exits with code : ${code}`); if (code !== 0) { reject(code); return; } resolve(code); }); - - // exec(command, { env: envVars, cwd: workDir }, (error, stdout, stderr) => { - // console.log(`stdout: ${stdout}`); - // console.error(`stderr: ${stderr}`); - // if (error) { - // console.error(`exec error: ${error}`); - // reject(error.code); // Reject with the exit code - // return; - // } - // resolve(0); // Resolve with exit code 0 if command succeeds - // }); }); } diff --git a/packages/kbn-test/src/functional_test_runner/cli.ts b/packages/kbn-test/src/functional_test_runner/cli.ts index dfd1edc1d8fc4..7a61b184516f1 100644 --- a/packages/kbn-test/src/functional_test_runner/cli.ts +++ b/packages/kbn-test/src/functional_test_runner/cli.ts @@ -92,7 +92,7 @@ export function runFtrCli() { ...Object.fromEntries(flagsReader.getUsed().entries()), }); } - + // process.exit(process.exitCode); process.exit(); }; 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..fd3a473a2bd0b 100644 --- a/x-pack/test/security_solution_api_integration/scripts/index.js +++ b/x-pack/test/security_solution_api_integration/scripts/index.js @@ -49,3 +49,10 @@ const child = spawn('node', [command, '--config', configPath, ...grepArgs, ...ar child.on('close', (code) => { console.log(`child process exited with code ${code}`); }); + +// Listen for process exit +child.on('exit', (code) => { + console.log(`index js Child process exits with code : ${code}`); + console.log(`index js Exit code : ${process.exitCode}`); + process.exit(code); +}); \ No newline at end of file From 81cf52b1c615375eab96be7994e101756f20d5c4 Mon Sep 17 00:00:00 2001 From: dkirchan Date: Wed, 1 May 2024 16:13:42 +0300 Subject: [PATCH 08/15] Fixed clean code --- .../api_integration/api_ftr_execution.ts | 17 +++++------------ .../kbn-test/src/functional_test_runner/cli.ts | 1 - .../scripts/index.js | 7 +++---- 3 files changed, 8 insertions(+), 17 deletions(-) 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 index 4544a3c16a820..8c08df210246c 100644 --- 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 @@ -30,29 +30,20 @@ function executeCommand(command: string, envVars: any, workDir: string): Promise const childProcess = exec(command, { env: envVars, cwd: workDir }, (error, stdout, stderr) => { if (error) { console.error(`exec error: ${error}`); - process.exitCode = error.code; // Set exit code of the script to the child process exit code + process.exitCode = error.code; } }); - // Listen for stdout data + // Listen and print stdout data childProcess.stdout?.on('data', (data) => { console.log(data); }); - // Listen for stderr data + // Listen and print stderr data childProcess.stderr?.on('data', (data) => { console.log(data); }); - // Listen for process exit - // childProcess.on('close', (code) => { - // if (code !== 0) { - // reject(code); - // return; - // } - // resolve(code); - // }); - // Listen for process exit childProcess.on('exit', (code) => { console.log(`Node process for target ${process.env.TARGET_SCRIPT} exits with code : ${code}`); @@ -148,7 +139,9 @@ export const cli = () => { TEST_ES_URL: testEsUrl, TEST_KIBANA_URL: testKibanaUrl, }; + statusCode = await executeCommand(command, envVars, workDir); + // Delete serverless project log.info(`${id} : Deleting project ${PROJECT_NAME}...`); await cloudHandler.deleteSecurityProject(project.id, PROJECT_NAME); diff --git a/packages/kbn-test/src/functional_test_runner/cli.ts b/packages/kbn-test/src/functional_test_runner/cli.ts index 7a61b184516f1..424e179728c9a 100644 --- a/packages/kbn-test/src/functional_test_runner/cli.ts +++ b/packages/kbn-test/src/functional_test_runner/cli.ts @@ -92,7 +92,6 @@ export function runFtrCli() { ...Object.fromEntries(flagsReader.getUsed().entries()), }); } - // process.exit(process.exitCode); process.exit(); }; 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 fd3a473a2bd0b..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,12 +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 exits with code : ${code}`); - console.log(`index js Exit code : ${process.exitCode}`); + console.log(`[index.js] child process exited with code ${code}`); process.exit(code); -}); \ No newline at end of file +}); From e9d7a5ab28a0bb207842d0f5c65f29edd32527c7 Mon Sep 17 00:00:00 2001 From: dkirchan Date: Wed, 1 May 2024 16:22:12 +0300 Subject: [PATCH 09/15] Restored previous state of cli.ts --- packages/kbn-test/src/functional_test_runner/cli.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/kbn-test/src/functional_test_runner/cli.ts b/packages/kbn-test/src/functional_test_runner/cli.ts index 424e179728c9a..dfd1edc1d8fc4 100644 --- a/packages/kbn-test/src/functional_test_runner/cli.ts +++ b/packages/kbn-test/src/functional_test_runner/cli.ts @@ -92,6 +92,7 @@ export function runFtrCli() { ...Object.fromEntries(flagsReader.getUsed().entries()), }); } + process.exit(); }; From 447b12a5c9bedc298a39fe6cab7cc8da0db0e343 Mon Sep 17 00:00:00 2001 From: dkirchan Date: Wed, 1 May 2024 16:38:44 +0300 Subject: [PATCH 10/15] Attempt to parameterize quality gate for FTR api integration tests --- .../security_solution/api_integration.yml | 531 +----------------- .../api_integration_serverless_periodic.yml | 528 +++++++++++++++++ .../api_integration_serverless_release.yml | 316 ++++++++--- .../package.json | 2 +- 4 files changed, 763 insertions(+), 614 deletions(-) create mode 100644 .buildkite/pipelines/security_solution/api_integration_serverless_periodic.yml diff --git a/.buildkite/pipelines/security_solution/api_integration.yml b/.buildkite/pipelines/security_solution/api_integration.yml index 144f5f3051ad3..69213fb789596 100644 --- a/.buildkite/pipelines/security_solution/api_integration.yml +++ b/.buildkite/pipelines/security_solution/api_integration.yml @@ -14,529 +14,10 @@ steps: - 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('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('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/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", From 9ad229651ec54cd1cc41a5d02ae0ccc520e651e2 Mon Sep 17 00:00:00 2001 From: dkirchan Date: Wed, 1 May 2024 17:39:10 +0300 Subject: [PATCH 11/15] Changed the flag from QUALITY_GATE to KIBANA_MKI_QUALITY_GATE --- .buildkite/pipelines/security_solution/api_integration.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.buildkite/pipelines/security_solution/api_integration.yml b/.buildkite/pipelines/security_solution/api_integration.yml index 69213fb789596..0ce0e4a1902f6 100644 --- a/.buildkite/pipelines/security_solution/api_integration.yml +++ b/.buildkite/pipelines/security_solution/api_integration.yml @@ -16,8 +16,8 @@ steps: - command: "cat .buildkite/pipelines/security_solution/api_integration_serverless_release.yml | buildkite-agent pipeline upload" label: 'Upload Release pipeline' - if: "build.env('QUALITY_GATE') == '1'" + if: "build.env('KIBANA_MKI_QUALITY_GATE') == '1'" - command: "cat .buildkite/pipelines/security_solution/api_integration_serverless_periodic.yml | buildkite-agent pipeline upload" label: 'Upload Periodic Serverless Pipeline' - if: "build.env('QUALITY_GATE') != '1'" + if: "build.env('KIBANA_MKI_QUALITY_GATE') != '1'" From e3f6833ef561ce5f09446384d73d8dee513b4148 Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Wed, 1 May 2024 15:21:36 +0000 Subject: [PATCH 12/15] [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix' --- .../api_integration/api_ftr_execution.ts | 16 ++++++++-------- .../api_integration/start_api_ftr_execution.js | 5 +++-- .../scripts/run_cypress/parallel_serverless.ts | 7 +++++-- 3 files changed, 16 insertions(+), 12 deletions(-) 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 index 8c08df210246c..b4102307e3d17 100644 --- 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 @@ -11,15 +11,15 @@ import { ToolingLog } from '@kbn/tooling-log'; import { exec } from 'child_process'; import crypto from 'crypto'; -import type { ProjectHandler } from '../../../../../x-pack/plugins/security_solution/scripts/run_cypress/project_handler/project_handler'; -import { CloudHandler } from '../../../../../x-pack/plugins/security_solution/scripts/run_cypress/project_handler/cloud_project_handler'; -import { ProxyHandler } from '../../../../../x-pack/plugins/security_solution/scripts/run_cypress/project_handler/proxy_project_handler'; +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 '../../../../../x-pack/plugins/security_solution/scripts/run_cypress/parallel_serverless'; +} 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'; @@ -83,7 +83,7 @@ export const cli = () => { 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.'); - // eslint-disable-next-line no-process-exit + return process.exit(1); } @@ -96,7 +96,7 @@ export const cli = () => { if (!project) { log.error('Failed to create project.'); - // eslint-disable-next-line no-process-exit + return process.exit(1); } @@ -105,7 +105,7 @@ export const cli = () => { if (!credentials) { log.error('Credentials could not be reset.'); - // eslint-disable-next-line no-process-exit + return process.exit(1); } @@ -139,7 +139,7 @@ export const cli = () => { TEST_ES_URL: testEsUrl, TEST_KIBANA_URL: testKibanaUrl, }; - + statusCode = await executeCommand(command, envVars, workDir); // Delete serverless project 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 index f54323aec01aa..2ee5715a0fe2b 100644 --- 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 @@ -1,8 +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. + * 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'); 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 a3836202cbda1..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 @@ -124,7 +124,11 @@ export function waitForEsStatusGreen(esUrl: string, auth: string, runnerId: stri } // Wait until Kibana is available -export 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 @@ -243,7 +247,6 @@ const getProductTypes = ( export const cli = () => { run( async (context) => { - // 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()) { From c20d857528005f7a5027862d5a80d1f5c63a8885 Mon Sep 17 00:00:00 2001 From: dkirchan Date: Wed, 1 May 2024 20:05:32 +0300 Subject: [PATCH 13/15] Fixed lint issue --- .../api_integration/api_ftr_execution.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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 index b4102307e3d17..e517bf71ef2b2 100644 --- 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 @@ -124,7 +124,6 @@ export const cli = () => { // Wait for Elasticsearch to be accessible await waitForEsAccess(project.es_url, auth, id); - let statusCode: number | undefined; const FORMATTED_ES_URL = project.es_url.replace('https://', ''); const FORMATTED_KB_URL = project.kb_url.replace('https://', ''); @@ -139,8 +138,8 @@ export const cli = () => { TEST_ES_URL: testEsUrl, TEST_KIBANA_URL: testKibanaUrl, }; - - statusCode = await executeCommand(command, envVars, workDir); + + const statusCode = await executeCommand(command, envVars, workDir); // Delete serverless project log.info(`${id} : Deleting project ${PROJECT_NAME}...`); From e8f1ca97810d4bf52e81ea5053aa75cafc2b44f6 Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Wed, 1 May 2024 18:29:52 +0000 Subject: [PATCH 14/15] [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix' --- .../api_integration/api_ftr_execution.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 index e517bf71ef2b2..539b57f170744 100644 --- 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 @@ -138,7 +138,7 @@ export const cli = () => { TEST_ES_URL: testEsUrl, TEST_KIBANA_URL: testKibanaUrl, }; - + const statusCode = await executeCommand(command, envVars, workDir); // Delete serverless project From 395f0af5d5922dfdae359b9f3cc00ad0b5622ace Mon Sep 17 00:00:00 2001 From: dkirchan Date: Thu, 2 May 2024 18:47:21 +0300 Subject: [PATCH 15/15] Fixed comment for cloud project deletion --- .../api_integration/api_ftr_execution.ts | 93 ++++++++++--------- 1 file changed, 49 insertions(+), 44 deletions(-) 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 index 539b57f170744..75e8371df15da 100644 --- 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 @@ -99,51 +99,56 @@ export const cli = () => { return process.exit(1); } - - // 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); + 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); } - - // 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, - }; - - const statusCode = await executeCommand(command, envVars, workDir); - - // Delete serverless project - log.info(`${id} : Deleting project ${PROJECT_NAME}...`); - await cloudHandler.deleteSecurityProject(project.id, PROJECT_NAME); process.exit(statusCode); }, {