Skip to content

Handle clients-tests requires section #48

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 31, 2024

Conversation

pquentin
Copy link
Member

Here's an example YAML file https://github.com/elastic/elasticsearch-clients-tests/blob/main/tests/ping/ping.yml. The "requires" sections were mistaken for actual tests to run until now.

@pquentin pquentin requested a review from miguelgrinberg May 30, 2024 17:24
setup_steps = test_step
elif test_name == "teardown":
teardown_steps = test_step
else:
test_numbers_and_steps.append((test_number, test_step))
test_number += 1

if not requires["serverless"]:
Copy link
Contributor

Choose a reason for hiding this comment

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

Can a test not have a requires section, or have it, but not have a serverless key in it? Not sure if that is possible, but I think it would make sense to protect against a crash here.

Copy link
Member Author

Choose a reason for hiding this comment

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

It's not possible. If it happens, I'd rather crash loudly than making a wrong choice (offensive programming vs. defensive programming). After all, we fully control the tests here.

@@ -568,20 +568,25 @@ def remove_implicit_resolver(cls, tag_to_remove):
# Each file may have a "test" named 'setup' or 'teardown',
Copy link
Contributor

Choose a reason for hiding this comment

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

This comment should also mention the requires section.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, addressed in 545a1cc (#48)

@pquentin pquentin merged commit b817bf5 into elastic:main May 31, 2024
9 of 10 checks passed
@pquentin pquentin deleted the requires-serverless branch May 31, 2024 10:42
@pquentin pquentin mentioned this pull request Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants