Closed danielhoherd closed 3 years ago
I think I discovered my issue. It look like the contains
comparison expects the 'content' to be the contents of an item within an array of the comparator, not a direct dict.
Hello @danielhoherd,
You already answered yourself. 😁
You can try to use the following as a test:
- equal:
path: metadata.annotations
value:
foo1: foo
foo2: foo
foo3: foo
The equal should validate the complete map.
Greetings, @quintush
@quintush thanks for the quick reply! Also, I really appreciate the work you've put into this project.
Description
metadata.annotations is expected to be array when it should be a map.
Test
Result
Discussion
Using the
contains
example as a reference...…I expected my test would work. Looking through the code, I don't see a reference to 'annotations' anywhere so I suspect the behavior is imported from an upstream library, however the bug is manifesting itself here so I filed the bug here.
I also tried restructuring the test to compare against
metadata
and assert content ofannotations:
but that didn't work either. However, I was able to get it to work with a different comparison:It's possible I've got an invalid test. Looking around in Github I don't see any other tests that use
contains
withmetadata
. It's also possible this is a documentation bug.