Skip to content

Conversation

@miguelgrinberg
Copy link
Contributor

@miguelgrinberg miguelgrinberg commented Nov 19, 2025

This change tries to load the YAML tests for CI from the same branch as the client, instead of always loading main. When running a PR build, the branch is not going to exist in the YAML tests repository, so in that case we fallback to main as before.

@miguelgrinberg miguelgrinberg marked this pull request as ready for review November 19, 2025 11:41
@miguelgrinberg miguelgrinberg force-pushed the load-yaml-tests-from-branch branch from 99dd070 to f788efc Compare November 19, 2025 12:14
@miguelgrinberg miguelgrinberg force-pushed the load-yaml-tests-from-branch branch from f788efc to 7c41234 Compare November 19, 2025 12:31
if pytest_test_name.startswith(prefix):
pytest_test_name = pytest_test_name[len(prefix) :]
pytest_param_id = "%s[%d]" % (pytest_test_name, test_number)
pytest_param_id = "[%s]%s[%d]" % (branch, pytest_test_name, test_number)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do not have to keep this forever, but initially this will be confirmation of which of all the possible branches was used in the end.

@miguelgrinberg miguelgrinberg force-pushed the load-yaml-tests-from-branch branch from 7c41234 to 4ad28b4 Compare November 19, 2025 14:24
@pquentin
Copy link
Member

This is failing due to:

FAILED test_elasticsearch/test_server/test_rest_api_spec.py::test_rest_api_spec[[main]inference/10_basic[0]] - elastic_transport.ConnectionTimeout: Connection timed out

However, that test is part of FAILING_TESTS, so it should be ignored.

Copy link
Member

@pquentin pquentin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! LGTM.


from elasticsearch import ApiError, ElasticsearchWarning, RequestError
from elasticsearch._sync.client.utils import _base64_auth_header
from elasticsearch._version import __versionstr__
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For what it's worth, importlib.metadata.version is the modern way to do that. Not asking you to change it though!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I trust that we are less likely to break this in the future than the Python org.

@miguelgrinberg miguelgrinberg merged commit b1ad37a into elastic:main Nov 20, 2025
19 checks passed
github-actions bot pushed a commit that referenced this pull request Nov 20, 2025
* load yaml tests from same branch as client

* restore checks for failed or skipped tests

(cherry picked from commit b1ad37a)
github-actions bot pushed a commit that referenced this pull request Nov 20, 2025
* load yaml tests from same branch as client

* restore checks for failed or skipped tests

(cherry picked from commit b1ad37a)
github-actions bot pushed a commit that referenced this pull request Nov 20, 2025
* load yaml tests from same branch as client

* restore checks for failed or skipped tests

(cherry picked from commit b1ad37a)
github-actions bot pushed a commit that referenced this pull request Nov 20, 2025
* load yaml tests from same branch as client

* restore checks for failed or skipped tests

(cherry picked from commit b1ad37a)
miguelgrinberg added a commit that referenced this pull request Nov 20, 2025
* load yaml tests from same branch as client

* restore checks for failed or skipped tests

(cherry picked from commit b1ad37a)

Co-authored-by: Miguel Grinberg <[email protected]>
miguelgrinberg added a commit that referenced this pull request Nov 20, 2025
* load yaml tests from same branch as client

* restore checks for failed or skipped tests

(cherry picked from commit b1ad37a)

Co-authored-by: Miguel Grinberg <[email protected]>
miguelgrinberg added a commit that referenced this pull request Nov 20, 2025
* load yaml tests from same branch as client

* restore checks for failed or skipped tests

(cherry picked from commit b1ad37a)

Co-authored-by: Miguel Grinberg <[email protected]>
miguelgrinberg added a commit that referenced this pull request Nov 20, 2025
* load yaml tests from same branch as client

* restore checks for failed or skipped tests

(cherry picked from commit b1ad37a)

Co-authored-by: Miguel Grinberg <[email protected]>
@miguelgrinberg miguelgrinberg deleted the load-yaml-tests-from-branch branch November 20, 2025 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants