-
Notifications
You must be signed in to change notification settings - Fork 36
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
Add integration tests and make tests easier to develop #66
Conversation
uuuugh as I feared, ES 1.x and 2.x have a different strategy for scrolling. ES 5.x must have supported both, and ES6.x only supports the strategy I changed to in this PR. I don't love this but I have an idea... I think I need to just hit the cluster, parse the version, and use the right method based on major version. I hate everything. |
|
||
### Running Tests Locally | ||
|
||
When developing on this package, you may want to run Elasticsearch locally to speed up the testing cycle. We've provided some gross bash scripts at the root of this repo to help! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice
setup_es.sh
Outdated
curl --silent \ | ||
-X PUT "http://${ES_HOST}/empty_index" \ | ||
-H 'Content-Type: application/json' \ | ||
-d @shakespeare_mapping.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confused; what makes this index empty? It looks like you're uploading shakespeare_mapping.json
again with the same code. Same in the .travis.yml
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we talked but responding here for other viewers on the PR. This is empty in the sense that we never write any docs to it. Like every query you execute against it is going to return 0 docs.
This seemed like the safest way to get test coverage on the code that handles "you wrote a valid query but it happened to match nothing"
@@ -16,22 +16,181 @@ if (!identical(loggerOptions, list())){ | |||
} | |||
futile.logger::flog.threshold(0) | |||
|
|||
#--- 1. es_search | |||
#--- es_search |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice
|
||
# NOTE: Creating an intentionally empty index is the safest way to test | ||
# this functionality. Any other test would involve writing a query | ||
# and I want to avoid exposing our tests to changes in the query DSL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I like this idea
Are you sure that scrolling is causing the problems? Diving into the failed builds, it looks like the errors could be unrelated to scrolling. Some erroring versions don't even use scrolling in the failed tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall I love this PR. It looks great! I'll review again once you fix the failing build.
@austin3dickey this is not ready for a second yet. Just want to let you know what I did tonight:
Also I rebased to current master after merging #62 . Will keep working on this! I think the package will be in a more stable place after this PR finally gets working |
745b9b7
to
3b0cb8d
Compare
ok fixed SOME of the issues causing this to fail. Basically the bulk endpoint was rejecting my test data because of a weird ordering of my Now I need to fix the lingering test failures in legacy ES versions, which I think are a combination of the cluster taking too slow to respond (gonna try adding a updates to follow |
f2d8cf0
to
90255c3
Compare
… bugs for scrolling behavior in ES6.
…tring types in ES6
…ving localhost on Travis
…g environment to allow easy build of any ES version
ok @austin3dickey Travis is working right now but I'm feeling confident that it's gonna build. I had to do a lot of crazy stuff today to get it working, but they're all good changes. Like stuff that was actually broken that this testing exposed. TL;DR uptasticsearch as it stands on master is just barely working for legacy versions and doesn't really work for ES6 changes since you last reviewed:
I think that when we merge this PR, we'll be able to close #36 . There are some lines that are gonna be super tough to cover in tests, so we should leave #33 open for now. Our coverage after merging this will be 85%-ish, but remember that we aren't testing Let me know if you have other questions! |
Codecov Report
@@ Coverage Diff @@
## master #66 +/- ##
===========================================
+ Coverage 68.82% 85.92% +17.09%
===========================================
Files 9 9
Lines 555 604 +49
===========================================
+ Hits 382 519 +137
+ Misses 173 85 -88
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks amazing. What a :hero: you are
Hey thanks @austin3dickey for looking it over!! Gonna merge it up |
This PR adds a bunch of integration tests and makes it easier to test locally.
return(NULL)
inreturn(invisible(NULL))
to avoid phantom NULLs in logsscroll_url
down into.keep_on_pullin
so that thing can figure out how to format scrolls. This is a cleaner place to handle that anywaydocker-compose.yml
and supporting gnarly bash scripts to make it easier to develop tests locallyTest coverage as of this PR:
I think it's important we get this PR reviewed and working before the next release. Addresses #33 , #36 , and to some extent #43