-
Notifications
You must be signed in to change notification settings - Fork 5
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
Java e2e document controller #161
Conversation
Codecov Report
@@ Coverage Diff @@
## 1.x #161 +/- ##
==========================================
- Coverage 89.01% 88.92% -0.09%
==========================================
Files 244 244
Lines 4406 4407 +1
==========================================
- Hits 3922 3919 -3
- Misses 452 456 +4
Partials 32 32
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.
As I commented on other PR, steps related to m* API could be written using lists of entries, so that it is more obvious the step is working using a list as input e.g [ 'my-fist-doc', 'my-other-doc', ... ]
goStrings := make([]string, len) | ||
for i, s := range tmpslice { | ||
goStrings[i] = C.GoString(s) | ||
goStrings := make([]string, 0) |
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.
What was wrong with the previous version of that function?
Also, since we know the slice's capacity, we may as well use that information to prevent regrowing the slice possibly a few times during the copy: goStrings := make([]string, 0, len)
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.
Nothing, we do a append in every other function so I thought it would be good to also do append in this function, only for consistency.
Good catch for the len though
@@ -116,7 +118,9 @@ func kuzzle_document_validate(d *C.document, index *C.char, collection *C.char, | |||
//export kuzzle_document_search | |||
func kuzzle_document_search(d *C.document, index *C.char, collection *C.char, body *C.char, options *C.query_options) *C.search_result { | |||
res, err := (*document.Document)(d.instance).Search(C.GoString(index), C.GoString(collection), json.RawMessage(C.GoString(body)), SetQueryOptions(options)) | |||
return goToCSearchResult(res, err) | |||
r := goToCSearchResult(res, err) |
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.
What's the added value of storing the result in an intermediary variable before returning it?
And the collection has a document with id 'mupdate-my-document-id' | ||
And the collection has a document with id 'mupdate-my-document-id2' | ||
When I update the documents ['unknown', 'mupdate-my-document-id2'] | ||
And the document 'mupdate-my-document-id2' should be updated |
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.
This line should be a Then.
And it has a collection 'exist-test-collection' | ||
And the collection has a document with id 'exist-my-document-id' | ||
When I check if 'exist-my-document-unknown' exists | ||
Then the document should not exists |
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.
"exist" instead of "exists" has this is an adjective
And it has a collection 'mget-test-collection' | ||
And the collection has a document with id 'mget-my-document-id' | ||
And the collection has a document with id 'mget-my-document-id2' | ||
When I get document ['mget-my-document-id', 'mget-my-document-id2'] |
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.
"documentS"
What does this PR do ?
e2e tests for JAVA document controller
How should this be manually tested?
cd internal/wrappers/features/java gradle cucumber
Other changes
Bug fixes