From b06f29ca7eced194751882f7e78a469a4c2e163f Mon Sep 17 00:00:00 2001 From: Mario Rodriguez Molins Date: Tue, 23 Apr 2024 17:10:57 +0200 Subject: [PATCH 1/3] Skip install pacakge command in serverless builds --- .buildkite/scripts/common.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.buildkite/scripts/common.sh b/.buildkite/scripts/common.sh index 37dfdfc7565..f2b263537e5 100755 --- a/.buildkite/scripts/common.sh +++ b/.buildkite/scripts/common.sh @@ -814,10 +814,16 @@ run_tests_package() { fi fi - echo "--- [${package}] test installation" - if ! install_package "${package}" ; then - return 1 + if ! is_serverless ; then + # Just run install command on non serverless projects, + # "elastic-paackage test asset" command already installs the package via upload API + # as it does "elastic-package install" command + echo "--- [${package}] test installation" + if ! install_package "${package}" ; then + return 1 + fi fi + echo "--- [${package}] run test suites" if is_serverless; then if ! test_package_in_serverless "${package}" ; then From 01e0cb3192e4c13697ca7dbde14e8011073c5bf2 Mon Sep 17 00:00:00 2001 From: Mario Rodriguez Molins Date: Wed, 24 Apr 2024 10:40:01 +0200 Subject: [PATCH 2/3] Keep elastic-package install to run in all the other packages --- .buildkite/scripts/common.sh | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/.buildkite/scripts/common.sh b/.buildkite/scripts/common.sh index f2b263537e5..c96f5da6c94 100755 --- a/.buildkite/scripts/common.sh +++ b/.buildkite/scripts/common.sh @@ -755,6 +755,19 @@ build_zip_package() { return 0 } +skip_installation_step() { + local package=$1 + if ! is_serverless ; then + return 1 + fi + + if [[ "$package" == "security_detection_engine" ]]; then + return 0 + fi + + return 1 +} + install_package() { local package=$1 echo "Install package: ${package}" @@ -814,10 +827,7 @@ run_tests_package() { fi fi - if ! is_serverless ; then - # Just run install command on non serverless projects, - # "elastic-paackage test asset" command already installs the package via upload API - # as it does "elastic-package install" command + if ! skip_installation_step "${package}" ; then echo "--- [${package}] test installation" if ! install_package "${package}" ; then return 1 From c7d3d9d799eb699aef9f9076eef47e8ecc4b8ec0 Mon Sep 17 00:00:00 2001 From: Mario Rodriguez Molins Date: Wed, 24 Apr 2024 19:30:22 +0200 Subject: [PATCH 3/3] Remove extra lines --- .buildkite/scripts/common.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/.buildkite/scripts/common.sh b/.buildkite/scripts/common.sh index c96f5da6c94..29684df9845 100755 --- a/.buildkite/scripts/common.sh +++ b/.buildkite/scripts/common.sh @@ -309,7 +309,6 @@ create_kind_cluster() { kind create cluster --config "${WORKSPACE}/kind-config.yaml" --image "kindest/node:${K8S_VERSION}" } - delete_kind_cluster() { echo "--- Delete kind cluster" kind delete cluster || true @@ -410,7 +409,6 @@ is_package_excluded() { return 1 } - is_supported_capability() { if [ "${SERVERLESS_PROJECT}" == "" ]; then return 0