-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
test: replace all random docs with new api #1356
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1356 +/- ##
==========================================
+ Coverage 82.95% 83.01% +0.05%
==========================================
Files 103 103
Lines 6746 6746
==========================================
+ Hits 5596 5600 +4
+ Misses 1150 1146 -4
Continue to review full report at Codecov.
|
tests/unit/yaml/test-index.yml
Outdated
@@ -3,7 +3,7 @@ with: | |||
index_filename: tmp2 | |||
metas: | |||
name: test2 | |||
workspace: $JINA_TEST_INDEX | |||
workspace: $TEST_WORKDIR |
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 arr trying to set the habit to prefix env variablws with JINA so please keep it as it was
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'll change it back
@@ -49,7 +49,7 @@ def __getitem__(self, item): | |||
if isinstance(item, int): | |||
return Document(self._docs_proto[item]) | |||
elif isinstance(item, str): | |||
return Document(self._docs_map[str(item)]) |
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 is required, as UniqueId
can not be directly used as a string
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.
oh but the test doesn't complain 🤔
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.
@hanxiao this is what I got in terminal
random_docs
withrandom_docs_new_api
, and ranamerandom_docs_new_api
torandom_docs
. (didn't turn it into a conftest fixture since it has a lot of parameters)tmpdir
.DocumentSet
test. During refactoring, fixed some bugs inDocumentSet
.What has been fixed in
DocumentSet
:__setitem__
callsCopyFrom
, which expect to receive aDocument
, passedDocument.as_pb_object
.__setitem__
for string object not setting, but returning.__getitem__
whenisinstance(key, str)
, we convert the value into a string.