Skip to content

Commit cd7a865

Browse files
miguelgrinberggithub-actions[bot]
authored andcommitted
yaml tests: more improvements to branching logic (#3197)
(cherry picked from commit 01d1e81)
1 parent 216e64f commit cd7a865

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

.buildkite/run-tests

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ export TEST_SUITE="${TEST_SUITE:=platinum}"
1010
export PYTHON_VERSION="${PYTHON_VERSION:=3.14}"
1111
export PYTHON_CONNECTION_CLASS="${PYTHON_CONNECTION_CLASS:=urllib3}"
1212
export ES_YAML_TESTS_BRANCH="${BUILDKITE_PULL_REQUEST_BASE_BRANCH}"
13+
if [[ ! -n "$ES_YAML_TESTS_BRANCH" ]]; then
14+
export ES_YAML_TESTS_BRANCH="${BUILDKITE_BRANCH}"
15+
fi
1316

1417
script_path=$(dirname $(realpath $0))
1518
source $script_path/functions/imports.sh

test_elasticsearch/test_server/test_rest_api_spec.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -503,10 +503,10 @@ def remove_implicit_resolver(cls, tag_to_remove):
503503
if "ES_YAML_TESTS_BRANCH" in os.environ and os.environ["ES_YAML_TESTS_BRANCH"]:
504504
branch_candidates.append(os.environ["ES_YAML_TESTS_BRANCH"])
505505
git_branch = subprocess.getoutput("git branch --show-current")
506-
if git_branch not in branch_candidates:
506+
if git_branch and git_branch not in branch_candidates:
507507
branch_candidates.append(git_branch)
508508
package_version = __versionstr__.rsplit(".", 1)[0]
509-
if package_version not in branch_candidates:
509+
if package_version and package_version not in branch_candidates:
510510
branch_candidates.append(package_version)
511511
if "main" not in branch_candidates:
512512
branch_candidates.append("main")

0 commit comments

Comments
 (0)