Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Test for search functionality #4116
For refactoring search, need to have proper a test suite.
Its written in pytest style as we are using pytest.
This looks like a great start! I'm glad to have ES running in Travis, and actually doing some integration tests against it.
I think we should probably add a flag that runs these tests. We don't want to require users to be running ES locally to have the tests pass, so something like a
search-integration flag or something that we pass to pytest would be good to enable these only when we want them to run.
@safwanrahman marked the tests as
Although, I would like to have these tests run by default on Travis and not in local development. So, we should find a way for this.
Yea, I think we should probably have it run_when a tag is present, instead of when it isn't. That way we can just set the tag on Travis, and locally if we want to run it.
I think something like this should work: https://docs.pytest.org/en/latest/example/markers.html#marking-platform-specific-tests-with-pytest
I think this is a great start too! I'll make one suggestion based on working with and testing elasticsearch in other projects...
Make a small corpus of hand written test documents for searching, e.g. 5 projects with data associated with each, not using automatically generated data. Give them close to real names and just make up some stuff. That helps think about the queries a lot easier but also allows to test that the search finds the right result out of many vs adding 1 project and testing search finds the only one there.
I don't recall if there's any fuzzy matching for catching typos but having a few hard coded projects helps test this kind of thing also.
changed the title from
[WIP] Test for search functionality
Test for search functionality
May 27, 2018
Looks like a great start. I had a few comments, but really like the approach of having the full JSON -> index -> search flow tested.
This looks great. I mostly commented on small code style and logic fixes. Once those are resolved, I think we can merge