Skip to content
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

Make sure ImagesSimilarityTest checks the API actually filters the results #432

Open
alexwlchan opened this issue May 12, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@alexwlchan
Copy link
Contributor

This looks like it exactly replicates what was there before, so this isn't a request for a change. Maybe something for another ticket.

It looks like each of these tests loads six images, requests one of them, and expects to see the remaining five in the visuallySimilar/withSimilarFeatures/withSimilarColors list.

This is fine as a positive test, showing that the lists exist and are populated on request, but does not demonstrate any discrimination - it does not exclude any dissimilar images.

All of them would pass if the API simply returned all the images in the database in whichever list was requested in the query string (or something more subtle).

Perhaps the tests could be crafted so that the same input data is used for all three, grouped thus:

  1. features a colours x
  2. features a colours y
  3. features b colours y

Then visually similar could return group 1, similar features groups 1 and 2, similar colours groups 2 and 3.

Originally posted by @paul-butcher in #430 (review)

@alexwlchan alexwlchan added the bug Something isn't working label May 12, 2022
@alexwlchan
Copy link
Contributor Author

There's a similar issue in ImagesFiltersTest, which I'll annotate with a TODO comment.

@paul-butcher
Copy link
Contributor

Related: Add tests for combinations of includes. It doesn't have to demonstrate every permutation, just show that if I ask for e.g. withSimilarFeatures,withSimilarColors, then both lists are returned. That's the kind of thing where if x ... if y ... can accidentally become if x ... else if y ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants