From 3f98c485adc0830882e9a4f040448cc2f2a1837d Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Wed, 29 Oct 2025 18:31:55 +0100 Subject: [PATCH 1/3] fix(bk): serverless-beats-tests start failing after merging https://github.com/elastic/elastic-agent/pull/10734 --- .buildkite/hooks/pre-command | 2 +- .buildkite/pipeline.yml | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/.buildkite/hooks/pre-command b/.buildkite/hooks/pre-command index e838dfaf74c..afe5212d2d7 100755 --- a/.buildkite/hooks/pre-command +++ b/.buildkite/hooks/pre-command @@ -34,7 +34,7 @@ if [[ "$BUILDKITE_PIPELINE_SLUG" == "elastic-agent-package" ]]; then fi fi -if [[ "$BUILDKITE_PIPELINE_SLUG" == "buildkite-elastic-agent-integration-matrix" ]]; then +if [[ ("$BUILDKITE_PIPELINE_SLUG" == "buildkite-elastic-agent-integration-matrix") || ("$BUILDKITE_PIPELINE_SLUG" == "beats-agent-serverless-tests") ]]; then echo "Setting credentials" # Set GCP credentials export GOOGLE_APPLICATION_GCP_SECRET=$(retry 5 vault kv get -format=json -field=data ${CI_GCP_OBS_PATH}) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 4224a2d6e0a..148b7549a08 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -344,6 +344,26 @@ steps: commit: "${BUILDKITE_COMMIT}" branch: "${BUILDKITE_BRANCH}" + # Trigger for pull requests - Serverless Beats Tests + # this should help detecting issues earlier in the development cycle + - label: "Trigger Serverless Beats Tests" + if: build.pull_request.id != null + plugins: + - monorepo-diff#v1.2.0: + diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD" + interpolation: false + watch: + - path: + - .buildkite/serverless.beats.tests.yml + - .buildkite/scripts/steps/beats_tests.sh + - .buildkite/hooks/pre-command + config: + label: ":pipeline: Upload Serverless Beats Tests" + command: "buildkite-agent pipeline upload .buildkite/serverless.beats.tests.yml" + env: + - BUILDKITE_PULL_REQUEST=${BUILDKITE_PULL_REQUEST} + - BUILDKITE_PULL_REQUEST_BASE_BRANCH=${BUILDKITE_PULL_REQUEST_BASE_BRANCH} + # wait for CI to be done - wait: ~ From 13452e7b669b979ff7fcfd13add4c494a6f4568c Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Wed, 29 Oct 2025 18:59:14 +0100 Subject: [PATCH 2/3] pre-command and buildkite-pipeline upload does not play well --- .buildkite/hooks/pre-command | 3 +-- .buildkite/pipeline.yml | 9 ++++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.buildkite/hooks/pre-command b/.buildkite/hooks/pre-command index afe5212d2d7..f0a69f7e199 100755 --- a/.buildkite/hooks/pre-command +++ b/.buildkite/hooks/pre-command @@ -35,8 +35,7 @@ if [[ "$BUILDKITE_PIPELINE_SLUG" == "elastic-agent-package" ]]; then fi if [[ ("$BUILDKITE_PIPELINE_SLUG" == "buildkite-elastic-agent-integration-matrix") || ("$BUILDKITE_PIPELINE_SLUG" == "beats-agent-serverless-tests") ]]; then - echo "Setting credentials" - # Set GCP credentials + echo "Setting GCP credentials" export GOOGLE_APPLICATION_GCP_SECRET=$(retry 5 vault kv get -format=json -field=data ${CI_GCP_OBS_PATH}) echo "${GOOGLE_APPLICATION_GCP_SECRET}" > ./gcp.json export GOOGLE_APPLICATION_CREDENTIALS=$(realpath ./gcp.json) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 148b7549a08..7e11958c3d0 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -358,11 +358,10 @@ steps: - .buildkite/scripts/steps/beats_tests.sh - .buildkite/hooks/pre-command config: - label: ":pipeline: Upload Serverless Beats Tests" - command: "buildkite-agent pipeline upload .buildkite/serverless.beats.tests.yml" - env: - - BUILDKITE_PULL_REQUEST=${BUILDKITE_PULL_REQUEST} - - BUILDKITE_PULL_REQUEST_BASE_BRANCH=${BUILDKITE_PULL_REQUEST_BASE_BRANCH} + trigger: "elastic-agent-extended-testing" + build: + commit: "${BUILDKITE_COMMIT}" + branch: "${BUILDKITE_BRANCH}" # wait for CI to be done - wait: ~ From dd62ab74e36325bb1d6621ee0af3a572047961b9 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Wed, 29 Oct 2025 20:02:04 +0100 Subject: [PATCH 3/3] use the right pipeline after moving to a triggering --- .buildkite/pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 7e11958c3d0..55cb8238141 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -358,7 +358,7 @@ steps: - .buildkite/scripts/steps/beats_tests.sh - .buildkite/hooks/pre-command config: - trigger: "elastic-agent-extended-testing" + trigger: "beats-agent-serverless-tests" build: commit: "${BUILDKITE_COMMIT}" branch: "${BUILDKITE_BRANCH}"