-
Notifications
You must be signed in to change notification settings - Fork 25.1k
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
Rest Tests - Support for matching objects in lists #34693
Conversation
Makes it possible to have a key that points to a list and assert that a certain object is present in the list. All keys have to be present and values have to match. The objects in the source list may have additional fields. example: ``` contains: { 'nodes.$master.plugins': { name: ingest-attachment } } ``` Backported from elastic#30874 (e8b8d11) Co-authored-by: Alpar Torok <[email protected]>
where do we use this new assertion? I think that the clients team need to be aware as well, or we may end up writing tests that only work when run by the java runner. Otherwise there's a way to declare a feature requirement in a test, so that it is skipped when run by a runner that does not support such feature(s). |
Apologies, this got raised during GitHub's issues yesterday & I couldn't add explanation comments or reviewers. This was added to master in #30874. The main benefit it brings is being able to test output where there is an array with unpredictable order. To be honest, I wasn't aware that we even had other runners for the rest tests, this is one of those areas where it can be hard to uncover the history and contraints. |
Thanks for the explanation @tvernum . I think that the original change in master didn't get the proper visibility as it was part of a much bigger PR with a title that did not suggest adding a new assertion to the yaml tests. Every language client runs the yaml tests, and each language has its own runner. When adding new assertion, the clients team needs to be notified and we use a skip feature section to signal that updated tests rely on some feature that not all runners support. This gives time for the other runners to adapt to the changes, without breaking their builds. I am not sure if this has already been noticed by the clients team, but in any case we should add skip sections to the modified tests in master. cc @atorok ping me for review there ;) |
@tvernum are there issues with backporting this? There's a couple of changes that are pending backport and waiting for this one to be backported ;) |
Sorry @javanna I got distracted after the original concerns about a new feature, and didn't manage to get back to it. |
no worries, thank you ;) |
Makes it possible to have a key that points to a list and assert that a
certain object is present in the list. All keys have to be present and
values have to match. The objects in the source list may have additional
fields.
example:
Backported from #30874 (e8b8d11)
Co-authored-by: Alpar Torok [email protected]