Skip to content

Commit

Permalink
work with remarks
Browse files Browse the repository at this point in the history
  • Loading branch information
Siarhei Harbuz committed Mar 11, 2024
1 parent 48e1c08 commit fd09867
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
15 changes: 9 additions & 6 deletions .buildkite/scripts/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,9 @@ config_git() {
fi
}

withModule() {
getModuleNameFromTheChangeSet() {
# This method gathers the module name, if required, in order to run the ITs only if the changeset affects a specific module.
# For such, it's required to look for changes under the module folder and exclude anything else such as asciidoc and png files.
local module_path=$1
if [[ "$module_path" == *"x-pack/"* ]]; then
local pattern=("$XPACK_MODULE_PATTERN")
Expand All @@ -411,12 +413,11 @@ withModule() {
local module_path_exclussion="((?!^${module_path_transformed}\\/).)*\$"
local exclude=("^(${module_path_transformed}|((?!\\/module\\/).)*\$|.*\\.asciidoc|.*\\.png)")
if are_paths_changed "${pattern[@]}" && ! are_changed_only_paths "${exclude[@]}"; then
export MODULE=${module_name}
return "${module_name}"
elif [ -d "${module_path}" ]; then
export MODULE="aws" # TODO: remove this line and uncomment the line below when the issue https://github.com/elastic/ingest-dev/issues/2993 is solved
# export MODULE='' # TODO: uncomment the line when the issue https://github.com/elastic/ingest-dev/issues/2993 is solved
return "aws" # TODO: remove this line and uncomment the line below when the issue https://github.com/elastic/ingest-dev/issues/2993 is solved
# return '' # TODO: uncomment the line when the issue https://github.com/elastic/ingest-dev/issues/2993 is solved
fi
echo "MODULE=$MODULE"
}

terraformInit() {
Expand All @@ -428,6 +429,7 @@ terraformInit() {
}

withAWS() {
# This method gathers the masked AWS credentials from pre-command hook and sets the right AWS variable names.
export AWS_ACCESS_KEY_ID=$BEATS_AWS_ACCESS_KEY
export AWS_SECRET_ACCESS_KEY=$BEATS_AWS_SECRET_KEY
export TEST_TAGS="${TEST_TAGS:+$TEST_TAGS,}aws"
Expand Down Expand Up @@ -482,7 +484,8 @@ if are_paths_changed "${packaging_changeset[@]}" ; then
fi

if [[ "$BUILDKITE_PIPELINE_SLUG" == "beats-xpack-metricbeat" ]]; then
withModule "${MODULE_DIR}"
MODULE=$(getModuleNameFromTheChangeSet "${MODULE_DIR}")
export MODULE
fi

check_and_set_beat_vars
3 changes: 2 additions & 1 deletion .buildkite/scripts/setenv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,10 @@ if [[ "$BUILDKITE_PIPELINE_SLUG" == "beats-metricbeat" || "$BUILDKITE_PIPELINE_S
export RACE_DETECTOR="true"
export TEST_COVERAGE="true"
export DOCKER_PULL="0"
export TEST_TAGS="oracle"
export TEST_TAGS="${TEST_TAGS:+$TEST_TAGS,}oracle"
fi

if [[ "$BUILDKITE_PIPELINE_SLUG" == "beats-xpack-metricbeat" ]]; then
# run the cloud tests for the given modules.
export MODULE_DIR="x-pack/metricbeat/module/aws"
fi

0 comments on commit fd09867

Please sign in to comment.