-
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: refactor driver test #1452
Conversation
@@ -41,17 +41,15 @@ def create_document_to_score(): | |||
# |- matches: (id: 3, parent_id: 1, score.value: 3), | |||
# |- matches: (id: 4, parent_id: 1, score.value: 4), | |||
# |- matches: (id: 5, parent_id: 1, score.value: 5), | |||
|
|||
doc = jina_pb2.DocumentProto() | |||
doc = Document() |
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.
the idea herr is to see if we can refactor the logic of the test itself to be less dependant on id? I am not sure it is possible though
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.
One problem is that this test is so dependant on document logic that any document refactor involves a lot of effort to regfactor these tests. is there a way to avoid this?
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.
the option I can see is to maintain fixtures in a separate file so that we can reuse/modify it anywhere
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.
butis there so many shared code?
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.
there could be, if we "composite" small fixtures into bigger ones, a lot of code are actually shared, from low levels.
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.
okey that'd be great.
Latency summaryCurrent PR yields:
Breakdown
Backed by latency-tracking. Further commits will update this comment. |
@@ -41,17 +41,15 @@ def create_document_to_score(): | |||
# |- matches: (id: 3, parent_id: 1, score.value: 3), | |||
# |- matches: (id: 4, parent_id: 1, score.value: 4), | |||
# |- matches: (id: 5, parent_id: 1, score.value: 5), | |||
|
|||
doc = jina_pb2.DocumentProto() | |||
doc = Document() |
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.
okey that'd be great.
related to #975 , hubio test both locally and in the ci. |
local test passed after running |
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.
minor changes
assert len(filtered_docs) == 1 | ||
for d in filtered_docs: | ||
assert int(d.tags['id']) == 4 | ||
assert len(d.chunks) == 5 |
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.
Is there any specific reason to check the number of chunks here?
assert len(d.chunks) == 5 | |
assert len(d.chunks) == 5 |
Codecov Report
@@ Coverage Diff @@
## master #1452 +/- ##
==========================================
+ Coverage 82.76% 83.00% +0.24%
==========================================
Files 110 110
Lines 6381 6443 +62
==========================================
+ Hits 5281 5348 +67
+ Misses 1100 1095 -5
Continue to review full report at Codecov.
|
@nan-wang sorry I was off yesterday, just saw your message. The test was actually copied from another file |
minor test refactoring on the
querylang
anddriver