diff --git a/.buildkite/metricbeat/pipeline.yml b/.buildkite/metricbeat/pipeline.yml index 23e603267f6..ed9fb14f3d4 100644 --- a/.buildkite/metricbeat/pipeline.yml +++ b/.buildkite/metricbeat/pipeline.yml @@ -57,7 +57,7 @@ steps: # defines the MODULE env var based on what's changed in a PR source .buildkite/scripts/changesets.sh defineModuleFromTheChangeSet metricbeat - echo "~~~ Will run tests with env var MODULE=$$MODULE" + echo "~~~ Running tests" # TODO move this section to base image / pre-command hook echo "~~~ Installing kind" @@ -90,7 +90,7 @@ steps: # defines the MODULE env var based on what's changed in a PR source .buildkite/scripts/changesets.sh defineModuleFromTheChangeSet metricbeat - echo "~~~ Running tests with env var MODULE=$$MODULE" + echo "~~~ Running tests" # TODO move this section to base image / pre-command hook echo "~~~ Installing kind" diff --git a/.buildkite/scripts/changesets.psm1 b/.buildkite/scripts/changesets.psm1 index 15fabd3eba5..10e4d31a8b6 100644 --- a/.buildkite/scripts/changesets.psm1 +++ b/.buildkite/scripts/changesets.psm1 @@ -56,17 +56,9 @@ function DefineModuleFromTheChangeSet($projectPath) { } } - # TODO: remove this conditional when issue https://github.com/elastic/ingest-dev/issues/2993 gets resolved - if(!$changedModules) { - if($Env:BUILDKITE_PIPELINE_SLUG -eq 'beats-xpack-metricbeat') { - $Env:MODULE = "aws" - } - else { - $Env:MODULE = "kubernetes" - } - } - else { - # TODO: once https://github.com/elastic/ingest-dev/issues/2993 gets resolved, this should be the only thing we export - $Env:MODULE = $changedModules + if ($changedModules) { + $env:MODULE = $changedModules + Write-Output "~~~ Set env var MODULE to [$env:MODULE]" + Write-Output "~~~ Resuming commands" } } diff --git a/.buildkite/scripts/changesets.sh b/.buildkite/scripts/changesets.sh index 3b7ed5d7ec0..5c6fd6c7b0d 100644 --- a/.buildkite/scripts/changesets.sh +++ b/.buildkite/scripts/changesets.sh @@ -68,13 +68,10 @@ defineModuleFromTheChangeSet() { fi done - if [[ -z "$changed_modules" ]]; then # TODO: remove this conditional when issue https://github.com/elastic/ingest-dev/issues/2993 gets resolved - if [[ "$BUILDKITE_PIPELINE_SLUG" == "beats-xpack-metricbeat" ]]; then - export MODULE="aws" - else - export MODULE="kubernetes" - fi - else - export MODULE="${changed_modules}" # TODO: once https://github.com/elastic/ingest-dev/issues/2993 gets resolved, this should be the only thing we export + # export MODULE="" leads to an infinite loop https://github.com/elastic/ingest-dev/issues/2993 + if [[ ! -z $changed_modules ]]; then + export MODULE="${changed_modules}" + echo "~~~ Set env var MODULE to [$MODULE]" + echo "~~~ Resuming commands" fi } diff --git a/.buildkite/x-pack/pipeline.xpack.auditbeat.yml b/.buildkite/x-pack/pipeline.xpack.auditbeat.yml index 85bd92c6634..2e13a0d9b95 100644 --- a/.buildkite/x-pack/pipeline.xpack.auditbeat.yml +++ b/.buildkite/x-pack/pipeline.xpack.auditbeat.yml @@ -37,7 +37,7 @@ steps: # defines the MODULE env var based on what's changed in a PR source .buildkite/scripts/changesets.sh defineModuleFromTheChangeSet x-pack/auditbeat - echo "~~~ Will run tests with env var MODULE=$$MODULE" + echo "~~~ Running tests" cd x-pack/auditbeat mage update build test retry: diff --git a/.buildkite/x-pack/pipeline.xpack.dockerlogbeat.yml b/.buildkite/x-pack/pipeline.xpack.dockerlogbeat.yml index b1d307b3814..b01d6de53e2 100644 --- a/.buildkite/x-pack/pipeline.xpack.dockerlogbeat.yml +++ b/.buildkite/x-pack/pipeline.xpack.dockerlogbeat.yml @@ -56,11 +56,9 @@ steps: # defines the MODULE env var based on what's changed in a PR source .buildkite/scripts/changesets.sh defineModuleFromTheChangeSet x-pack/dockerlogbeat - echo "~~~ Running tests with env var MODULE=$$MODULE" + echo "~~~ Running tests" cd x-pack/dockerlogbeat mage goIntegTest - env: - MODULE: $MODULE retry: automatic: - limit: 3 diff --git a/.buildkite/x-pack/pipeline.xpack.filebeat.yml b/.buildkite/x-pack/pipeline.xpack.filebeat.yml index f86c9e9c73d..471dc32b4e5 100644 --- a/.buildkite/x-pack/pipeline.xpack.filebeat.yml +++ b/.buildkite/x-pack/pipeline.xpack.filebeat.yml @@ -55,7 +55,7 @@ steps: # defines the MODULE env var based on what's changed in a PR source .buildkite/scripts/changesets.sh defineModuleFromTheChangeSet x-pack/filebeat - echo "~~~ Will run tests with env var MODULE=$$MODULE" + echo "~~~ Running tests" cd x-pack/filebeat && mage goIntegTest retry: automatic: @@ -78,7 +78,7 @@ steps: # defines the MODULE env var based on what's changed in a PR source .buildkite/scripts/changesets.sh defineModuleFromTheChangeSet x-pack/filebeat - echo "~~~ Running tests with env var MODULE=$$MODULE" + echo "~~~ Running tests" cd x-pack/filebeat && mage pythonIntegTest retry: automatic: @@ -272,7 +272,7 @@ steps: # defines the MODULE env var based on what's changed in a PR source .buildkite/scripts/changesets.sh defineModuleFromTheChangeSet x-pack/filebeat - echo "~~~ Running tests with env var MODULE=$$MODULE" + echo "~~~ Running tests" .buildkite/scripts/cloud_tests.sh env: @@ -301,7 +301,7 @@ steps: # defines the MODULE env var based on what's changed in a PR source .buildkite/scripts/changesets.sh defineModuleFromTheChangeSet x-pack/filebeat - echo "~~~ Running tests with env var MODULE=$$MODULE" + echo "~~~ Running tests" .buildkite/scripts/cloud_tests.sh env: ASDF_TERRAFORM_VERSION: 1.0.2 diff --git a/.buildkite/x-pack/pipeline.xpack.metricbeat.yml b/.buildkite/x-pack/pipeline.xpack.metricbeat.yml index ea01c69eb43..bc9ed7040e8 100644 --- a/.buildkite/x-pack/pipeline.xpack.metricbeat.yml +++ b/.buildkite/x-pack/pipeline.xpack.metricbeat.yml @@ -55,7 +55,7 @@ steps: # defines the MODULE env var based on what's changed in a PR source .buildkite/scripts/changesets.sh defineModuleFromTheChangeSet x-pack/metricbeat - echo "~~~ Will run tests with env var MODULE=$$MODULE" + echo "~~~ Running tests" cd x-pack/metricbeat && mage goIntegTest retry: automatic: @@ -78,7 +78,7 @@ steps: # defines the MODULE env var based on what's changed in a PR source .buildkite/scripts/changesets.sh defineModuleFromTheChangeSet x-pack/metricbeat - echo "~~~ Running tests with env var MODULE=$$MODULE" + echo "~~~ Running tests" cd x-pack/metricbeat && mage pythonIntegTest retry: automatic: @@ -257,7 +257,7 @@ steps: # defines the MODULE env var based on what's changed in a PR source .buildkite/scripts/changesets.sh defineModuleFromTheChangeSet x-pack/metricbeat - echo "~~~ Running tests with env var MODULE=$$MODULE" + echo "~~~ Running tests" .buildkite/scripts/cloud_tests.sh env: @@ -288,7 +288,7 @@ steps: # defines the MODULE env var based on what's changed in a PR source .buildkite/scripts/changesets.sh defineModuleFromTheChangeSet x-pack/metricbeat - echo "~~~ Running tests with env var MODULE=$$MODULE" + echo "~~~ Running tests" .buildkite/scripts/cloud_tests.sh env: ASDF_TERRAFORM_VERSION: 1.0.2 diff --git a/.buildkite/x-pack/pipeline.xpack.winlogbeat.yml b/.buildkite/x-pack/pipeline.xpack.winlogbeat.yml index a2d06a5ae4e..b69aec32498 100644 --- a/.buildkite/x-pack/pipeline.xpack.winlogbeat.yml +++ b/.buildkite/x-pack/pipeline.xpack.winlogbeat.yml @@ -27,11 +27,9 @@ steps: command: | Import-Module ./.buildkite/scripts/changesets.psm1 defineModuleFromTheChangeSet 'x-pack/winlogbeat' - Write-Output "~~~ Will run tests with env var MODULE=$$Env:MODULE" + Write-Output "~~~ Running tests" Set-Location -Path x-pack/winlogbeat mage build unitTest - env: - MODULE: $MODULE retry: automatic: - limit: 3